fahadash
fahadash

Reputation: 3281

gdb backtrace is not showing full stack-trace with main()

I am using Xalan library. My program is crashing somewhere inside Xalan calls. I would like to see a full stack-trace from main() all the way to crash point. I am using the following command line to compile

g++ -o program.out -g -O0 -lxalan-c myprogram.out

I am using 'backtrace full' command and getting the following output

 #0  0xb79313b4 in xalanc_1_11::XPath::findRoot(xalanc_1_11::XPathExecutionContext&,    xalanc_1_11::XalanNode*, int const*, int, xalanc_1_11::MutableNodeRefList&) const () from     /usr/lib/libxalan-c.so.111
No symbol table info available.
#1  0xb793afa9 in xalanc_1_11::XPath::step(xalanc_1_11::XPathExecutionContext&, xalanc_1_11::XalanNode*, int const*, xalanc_1_11::MutableNodeRefList&) const
() from /usr/lib/libxalan-c.so.111
No symbol table info available.
#2  0xb793d350 in xalanc_1_11::XPath::locationPath(xalanc_1_11::XalanNode*, int const*,  xalanc_1_11::XPathExecutionContext&) const ()
from /usr/lib/libxalan-c.so.111
No symbol table info available.
#3  0xb7937d22 in xalanc_1_11::XPath::executeMore(xalanc_1_11::XalanNode*, int const*,  xalanc_1_11::XPathExecutionContext&) const ()
from /usr/lib/libxalan-c.so.111
 No symbol table info available.
 #4  0xbffff02c in ?? ()
 No symbol table info available.

The above stack-trace is obviously not showing the full stack-trace starting from main(), what am I missing ?

There is only one thread running, here is the output of show threads

  Id   Target Id         Frame
 * 1    Thread 0xb6f79980 (LWP 8888) "xmltest.out" 0xb79313b4 in xalanc_1_11::XPath::findRoot(xalanc_1_11::XPathExecutionContext&, xalanc_1_11::XalanNode*, int const*, int, xalanc_1_11::MutableNodeRefList&) const () from /usr/lib/libxalan-c.so.111

Upvotes: 5

Views: 3957

Answers (2)

Paul Beusterien
Paul Beusterien

Reputation: 29582

Rebuild libxalan-c with -g and you should see backtraces through it.

As mentioned in the comments -ggdb or -ggdb3 may be needed instead of -g for some targets.

Upvotes: 3

jcm
jcm

Reputation: 2578

Most probably the stack has been corrupted and, because of this, you can't see backtrace's origin.

Although valgrind is not very strong on stack corruptions, you can use it to get more information. If you're using Linux, you will find it in your distribution's development package repository.

Upvotes: 2

Related Questions