Getting Xerces to parse an xml with entity callouts specifying a URL and 
requiring Xerces to use a specific proxyhost using the curl library to setup 
the proxyhost resulted in a core dump. I've read the documentation for both 
curl lib and Xerces on how to enable the netaccessor and set the proxy host. 
The bus error was generated in 
xercesc/util/NetAccessors/Socket/UnixHTTPURLInputStream.cpp. I've listed the 
steps of what was done below:

I've must have incorrectly configured or built the library or I'm missing a 
step. Is there a way to confirm what netaccessor the built library is using? 
What other info can I provide to help in resolving this matter?

Thanks for all your support

1) configure Xerces with the following options
======================================================
./configure --prefix=/site/sw/ots/xerces/xerces-c-3.0.1 
--exec-prefix=/site/ots/xerces/xerces-c-3.0.1 CXX=/opt/aCC/bin/aCC 
CXXFLAGS="-Aa -mt -g" CPPFLAGS="-I/site/sw/ots/curl/curl-7.19.6/include"  
--enable-netaccessor-curl  --with-curl=/site/sw/ots/curl/curl-7.19.6 

2) config.log confirmed Xerces was configured to use netaccessor curl
======================================================
configure:26068: checking for libcurl
configure:26086: result: /site/sw/ots/curl/curl-7.19.6
configure:26102: checking whether we can support the libcurl-based NetAccessor
configure:26121: result: yes
configure:26130: checking whether we can support the sockets-based NetAccessor
configure:26148: result: yes
configure:26548: checking for which NetAccessor to use (choices: -CURL- 
-socket-)
configure:26628: result: curl
...
configure:29833: Report:
configure:29835:   File Manager: POSIX
configure:29837:   Mutex Manager: POSIX
configure:29839:   Transcoder: iconv
configure:29841:   NetAccessor: curl
configure:29843:   Message Loader: inmemory

3)built and installed Xerces

4)Used curl lib to setup the proxyhost:
======================================================

        curl_global_init(CURL_GLOBAL_ALL);
        _cURLHandle = curl_easy_init();
        curl_easy_setopt(_cURLHandle, CURLOPT_PROXY, proxyHostPort);

5) set the env var http_proxy to the proxy host

6) invoked Xerces parse method and the program terminated with a Bus error
======================================================

        _XmlDOMParser->setValidationScheme(_XmlDOMParser->Val_Always);
        _XmlDOMParser->setDoSchema(false);
        resetErrorHandler();
      _XmlDOMParser->parse(xmlDoc);

Program terminated with signal 10, Bus error.
warning: The shared libraries were not privately mapped; setting a
breakpoint in a shared library will not work until you rerun the program.

#1  0xc9e0fe74 in xercesc_3_0::SocketNetAccessor::makeNew (this=0x4001eb40, 
urlsour...@0x400401f8, httpInfo=0x0) at ./xercesc/util/XMemory.hpp:107
#2  0xc9b9c768 in xercesc_3_0::XMLURL::makeNewStream (this=0x400401f8) at 
xercesc/util/XMLURL.cpp:660
#3  0xc9c3b980 in xercesc_3_0::URLInputSource::makeStream (this=0x400401e0) at 
xercesc/framework/URLInputSource.cpp:96
#4  0xc9c866f0 in xercesc_3_0::ReaderMgr::createReader (this=0x400a11fc, 
s...@0x400401e0, No.Identifier=false, refFrom=RefFrom_NonLiteral, type=Type_PE, 
source=Source_External, calcSrcOfs=false) at xercesc/internal/ReaderMgr.cpp:365
#5  0xc9c87f40 in xercesc_3_0::ReaderMgr::createReader (this=0x400a11fc, 
baseURI=0x40057c98, sysId=0x4001f5e8, pubId=0x4001f578, xmlDecl=false, 
refFrom=RefFrom_NonLiteral, type=Type_PE, source=Source_External, 
srctofi...@0x6fff62b8, calcSrcOfs=false, disableDefaultEntityResolution=false) 
at xercesc/internal/ReaderMgr.cpp:684
#6  0xc9d6eaac in xercesc_3_0::DTDScanner::expandPERef (this=0x6fff6030, 
scanExternal=true, inLiteral=false, inMarkup=false, throwEndOfExt=true) at 
xercesc/validators/DTD/DTDScanner.cpp:259
#7  0xc9d77f60 in xercesc_3_0::DTDScanner::scanInternalSubset (this=0x6fff6030) 
at xercesc/validators/DTD/DTDScanner.cpp:2937
#8  0xc9c6c8a0 in xercesc_3_0::IGXMLScanner::scanDocTypeDecl (this=0x400a1178) 
at xercesc/internal/IGXMLScanner.cpp:1410
#9  0xc9cba61c in xercesc_3_0::XMLScanner::scanProlog (this=0x400a1178) at 
xercesc/internal/XMLScanner.cpp:1268
#10 0xc9c65ebc in xercesc_3_0::IGXMLScanner::scanDocument (this=0x400a1178, 
s...@0x400eced8) at xercesc/internal/IGXMLScanner.cpp:205
#11 0xc9cb6e2c in xercesc_3_0::XMLScanner::scanDocument (this=0x400a1178, 
systemId=0x40040178) at xercesc/internal/XMLScanner.cpp:395
#12 0xc9cb6ed4 in xercesc_3_0::XMLScanner::scanDocument (this=0x400a1178, 
systemId=0x4001c8c8 "777_d622w001xmlsupjw_20090905_mpdsup.xml") at 
xercesc/internal/XMLScanner.cpp:403
#13 0xc9cfa774 in xercesc_3_0::AbstractDOMParser::parse (this=0x4004ffd0, 
systemId=0x4001c8c8 "777_d622w001xmlsupjw_20090905_mpdsup.xml") at 
xercesc/parsers/AbstractDOMParser.cpp:591


-----Original Message-----
From: David Bertoni [mailto:[email protected]] 
Sent: Friday, November 06, 2009 11:27 AM
To: [email protected]
Subject: Re: What is the difference between configuring Xerces 3.0.1 
with--enable-netaccessor-curlvs--enable-netaccessor-socket?

Vitaly Prapirny wrote:
> Dantzler, DeWayne C wrote:
>> my assumption is that somehow Xerces must use it. Given Alberto 
>> comments "If you use --enable-netaccessor-curl Xerces will use the 
>> APIs provided by libcurl, so if you use the same API to setup a 
>> global proxy
> 
> Xerces does nothing with the proxy settings. What Alberto means is 
> that you should use the *libcurl* API to setup a global proxy. Simply 
> use any of the libcurl abilities to specify proxy settings, not the 
> Xerces API.
> 
> Seems that my english is not perfect enough :)
Some of the confusion is that Xerces-C doesn't provide access to the libcurl 
handle that you need to set values using the API. Instead, you need to set the 
environment variable described in the documentation.

Dave

Reply via email to