Hello,
 I am using Xerces-C 1.6 and Xalan-C 1.3 on RedHat Linux 7.1. My
application makes use of C++ STL and I get crashes at random points.
I've came to a small sample that always crashes on my system. Sample
source, compile commands and stack trace are attached below.
  I am pretty sure I have a valid Xalan installation because all code
that uses Xalan but doesn't use STL streams never crashes (same for code
that uses STL but doesn't use Xalan). 
Is it possible that Xalan is not compatible with STL streams? Any ideas?

BR
--Sergey Petrunia

--test.cpp----------------------------------
#include <iostream>
#include <sstream>
#include <string>

int main(int argc, char* argv)
{
    std::ostringstream out_str;
        out_str << "hello there!";
        std::string s = out_str.str();

        std::cout << "buffer contents:" << s  << std::endl;

}
// yes, no Xalan api use at all. Just link it with xalan and it will
crash. --Build commands ------------------------------------------
gcc -c -I/usr/local/src/xerces-c-src1_6_0/include
-I/usr/local/src/xalan-1_3/c/src test.cpp

# Link test.o with xalan and without
gcc  -o no_xalan -L/usr/local/src/xerces-c-src1_6_0/lib
-L/usr/local/src/xalan-1_3/c/lib -lstdc++ -lxerces-c1_6_0 -lpthread
test.o 

gcc  -o with_xalan -L/usr/local/src/xerces-c-src1_6_0/lib
-L/usr/local/src/xalan-1_3/c/lib -lstdc++ -lxerces-c1_6_0 -lxalan-c1_3
-lpthread test.o 

--Running------------------------------------------
$ ./no_xalan 
buffer contents:hello there!
$ ./with_xalan 
Segmentation fault (core dumped)
$ 

--Stack trace for with_xalan------------------------

#0  0x00000000 in ?? ()
#1  0x4004a598 in __user_type_info::dyncast (this=0x804de9c, boff=0,
target=@0x804de9c, objptr=0xbffff934, subtype=@0x804de08, 
    subptr=0xbffff934) from /usr/lib/libstdc++-libc6.2-2.so.3 #2
0x4004c033 in __dynamic_cast_2 (from=0x804b1c4 <stringbuf type_info
function+48>, 
    to=0x804b1c4 <stringbuf type_info function+48>, boff=0,
address=0xbffff934, sub=0x804a8d4 <_start+20>, subptr=0xbffff934)
   from /usr/lib/libstdc++-libc6.2-2.so.3
#3  0x0804ade5 in ostringstream::~ostringstream ()
#4  0x0804aa43 in main ()
#5  0x407ca306 in __libc_start_main (main=0x804a9f0 <main+48>, argc=1,
ubp_av=0xbffffa8c, 
    init=0x804a54c <streambuf::sys_write(char const *, int)+8>,
fini=0x804c34c <_IO_stdin_used+12>, 
    rtld_fini=0x4000d2dc <_dl_fini>, stack_end=0xbffffa7c) at
../sysdeps/generic/libc-start.c:129
(gdb) 

Reply via email to