You are viewing a plain text version of this content. The canonical link for it is here.
Posted to c-dev@xerces.apache.org by "Boris Kolpackov (JIRA)" <xe...@xml.apache.org> on 2009/11/17 14:22:39 UTC

[jira] Closed: (XERCESC-777) XMLPlatformUtils::Initialize() fails to execute any code when called from an shared object

     [ https://issues.apache.org/jira/browse/XERCESC-777?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Boris Kolpackov closed XERCESC-777.
-----------------------------------

    Resolution: Invalid
      Assignee:     (was: Xerces-C Developers Mailing List)

I am pretty sure this is a compiler issue.

> XMLPlatformUtils::Initialize() fails to execute any code when called from an shared object
> ------------------------------------------------------------------------------------------
>
>                 Key: XERCESC-777
>                 URL: https://issues.apache.org/jira/browse/XERCESC-777
>             Project: Xerces-C++
>          Issue Type: Bug
>          Components: Utilities
>    Affects Versions: 2.1.0
>         Environment: Operating System: Solaris
> Platform: Sun
>            Reporter: mstorrs
>
> I have compiled Xerces2.1 (stable) on Solaris 2.8 using g++ 2.95.3.  The 
> samples execute properly.  I am linking the xerces.so to another shared object 
> I am creating.  This shared object is loaded by an application at run time, 
> when I call XMLPlatformUtils::Initialize() from the shared object the code 
> executes the call, but never actually performs any code within that function - 
> I know this because I have editted the Initialize() function and outputed a 
> debug statement to a file (this works successfully during execution of one of 
> the samples).  After Initialize returns, the code continues and then once the 
> code tries to execute getDOMImplementation(), the shared object core dumps, 
> because the global mutex lock is null, since the new XMLMutex statement is 
> never executed within Initialize().  I placed debug statements in this Xerces 
> code as well, and know that the function executes, and crashes once the code 
> tries to lock to set the cleanupfunction.
> Is there any reason that Initialize wouldn't execute the code??  I have 
> attached the shared object code as well as the Makefile.  I also tried with 
> c++, and that failed the exact same way.
> Here is the shared object code:
> extern "C" unsigned int OBLIX_DLLEXPORT Crap(const char *eventName, ObPPPData 
> *data)
> {
>     int iStatus = STATUS_PPP_OK;                    // Return code
>     AbstractDOMParser::ValSchemes valScheme = AbstractDOMParser::Val_Auto;
>     bool                       doNamespaces       = false;
>     bool                       doSchema           = false;
>     bool                       schemaFullChecking = false;
>     bool                       errorOccurred = false;
>     try
>     {
>         FILE *fp = fopen("/opt/netpoint/custom/xerces.txt", "w");
>         fprintf(fp, "Before Initialize\n");
>         fclose(fp);
>         XMLPlatformUtils::Initialize();
>         fp = fopen("/opt/netpoint/custom/xerces.txt", "a");
>         fprintf(fp, "After Initialize\n");
>         fclose(fp);
>     }
>     catch (const XMLException& toCatch)
>     {
>         data->SetResultString("NonInternalUser: XML Exception occured");
>         return STATUS_PPP_ABORT;
>     }
>     catch (...)
>    {
>         data->SetResultString("S Happens");
>         return STATUS_PPP_ABORT;
>     }
>     try
>     {
>         // Instantiate the DOM parser.
>         static const XMLCh gLS[] = { chLatin_L, chLatin_S, chNull };
>         DOMImplementation *impl = 
> DOMImplementationRegistry::getDOMImplementation(gLS);
>         DOMBuilder        *parser = ((DOMImplementationLS*)impl)-
> >createDOMBuilder(DOMImplementationLS:
> :MODE_SYNCHRONOUS, 0);
>         parser->setFeature(XMLUni::fgDOMNamespaces, doNamespaces);
>         parser->setFeature(XMLUni::fgXercesSchema, doSchema);
>         parser->setFeature(XMLUni::fgXercesSchemaFullChecking, 
> schemaFullChecking);
>         if (valScheme == AbstractDOMParser::Val_Auto)
>         {
>             parser->setFeature(XMLUni::fgDOMValidateIfSchema, true);
>         }
>         else if (valScheme == AbstractDOMParser::Val_Never)
>         {
>             parser->setFeature(XMLUni::fgDOMValidation, false);
>         }
>         else if (valScheme == AbstractDOMParser::Val_Always)
>         {
>          parser->setFeature(XMLUni::fgDOMValidation, true);
> etc.
> Makefile
> ----------
> CC       = g++
> SHARED_LIB_EXT       = so
> CFLAGS = -c -DSOLARIS -D_REENTRANT -fpic -Wall -g -O2 -I. -I/usr/local/include -
> I/opt/netpoint/identity
> /oblix/include/ppp -I/opt/netpoint/custom/xerces-c-src2_1_0/include -
> I/opt/netpoint/custom/ldap/include
> LOADFLAG = -DSOLARIS -fpic -mt -shared -L/usr/lib -L/usr/local/lib -
> L/opt/netpoint/custom/ldap/lib -L/o
> pt/netpoint/custom/xerces-c-src2_1_0/lib -lxerces-c -lldap50 -lpthread
> all : fed.$(SHARED_LIB_EXT)
> fed.$(SHARED_LIB_EXT) : common.o FedHandler.o InternalUser.o NonInternalUser.o 
> IntUserToServices.o test
> .o
>     $(CC) $(LOADFLAG) -o $@ common.o FedHandler.o InternalUser.o 
> NonInternalUser.o IntUserToServices.o
> test.o
> common.o : common.cpp
>     $(CC) $(CFLAGS) common.cpp -o $@

-- 
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: c-dev-unsubscribe@xerces.apache.org
For additional commands, e-mail: c-dev-help@xerces.apache.org