|
From: Denis P. <dy...@pe...> - 2003-07-24 05:06:04
|
Hello, > > I have strange errors in backtrace family functions. > > The trace attached is with backtrace.c and backtracesyms.c from > > glibc-2.3.2 compiled with debug and directly linked to see line number. > > > > Interesting thing is that I can not reproduce this on the test case. It > > happens only in big program. Any ideas why this could happend? > > I don't know about this implementation of backtrace(), but such > functions often rummage around in places a portable correct program > never would. That doesn't mean there's necessarily a problem in this > code, but it's worth inspecting (and adding Valgrind macros to clarify > anything correct-but-odd to V itself). > > I'm guessing here, but it may only show up on large code because of the > depth of its stack use. It looks like this. Here it is debug output. It walks the stack until it is in [esp;__libc_stack_end] boundaries. And here is the strange part. 1. Addresses in backtrace different by one with valgrind trace. 2. valgrind starts to issue errors just after backtrace walked over the stack shown by valgrind. Might be this could be fixed by fixing a value of __libc_stack_end by valgrind? On the other side. Traces are working without any problems in other threads. This is a problem in this exact thread. Might this be a sign of stack corruption? esp = 0x43240a1c ebp = 0x43240a28 __libc_stack_end = 0xbffff17c current = 0x43240a28 cnt = 0 current->return_address = 0x815f6c2 current = 0x43241a58 cnt = 1 current->return_address = 0x815f826 current = 0x43241a78 cnt = 2 current->return_address = 0x815a4bc current = 0x43241ba8 cnt = 3 current->return_address = 0x8157420 current = 0x43241cf8 cnt = 4 current->return_address = 0x815a434 current = 0x43241d18 cnt = 5 current->return_address = 0x8158d8a current = 0x43241e88 cnt = 6 current->return_address = 0x8158729 current = 0x43241ed8 cnt = 7 current->return_address = 0x804e54a current = 0x43241f78 cnt = 8 current->return_address = 0x8152a92 current = 0x43241f98 cnt = 9 current->return_address = 0x40ba958c current = 0x43241fd4 cnt = 10 current->return_address = 0x40172d5f current = 0xbffff088 cnt = 11 ==15268== Thread 3: ==15268== Conditional jump or move depends on uninitialised value(s) ==15268== at 0x40D11EDD: _IO_vfprintf_internal (in /lib/libc.so.6) ==15268== by 0x40D148BD: buffered_vfprintf (in /lib/libc.so.6) ==15268== by 0x40D106F0: _IO_vfprintf_internal (in /lib/libc.so.6) ==15268== by 0x40D1AB7E: __GI_fprintf (in /lib/libc.so.6) ==15268== by 0x8167F69: backtrace (backtrace.c:72) ==15268== by 0x815F6C1: getBackTrace(IString&) (iexcept.cpp:79) ==15268== by 0x815F825: IException::IException(IString const&) (iexcept.cpp:103) ==15268== by 0x815A4BB: IIOException::IIOException(IString const&, IString const&) (iiostream.cpp:33) ==15268== by 0x815741F: ISocketException::ISocketException(IString const&, int) (isocketexception.cpp:31) ==15268== by 0x815A433: ITimeOutException::ITimeOutException(IString const&) (../ilib/isocketexception.h:33) ==15268== by 0x8158D89: IPlainSocketImpl::accept(ISocketImpl*) (iplainsocket.cpp:288) ==15268== by 0x8158728: IServerSocket::accept() (isocket.cpp:145) ==15268== by 0x804E549: console::ConsoleDaemon::run() (consoleDaemon.cpp:61) ==15268== by 0x8152A91: ithread_run (ithread.cpp:519) ==15268== by 0x40BA958B: thread_wrapper (vg_libpthread.c:667) ==15268== by 0x40172D5E: do__quit (vg_scheduler.c:2159) ==15268== ==15268== Thread 3: ==15268== Use of uninitialised value of size 4 ==15268== at 0x40D14A9C: _itoa_word (in /lib/libc.so.6) ==15268== by 0x40D12FE8: _IO_vfprintf_internal (in /lib/libc.so.6) ==15268== by 0x40D148BD: buffered_vfprintf (in /lib/libc.so.6) ==15268== by 0x40D106F0: _IO_vfprintf_internal (in /lib/libc.so.6) ==15268== by 0x40D1AB7E: __GI_fprintf (in /lib/libc.so.6) ==15268== by 0x8167F69: backtrace (backtrace.c:72) ==15268== by 0x815F6C1: getBackTrace(IString&) (iexcept.cpp:79) ==15268== by 0x815F825: IException::IException(IString const&) (iexcept.cpp:103) ==15268== by 0x815A4BB: IIOException::IIOException(IString const&, IString const&) (iiostream.cpp:33) ==15268== by 0x815741F: ISocketException::ISocketException(IString const&, int) (isocketexception.cpp:31) ==15268== by 0x815A433: ITimeOutException::ITimeOutException(IString const&) (../ilib/isocketexception.h:33) ==15268== by 0x8158D89: IPlainSocketImpl::accept(ISocketImpl*) (iplainsocket.cpp:288) ==15268== by 0x8158728: IServerSocket::accept() (isocket.cpp:145) ==15268== by 0x804E549: console::ConsoleDaemon::run() (consoleDaemon.cpp:61) ==15268== by 0x8152A91: ithread_run (ithread.cpp:519) ==15268== by 0x40BA958B: thread_wrapper (vg_libpthread.c:667) ==15268== by 0x40172D5E: do__quit (vg_scheduler.c:2159) ==15268== ==15268== Thread 3: ==15268== Conditional jump or move depends on uninitialised value(s) ==15268== at 0x40D11A11: _IO_vfprintf_internal (in /lib/libc.so.6) ==15268== by 0x40D148BD: buffered_vfprintf (in /lib/libc.so.6) ==15268== by 0x40D106F0: _IO_vfprintf_internal (in /lib/libc.so.6) ==15268== by 0x40D1AB7E: __GI_fprintf (in /lib/libc.so.6) ==15268== by 0x8167F69: backtrace (backtrace.c:72) ==15268== by 0x815F6C1: getBackTrace(IString&) (iexcept.cpp:79) ==15268== by 0x815F825: IException::IException(IString const&) (iexcept.cpp:103) ==15268== by 0x815A4BB: IIOException::IIOException(IString const&, IString const&) (iiostream.cpp:33) ==15268== by 0x815741F: ISocketException::ISocketException(IString const&, int) (isocketexception.cpp:31) ==15268== by 0x815A433: ITimeOutException::ITimeOutException(IString const&) (../ilib/isocketexception.h:33) ==15268== by 0x8158D89: IPlainSocketImpl::accept(ISocketImpl*) (iplainsocket.cpp:288) ==15268== by 0x8158728: IServerSocket::accept() (isocket.cpp:145) ==15268== by 0x804E549: console::ConsoleDaemon::run() (consoleDaemon.cpp:61) ==15268== by 0x8152A91: ithread_run (ithread.cpp:519) ==15268== by 0x40BA958B: thread_wrapper (vg_libpthread.c:667) ==15268== by 0x40172D5E: do__quit (vg_scheduler.c:2159) ==15268== ==15268== Thread 3: ==15268== Conditional jump or move depends on uninitialised value(s) ==15268== at 0x40D11A76: _IO_vfprintf_internal (in /lib/libc.so.6) ==15268== by 0x40D148BD: buffered_vfprintf (in /lib/libc.so.6) ==15268== by 0x40D106F0: _IO_vfprintf_internal (in /lib/libc.so.6) ==15268== by 0x40D1AB7E: __GI_fprintf (in /lib/libc.so.6) ==15268== by 0x8167F69: backtrace (backtrace.c:72) ==15268== by 0x815F6C1: getBackTrace(IString&) (iexcept.cpp:79) ==15268== by 0x815F825: IException::IException(IString const&) (iexcept.cpp:103) ==15268== by 0x815A4BB: IIOException::IIOException(IString const&, IString const&) (iiostream.cpp:33) ==15268== by 0x815741F: ISocketException::ISocketException(IString const&, int) (isocketexception.cpp:31) ==15268== by 0x815A433: ITimeOutException::ITimeOutException(IString const&) (../ilib/isocketexception.h:33) ==15268== by 0x8158D89: IPlainSocketImpl::accept(ISocketImpl*) (iplainsocket.cpp:288) ==15268== by 0x8158728: IServerSocket::accept() (isocket.cpp:145) ==15268== by 0x804E549: console::ConsoleDaemon::run() (consoleDaemon.cpp:61) ==15268== by 0x8152A91: ithread_run (ithread.cpp:519) ==15268== by 0x40BA958B: thread_wrapper (vg_libpthread.c:667) ==15268== by 0x40172D5E: do__quit (vg_scheduler.c:2159) ==15268== ==15268== Thread 3: ==15268== Conditional jump or move depends on uninitialised value(s) ==15268== at 0x40D11AEC: _IO_vfprintf_internal (in /lib/libc.so.6) ==15268== by 0x40D148BD: buffered_vfprintf (in /lib/libc.so.6) ==15268== by 0x40D106F0: _IO_vfprintf_internal (in /lib/libc.so.6) ==15268== by 0x40D1AB7E: __GI_fprintf (in /lib/libc.so.6) ==15268== by 0x8167F69: backtrace (backtrace.c:72) ==15268== by 0x815F6C1: getBackTrace(IString&) (iexcept.cpp:79) ==15268== by 0x815F825: IException::IException(IString const&) (iexcept.cpp:103) ==15268== by 0x815A4BB: IIOException::IIOException(IString const&, IString const&) (iiostream.cpp:33) ==15268== by 0x815741F: ISocketException::ISocketException(IString const&, int) (isocketexception.cpp:31) ==15268== by 0x815A433: ITimeOutException::ITimeOutException(IString const&) (../ilib/isocketexception.h:33) ==15268== by 0x8158D89: IPlainSocketImpl::accept(ISocketImpl*) (iplainsocket.cpp:288) ==15268== by 0x8158728: IServerSocket::accept() (isocket.cpp:145) ==15268== by 0x804E549: console::ConsoleDaemon::run() (consoleDaemon.cpp:61) ==15268== by 0x8152A91: ithread_run (ithread.cpp:519) ==15268== by 0x40BA958B: thread_wrapper (vg_libpthread.c:667) ==15268== by 0x40172D5E: do__quit (vg_scheduler.c:2159) current->return_address = 0x1153055 current = 0xbffff0d8 cnt = 12 ==15268== ==15268== Thread 3: ==15268== Conditional jump or move depends on uninitialised value(s) ==15268== at 0x8167F44: backtrace (backtrace.c:66) ==15268== by 0x815F6C1: getBackTrace(IString&) (iexcept.cpp:79) ==15268== by 0x815F825: IException::IException(IString const&) (iexcept.cpp:103) ==15268== by 0x815A4BB: IIOException::IIOException(IString const&, IString const&) (iiostream.cpp:33) ==15268== by 0x815741F: ISocketException::ISocketException(IString const&, int) (isocketexception.cpp:31) ==15268== by 0x815A433: ITimeOutException::ITimeOutException(IString const&) (../ilib/isocketexception.h:33) ==15268== by 0x8158D89: IPlainSocketImpl::accept(ISocketImpl*) (iplainsocket.cpp:288) ==15268== by 0x8158728: IServerSocket::accept() (isocket.cpp:145) ==15268== by 0x804E549: console::ConsoleDaemon::run() (consoleDaemon.cpp:61) ==15268== by 0x8152A91: ithread_run (ithread.cpp:519) ==15268== by 0x40BA958B: thread_wrapper (vg_libpthread.c:667) ==15268== by 0x40172D5E: do__quit (vg_scheduler.c:2159) ==15268== ==15268== Thread 3: ==15268== Conditional jump or move depends on uninitialised value(s) ==15268== at 0x8167F4F: backtrace (backtrace.c:66) ==15268== by 0x815F6C1: getBackTrace(IString&) (iexcept.cpp:79) ==15268== by 0x815F825: IException::IException(IString const&) (iexcept.cpp:103) ==15268== by 0x815A4BB: IIOException::IIOException(IString const&, IString const&) (iiostream.cpp:33) ==15268== by 0x815741F: ISocketException::ISocketException(IString const&, int) (isocketexception.cpp:31) ==15268== by 0x815A433: ITimeOutException::ITimeOutException(IString const&) (../ilib/isocketexception.h:33) ==15268== by 0x8158D89: IPlainSocketImpl::accept(ISocketImpl*) (iplainsocket.cpp:288) ==15268== by 0x8158728: IServerSocket::accept() (isocket.cpp:145) ==15268== by 0x804E549: console::ConsoleDaemon::run() (consoleDaemon.cpp:61) ==15268== by 0x8152A91: ithread_run (ithread.cpp:519) ==15268== by 0x40BA958B: thread_wrapper (vg_libpthread.c:667) ==15268== by 0x40172D5E: do__quit (vg_scheduler.c:2159) ==15268== ==15268== Thread 3: ==15268== Use of uninitialised value of size 4 ==15268== at 0x8167F57: backtrace (backtrace.c:72) ==15268== by 0x815F6C1: getBackTrace(IString&) (iexcept.cpp:79) ==15268== by 0x815F825: IException::IException(IString const&) (iexcept.cpp:103) ==15268== by 0x815A4BB: IIOException::IIOException(IString const&, IString const&) (iiostream.cpp:33) ==15268== by 0x815741F: ISocketException::ISocketException(IString const&, int) (isocketexception.cpp:31) ==15268== by 0x815A433: ITimeOutException::ITimeOutException(IString const&) (../ilib/isocketexception.h:33) ==15268== by 0x8158D89: IPlainSocketImpl::accept(ISocketImpl*) (iplainsocket.cpp:288) ==15268== by 0x8158728: IServerSocket::accept() (isocket.cpp:145) ==15268== by 0x804E549: console::ConsoleDaemon::run() (consoleDaemon.cpp:61) ==15268== by 0x8152A91: ithread_run (ithread.cpp:519) ==15268== by 0x40BA958B: thread_wrapper (vg_libpthread.c:667) ==15268== by 0x40172D5E: do__quit (vg_scheduler.c:2159) current->return_address = 0x10 ==15268== ==15268== Thread 3: ==15268== Use of uninitialised value of size 4 ==15268== at 0x8167F7D: backtrace (backtrace.c:73) ==15268== by 0x815F6C1: getBackTrace(IString&) (iexcept.cpp:79) ==15268== by 0x815F825: IException::IException(IString const&) (iexcept.cpp:103) ==15268== by 0x815A4BB: IIOException::IIOException(IString const&, IString const&) (iiostream.cpp:33) ==15268== by 0x815741F: ISocketException::ISocketException(IString const&, int) (isocketexception.cpp:31) ==15268== by 0x815A433: ITimeOutException::ITimeOutException(IString const&) (../ilib/isocketexception.h:33) ==15268== by 0x8158D89: IPlainSocketImpl::accept(ISocketImpl*) (iplainsocket.cpp:288) ==15268== by 0x8158728: IServerSocket::accept() (isocket.cpp:145) ==15268== by 0x804E549: console::ConsoleDaemon::run() (consoleDaemon.cpp:61) ==15268== by 0x8152A91: ithread_run (ithread.cpp:519) ==15268== by 0x40BA958B: thread_wrapper (vg_libpthread.c:667) ==15268== by 0x40172D5E: do__quit (vg_scheduler.c:2159) ==15268== ==15268== Thread 3: ==15268== Use of uninitialised value of size 4 ==15268== at 0x8167F8B: backtrace (backtrace.c:75) ==15268== by 0x815F6C1: getBackTrace(IString&) (iexcept.cpp:79) ==15268== by 0x815F825: IException::IException(IString const&) (iexcept.cpp:103) ==15268== by 0x815A4BB: IIOException::IIOException(IString const&, IString const&) (iiostream.cpp:33) ==15268== by 0x815741F: ISocketException::ISocketException(IString const&, int) (isocketexception.cpp:31) ==15268== by 0x815A433: ITimeOutException::ITimeOutException(IString const&) (../ilib/isocketexception.h:33) ==15268== by 0x8158D89: IPlainSocketImpl::accept(ISocketImpl*) (iplainsocket.cpp:288) ==15268== by 0x8158728: IServerSocket::accept() (isocket.cpp:145) ==15268== by 0x804E549: console::ConsoleDaemon::run() (consoleDaemon.cpp:61) ==15268== by 0x8152A91: ithread_run (ithread.cpp:519) ==15268== by 0x40BA958B: thread_wrapper (vg_libpthread.c:667) ==15268== by 0x40172D5E: do__quit (vg_scheduler.c:2159) current = 0x4 cnt = 13 |