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 "Mark Whitlock (JIRA)" <ax...@ws.apache.org> on 2005/03/14 18:30:08 UTC

[jira] Created: (AXISCPP-549) Add RTLD_GLOBAL to dlopen

Add RTLD_GLOBAL to dlopen
-------------------------

         Key: AXISCPP-549
         URL: http://issues.apache.org/jira/browse/AXISCPP-549
     Project: Axis-C++
        Type: Bug
    Reporter: Mark Whitlock
 Assigned to: Mark Whitlock 


Committing fix on behalf of Tim Bartley. He wrote....

Hi Mark, 

That wasn't the (only) problem. Eventually I tracked it down. It's because the shared libraries are not loaded with the RTLD_GLOBAL flag. Because of this the type definition of the exception thrown in the channel library is considered different to the type definition (of the same class) in the transport library. This causes flushOutput to generate a call to the unhandled exception handler because it's not considered a matching exception. The fix is to add RTLD_GLOBAL to the flags passed to dlopen as defined in PlatformSpecificUnix.hpp. See http://gcc.gnu.org/faq.html#dso for details as to why this is necessary. 

Incidentally HTTPTransport::flushOutput is incorrectly declared. It has code that throws (well, rethrows) AxisExceptions but it is declared to only throw HTTPTransportExceptions. (Re)Throwing an AxisException should result in the C++ "unexpected()" being called which will abort the process by default. That is, any code that does: 

class BaseE {}; 
class SubE : public BaseE {}; 

void f() throw(SubE) 
{ 
        throw BaseE(); 
} 

int main() 
{ 
        try { 
                f(); 
        } 
        catch (SubE& e) { 
                cout << "Caught sub" << endl; 
        } 
        catch (BaseE&e ) { 
                cout << "Caught base" << endl; 
        } 
}

should, according to the C++ spec, abort. f should be declared throw(BaseE) and then it can throw either BaseE's or SubE's and callers can catch either. 

Cheers, 

Tim
--
IBM Tivoli Access Manager Development
Gold Coast Development Lab, Australia
+61-7-5552-4001 phone
+61-7-5571-0420 fax 

-- 
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-549) Add RTLD_GLOBAL to dlopen

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

    Resolution: Duplicate

This is a duplicate of AXISCPP-533

> Add RTLD_GLOBAL to dlopen
> -------------------------
>
>          Key: AXISCPP-549
>          URL: http://issues.apache.org/jira/browse/AXISCPP-549
>      Project: Axis-C++
>         Type: Bug
>     Reporter: Mark Whitlock
>     Assignee: Mark Whitlock

>
> Committing fix on behalf of Tim Bartley. He wrote....
> Hi Mark, 
> That wasn't the (only) problem. Eventually I tracked it down. It's because the shared libraries are not loaded with the RTLD_GLOBAL flag. Because of this the type definition of the exception thrown in the channel library is considered different to the type definition (of the same class) in the transport library. This causes flushOutput to generate a call to the unhandled exception handler because it's not considered a matching exception. The fix is to add RTLD_GLOBAL to the flags passed to dlopen as defined in PlatformSpecificUnix.hpp. See http://gcc.gnu.org/faq.html#dso for details as to why this is necessary. 
> Incidentally HTTPTransport::flushOutput is incorrectly declared. It has code that throws (well, rethrows) AxisExceptions but it is declared to only throw HTTPTransportExceptions. (Re)Throwing an AxisException should result in the C++ "unexpected()" being called which will abort the process by default. That is, any code that does: 
> class BaseE {}; 
> class SubE : public BaseE {}; 
> void f() throw(SubE) 
> { 
>         throw BaseE(); 
> } 
> int main() 
> { 
>         try { 
>                 f(); 
>         } 
>         catch (SubE& e) { 
>                 cout << "Caught sub" << endl; 
>         } 
>         catch (BaseE&e ) { 
>                 cout << "Caught base" << endl; 
>         } 
> }
> should, according to the C++ spec, abort. f should be declared throw(BaseE) and then it can throw either BaseE's or SubE's and callers can catch either. 
> Cheers, 
> Tim
> --
> IBM Tivoli Access Manager Development
> Gold Coast Development Lab, Australia
> +61-7-5552-4001 phone
> +61-7-5571-0420 fax 

-- 
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