You are viewing a plain text version of this content. The canonical link for it is here.
Posted to c-dev@axis.apache.org by "Tim Bartley (JIRA)" <ax...@ws.apache.org> on 2005/03/11 23:37:57 UTC

[jira] Created: (AXISCPP-533) Inter shared library exception handling broken on Linux

Inter shared library exception handling broken on Linux
-------------------------------------------------------

         Key: AXISCPP-533
         URL: http://issues.apache.org/jira/browse/AXISCPP-533
     Project: Axis-C++
        Type: Bug
  Components: Basic Architecture  
    Versions: current (nightly)    
 Environment: GNU specific (as far as I know)
    Reporter: Tim Bartley


On Linux, actually on systems where the compiler and common libraries are g++ and gnu and glibc, exception handling between shared libraries is broken. It is broken because the same class in different shared libraries is treated differently so that an HTTPTransportException thrown by a channel library does not match "catch (HTTPTransportException& e)" in the transport library.

Refer to http://gcc.gnu.org/faq.html#dso for details.

The fix is to load the subordinate library with RTLD_GLOBAL flag.

As far as I know this is GNU specific but may apply to other platforms.

It's possible that others are not seeing this because the context in which I am running Axis is from within an application that itself dynamically loads a library that depends on Axis.

Cheers,

Tim

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
If you want more information on JIRA, or have a bug to report see:
   http://www.atlassian.com/software/jira


[jira] Commented: (AXISCPP-533) Inter shared library exception handling broken on Linux

