[ http://nagoya.apache.org/jira/browse/XERCESC-777?page=history ]
Alberto Massari updated XERCESC-777: ------------------------------------ Priority: Major > XMLPlatformUtils::Initialize() fails to execute any code when called from an shared > object > ------------------------------------------------------------------------------------------ > > Key: XERCESC-777 > URL: http://nagoya.apache.org/jira/browse/XERCESC-777 > Project: Xerces-C++ > Type: Bug > Components: Utilities > Versions: 2.1.0 > Environment: Operating System: Solaris > Platform: Sun > Reporter: mstorrs > Assignee: Xerces-C Developers Mailing List > > 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. - If you think it was sent incorrectly contact one of the administrators: http://nagoya.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 --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]