[xml] wrong startElement called


    I am using libxml2-2.6.5-1 on RedHat 9 installed from rpms which I
downloaded from xmlsoft.org.  I have two RedHat 9 computers which are set up
nearly identical to each other, both using libxml2-2.6.5-1.

    I have a C and C++ program I have compiled which uses libxml2.  One on of
the computers it works fine.

    When I copy the binary to the other, the program crashes.  I examined the
stack traces from gdb on both machines and compared them.

    On the computer where the program crashes, the stack trace shows it enters
the functions startElement which is in legacy.c at line 1397.  On the computer
that works, it calls a startElement that is in my own code, a wrapper around

    What might be causing the code to call one startElement() on one machine and
a different one on the other ?  I have been struggling with this for some time,
and I have already checked the versions and file sizes of all the .so libraries
the program uses.

    There is a "static xmlSAXHandler sax" which is defined in my code which
holds a pointer to my startElement.

    It may be relevant (although I don't think it should be) that the code I am
writing is an extension to PHP.  It will eventually be used from a web page,
but I am doing the debugging by running PHP from the command line.

    I'm putting the two stack traces at the end of this message.

    Thanks in advance for any suggestions or tips.  I am running out of things
to try here, so please offer any ideas you have, I'll be glad to look into


(gdb) where
#0  0x403d1927 in xmlSAX2StartElement (ctx=0xbfff0220, fullname=0x0, 
atts=0x0) at SAX2.c:1397
#1  0x403d97ad in startElement (ctx=0x0, fullname=0x0, atts=0x0) at 
#2  0x40341cf9 in xmlParseStartTag (ctxt=0x9ebc6a8) at parser.c:6574
#3  0x40344b68 in xmlParseElement (ctxt=0x9ebc6a8) at parser.c:7838
#4  0x40345bd3 in xmlParseDocument (ctxt=0x9ebc6a8) at parser.c:8510
#5  0x41a4694f in al_xmlSAXParseMem () from 
#6  0x41a42aec in xml_loadVariable () from /usr/lib/php4/al_util_jjohnson.so
#7  0x41a42669 in xml_init_struct () from /usr/lib/php4/al_util_jjohnson.so
#8  0x410f7140 in zif_test_get_table(int, _zval_struct*, _zval_struct*, int) 
(ht=1, return_value=0x8360984,
    this_ptr=0x0, return_value_used=0) at al_util.cpp:4322
#9  0x0815354c in execute ()
#10 0x0813a7b6 in zend_execute_scripts ()
#11 0x080705ea in php_execute_script ()
#12 0x0806d648 in main ()
#13 0x4013e917 in __libc_start_main () from /lib/libc.so.6

(gdb) where
#0  0x401d1a60 in strcpy () from /lib/libc.so.6
#1  0x41796e30 in startElement ()
#2  0x41b28cf9 in xmlParseStartTag (ctxt=0x9c7e150) at parser.c:6574
#3  0x41b2bb68 in xmlParseElement (ctxt=0x9c7e150) at parser.c:7838
#4  0x41b2cbd3 in xmlParseDocument (ctxt=0x9c7e150) at parser.c:8510
#5  0x417969b3 in al_xmlSAXParseMem ()
#6  0x41792b10 in xml_loadVariable ()
#7  0x4179268d in xml_init_struct ()
#8  0x413ab9d1 in AlSessionGlobal::AlSessionGlobal(std::string, std::string, 
std::string, std::map<std::string, std::string, std::less<std::string>, 
std::allocator<std::pair<std::string const, std::string> > >*, 
std::map<std::string, std::string, std::less<std::string>, 
std::allocator<std::pair<std::string const, std::string> > >*) ()
#9  0x40e386ed in zif_al_session_global_cpp(int, _zval_struct*, 
_zval_struct*, int) (ht=5, return_value=0x8353ea4, this_ptr=0x0, 
    at al_util.cpp:1080
#10 0x408fe6a2 in zend_oe ()
   from /usr/local/Zend/lib/Optimizer-2.5.1/php-4.3.x/ZendOptimizer.so
#11 0x408fb120 in zend_oe ()
   from /usr/local/Zend/lib/Optimizer-2.5.1/php-4.3.x/ZendOptimizer.so
#12 0x0816b48d in zend_execute_scripts (type=8, retval=0x0, file_count=3)
    at /root/software/php-4.3.4/Zend/zend.c:884
#13 0x081455f7 in php_execute_script (primary_file=0xbffff150)
    at /root/software/php-4.3.4/main/main.c:1729
#14 0x08183e47 in main (argc=4, argv=0xbffff1d4)
    at /root/software/php-4.3.4/sapi/cli/php_cli.c:819
#15 0x4016d917 in __libc_start_main () from /lib/libc.so.6

Robert G. Ristroph
Airlink Systems
rristroph airlinksystems com
(512) 231-1240 x103

This message was sent using IMP, the Internet Messaging Program.

[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]