Posted by "Emanuel Norrbin (JIRA)" <ax...@ws.apache.org>.
    [ http://issues.apache.org/jira/browse/AXISCPP-533?page=comments#action_12372059 ] 

Emanuel Norrbin commented on AXISCPP-533:
-----------------------------------------

I found another interesting problem related to this.

I have two wsdl:s that generate server C++ stubs with classes that have the same C++ names but different interfaces/implementations. Since these web services are compiled into separate .so libraries there is no problem with this at compile time.

For separate reasons we need to load libraries using the RTLD_GLOBAL flag (using g++ on Linux) as mentioned in the original post. Just like Tim we really need this flag when libraries are loaded by the axis_server for our product to work. Now for the gotcha: With this flag set, any of the two classes having the same names can be loaded by axis when serializing/deserializing a soap message. This will ofcourse not work if the wrong class is picked. We have worked around this problem by putting one of the generated classes in a separate namespace with corresponding changes to the implementation. An alternative is to never use the same class name, but this is hard to enforce and wsdl2ws itself produces classes with the same names, e.g. AxisServiceException which is always generated.

I dont know if this could solve the problems found by Adrian (see comment above) but it would be easy to fix in wsdl2ws for C++:

1. Generate a unique namespace for each web service. A GUID would work.
2. Let each Axis generated class belong to this namespace.
3. Put a "using namespace XXX" in the beginning of each *.cpp file (after the #includes section).

Please give your comments to this.

/Emanuel


> Inter shared library exception handling broken on Linux
> -------------------------------------------------------
>
>          Key: AXISCPP-533
>          URL: http://issues.apache.org/jira/browse/AXISCPP-533
>      Project: Axis-C++
>         Type: Bug
>   Components: Basic Architecture
>     Versions: current (nightly)
>  Environment: GNU specific (as far as I know)
>     Reporter: Tim Bartley
>     Assignee: Mark Whitlock

>
> On Linux, actually on systems where the compiler and common libraries are g++ and gnu and glibc, exception handling between shared libraries is broken. It is broken because the same class in different shared libraries is treated differently so that an HTTPTransportException thrown by a channel library does not match "catch (HTTPTransportException& e)" in the transport library.
> Refer to http://gcc.gnu.org/faq.html#dso for details.
> The fix is to load the subordinate library with RTLD_GLOBAL flag.
> As far as I know this is GNU specific but may apply to other platforms.
> It's possible that others are not seeing this because the context in which I am running Axis is from within an application that itself dynamically loads a library that depends on Axis.
> Cheers,
> Tim

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira


[jira] Commented: (AXISCPP-533) Inter shared library exception handling broken on Linux

Posted by "Henrik Nordberg (JIRA)" <ax...@ws.apache.org>.
    [ http://issues.apache.org/jira/browse/AXISCPP-533?page=comments#action_12366725 ] 

Henrik Nordberg commented on AXISCPP-533:
-----------------------------------------

We, too, require this flag to be passed to dlopen() on Linux, or else our code fails. I hope someone can revist this issue.
Thanks

> Inter shared library exception handling broken on Linux
> -------------------------------------------------------
>
>          Key: AXISCPP-533
>          URL: http://issues.apache.org/jira/browse/AXISCPP-533
>      Project: Axis-C++
>         Type: Bug
>   Components: Basic Architecture
>     Versions: current (nightly)
>  Environment: GNU specific (as far as I know)
>     Reporter: Tim Bartley
>     Assignee: Mark Whitlock

>
> On Linux, actually on systems where the compiler and common libraries are g++ and gnu and glibc, exception handling between shared libraries is broken. It is broken because the same class in different shared libraries is treated differently so that an HTTPTransportException thrown by a channel library does not match "catch (HTTPTransportException& e)" in the transport library.
> Refer to http://gcc.gnu.org/faq.html#dso for details.
> The fix is to load the subordinate library with RTLD_GLOBAL flag.
> As far as I know this is GNU specific but may apply to other platforms.
> It's possible that others are not seeing this because the context in which I am running Axis is from within an application that itself dynamically loads a library that depends on Axis.
> Cheers,
> Tim

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira


[jira] Updated: (AXISCPP-533) Inter shared library exception handling broken on Linux

Posted by "Fred Preston (JIRA)" <ax...@ws.apache.org>.
     [ http://issues.apache.org/jira/browse/AXISCPP-533?page=all ]

Fred Preston updated AXISCPP-533:
---------------------------------

    Assign To:     (was: Mark Whitlock)

> Inter shared library exception handling broken on Linux
> -------------------------------------------------------
>
>          Key: AXISCPP-533
>          URL: http://issues.apache.org/jira/browse/AXISCPP-533
>      Project: Axis-C++
>         Type: Bug

>   Components: Basic Architecture
>     Versions: current (nightly)
>  Environment: GNU specific (as far as I know)
>     Reporter: Tim Bartley

>
> On Linux, actually on systems where the compiler and common libraries are g++ and gnu and glibc, exception handling between shared libraries is broken. It is broken because the same class in different shared libraries is treated differently so that an HTTPTransportException thrown by a channel library does not match "catch (HTTPTransportException& e)" in the transport library.
> Refer to http://gcc.gnu.org/faq.html#dso for details.
> The fix is to load the subordinate library with RTLD_GLOBAL flag.
> As far as I know this is GNU specific but may apply to other platforms.
> It's possible that others are not seeing this because the context in which I am running Axis is from within an application that itself dynamically loads a library that depends on Axis.
> Cheers,
> Tim

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira


[jira] Reopened: (AXISCPP-533) Inter shared library exception handling broken on Linux

Posted by "Adrian Dick (JIRA)" <ax...@ws.apache.org>.
     [ http://issues.apache.org/jira/browse/AXISCPP-533?page=history ]
     
Adrian Dick reopened AXISCPP-533:
---------------------------------


I have had to back out this change for Linux.
When trace is turned on we are seeing the following problems:
- Problems with destruction for AxisBench testcase
- SegFaults when a soap fault or transport exception is encountered within ExceptionTestDoc and FaultMappingDoc testcases.

> Inter shared library exception handling broken on Linux
> -------------------------------------------------------
>
>          Key: AXISCPP-533
>          URL: http://issues.apache.org/jira/browse/AXISCPP-533
>      Project: Axis-C++
>         Type: Bug
>   Components: Basic Architecture
>     Versions: current (nightly)
>  Environment: GNU specific (as far as I know)
>     Reporter: Tim Bartley
>     Assignee: Mark Whitlock

>
> On Linux, actually on systems where the compiler and common libraries are g++ and gnu and glibc, exception handling between shared libraries is broken. It is broken because the same class in different shared libraries is treated differently so that an HTTPTransportException thrown by a channel library does not match "catch (HTTPTransportException& e)" in the transport library.
> Refer to http://gcc.gnu.org/faq.html#dso for details.
> The fix is to load the subordinate library with RTLD_GLOBAL flag.
> As far as I know this is GNU specific but may apply to other platforms.
> It's possible that others are not seeing this because the context in which I am running Axis is from within an application that itself dynamically loads a library that depends on Axis.
> Cheers,
> Tim

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
If you want more information on JIRA, or have a bug to report see:
   http://www.atlassian.com/software/jira


[jira] Updated: (AXISCPP-533) Inter shared library exception handling broken on Linux

Posted by "nadir amra (JIRA)" <ax...@ws.apache.org>.
     [ https://issues.apache.org/jira/browse/AXISCPP-533?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

nadir amra updated AXISCPP-533:
-------------------------------

    Comment: was deleted

> Inter shared library exception handling broken on Linux
> -------------------------------------------------------
>
>                 Key: AXISCPP-533
>                 URL: https://issues.apache.org/jira/browse/AXISCPP-533
>             Project: Axis-C++
>          Issue Type: Bug
>          Components: Basic Architecture
>    Affects Versions: current (nightly)
>         Environment: GNU specific (as far as I know)
>            Reporter: Tim Bartley
>
> On Linux, actually on systems where the compiler and common libraries are g++ and gnu and glibc, exception handling between shared libraries is broken. It is broken because the same class in different shared libraries is treated differently so that an HTTPTransportException thrown by a channel library does not match "catch (HTTPTransportException& e)" in the transport library.
> Refer to http://gcc.gnu.org/faq.html#dso for details.
> The fix is to load the subordinate library with RTLD_GLOBAL flag.
> As far as I know this is GNU specific but may apply to other platforms.
> It's possible that others are not seeing this because the context in which I am running Axis is from within an application that itself dynamically loads a library that depends on Axis.
> Cheers,
> Tim

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


---------------------------------------------------------------------
To unsubscribe, e-mail: axis-c-dev-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-c-dev-help@ws.apache.org


[jira] Commented: (AXISCPP-533) Inter shared library exception handling broken on Linux

Posted by "Adrian Dick (JIRA)" <ax...@ws.apache.org>.
    [ http://issues.apache.org/jira/browse/AXISCPP-533?page=comments#action_12372075 ] 

Adrian Dick commented on AXISCPP-533:
-------------------------------------

In response to Emanuel Norrbin.

The issue of namespaces to avoid name collisions is a known issue (see AXISCPP-882).

> Inter shared library exception handling broken on Linux
> -------------------------------------------------------
>
>          Key: AXISCPP-533
>          URL: http://issues.apache.org/jira/browse/AXISCPP-533
>      Project: Axis-C++
>         Type: Bug
>   Components: Basic Architecture
>     Versions: current (nightly)
>  Environment: GNU specific (as far as I know)
>     Reporter: Tim Bartley
>     Assignee: Mark Whitlock

>
> On Linux, actually on systems where the compiler and common libraries are g++ and gnu and glibc, exception handling between shared libraries is broken. It is broken because the same class in different shared libraries is treated differently so that an HTTPTransportException thrown by a channel library does not match "catch (HTTPTransportException& e)" in the transport library.
> Refer to http://gcc.gnu.org/faq.html#dso for details.
> The fix is to load the subordinate library with RTLD_GLOBAL flag.
> As far as I know this is GNU specific but may apply to other platforms.
> It's possible that others are not seeing this because the context in which I am running Axis is from within an application that itself dynamically loads a library that depends on Axis.
> Cheers,
> Tim

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira


[jira] Commented: (AXISCPP-533) Inter shared library exception handling broken on Linux

Posted by "Tim Bartley (JIRA)" <ax...@ws.apache.org>.
     [ http://issues.apache.org/jira/browse/AXISCPP-533?page=comments#action_62625 ]
     
Tim Bartley commented on AXISCPP-533:
-------------------------------------

Hmmm. Unfortunate. I know that I *need* this flag. I'll investigate the test programs and see if I can understand why use of this flag induces these problems.

Thanks,

Tim

> Inter shared library exception handling broken on Linux
> -------------------------------------------------------
>
>          Key: AXISCPP-533
>          URL: http://issues.apache.org/jira/browse/AXISCPP-533
>      Project: Axis-C++
>         Type: Bug
>   Components: Basic Architecture
>     Versions: current (nightly)
>  Environment: GNU specific (as far as I know)
>     Reporter: Tim Bartley
>     Assignee: Mark Whitlock

>
> On Linux, actually on systems where the compiler and common libraries are g++ and gnu and glibc, exception handling between shared libraries is broken. It is broken because the same class in different shared libraries is treated differently so that an HTTPTransportException thrown by a channel library does not match "catch (HTTPTransportException& e)" in the transport library.
> Refer to http://gcc.gnu.org/faq.html#dso for details.
> The fix is to load the subordinate library with RTLD_GLOBAL flag.
> As far as I know this is GNU specific but may apply to other platforms.
> It's possible that others are not seeing this because the context in which I am running Axis is from within an application that itself dynamically loads a library that depends on Axis.
> Cheers,
> Tim

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
If you want more information on JIRA, or have a bug to report see:
   http://www.atlassian.com/software/jira


[jira] Closed: (AXISCPP-533) Inter shared library exception handling broken on Linux

Posted by "Mark Whitlock (JIRA)" <ax...@ws.apache.org>.
     [ http://issues.apache.org/jira/browse/AXISCPP-533?page=history ]
     
Mark Whitlock closed AXISCPP-533:
---------------------------------

    Resolution: Fixed

I have fixed this as suggested by or'ing in RTLD_GLOBAL to the dlopen call on AIX and Linux. Windows and OS/400 do not pass in these flags in the same way.

> Inter shared library exception handling broken on Linux
> -------------------------------------------------------
>
>          Key: AXISCPP-533
>          URL: http://issues.apache.org/jira/browse/AXISCPP-533
>      Project: Axis-C++
>         Type: Bug
>   Components: Basic Architecture
>     Versions: current (nightly)
>  Environment: GNU specific (as far as I know)
>     Reporter: Tim Bartley
>     Assignee: Mark Whitlock

>
> On Linux, actually on systems where the compiler and common libraries are g++ and gnu and glibc, exception handling between shared libraries is broken. It is broken because the same class in different shared libraries is treated differently so that an HTTPTransportException thrown by a channel library does not match "catch (HTTPTransportException& e)" in the transport library.
> Refer to http://gcc.gnu.org/faq.html#dso for details.
> The fix is to load the subordinate library with RTLD_GLOBAL flag.
> As far as I know this is GNU specific but may apply to other platforms.
> It's possible that others are not seeing this because the context in which I am running Axis is from within an application that itself dynamically loads a library that depends on Axis.
> Cheers,
> Tim

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
If you want more information on JIRA, or have a bug to report see:
   http://www.atlassian.com/software/jira


[jira] Assigned: (AXISCPP-533) Inter shared library exception handling broken on Linux

Posted by "Mark Whitlock (JIRA)" <ax...@ws.apache.org>.
     [ http://issues.apache.org/jira/browse/AXISCPP-533?page=history ]

Mark Whitlock reassigned AXISCPP-533:
-------------------------------------

    Assign To: Mark Whitlock

> Inter shared library exception handling broken on Linux
> -------------------------------------------------------
>
>          Key: AXISCPP-533
>          URL: http://issues.apache.org/jira/browse/AXISCPP-533
>      Project: Axis-C++
>         Type: Bug
>   Components: Basic Architecture
>     Versions: current (nightly)
>  Environment: GNU specific (as far as I know)
>     Reporter: Tim Bartley
>     Assignee: Mark Whitlock

>
> On Linux, actually on systems where the compiler and common libraries are g++ and gnu and glibc, exception handling between shared libraries is broken. It is broken because the same class in different shared libraries is treated differently so that an HTTPTransportException thrown by a channel library does not match "catch (HTTPTransportException& e)" in the transport library.
> Refer to http://gcc.gnu.org/faq.html#dso for details.
> The fix is to load the subordinate library with RTLD_GLOBAL flag.
> As far as I know this is GNU specific but may apply to other platforms.
> It's possible that others are not seeing this because the context in which I am running Axis is from within an application that itself dynamically loads a library that depends on Axis.
> Cheers,
> Tim

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
If you want more information on JIRA, or have a bug to report see:
   http://www.atlassian.com/software/jira