What caused the mysterious duplicate entry in my stack?

I am investigating a dead end error. I took the kernel from gcoreand found that one of my functions seems to have named itself, even if it does not call the recursive function.

Here is a stack fragment from gdb:

Thread 18 (Thread 4035926944 (LWP 23449)):
#0  0xffffe410 in __kernel_vsyscall ()
#1  0x005133de in __lll_mutex_lock_wait () from /lib/tls/libpthread.so.0
#2  0x00510017 in _L_mutex_lock_182 () from /lib/tls/libpthread.so.0
#3  0x080d653c in ?? ()
#4  0xf7c59480 in ?? () from LIBFOO.so
#5  0x081944c0 in ?? ()
#6  0x081944b0 in ?? ()
#7  0xf08f3b38 in ?? ()
#8  0xf7c3b34c in FOO::Service::releaseObject ()
   from LIBFOO.so
#9  0xf7c3b34c in FOO::Service::releaseObject ()
   from LIBFOO.so
#10 0xf7c36006 in FOO::RequesterImpl::releaseObject ()
   from LIBFOO.so
#11 0xf7e2afbf in BAR::BAZ::unsubscribe (this=0x80d0070, sSymbol=@0xf6ded018)
    at /usr/lib/gcc/x86_64-redhat-linux/3.4.6/../../../../include/c++/3.4.6/bits/stl_tree.h:176
...more stack

I missed some of the names: FOO and BAR - namespaces .BAZ - class.

The interesting part is # 8 and # 9, the challenge Service::releaseObject(). This function does not call itself and does not call any function that calls it back ... it is not recursive. Why does he appear on the stack twice?

Is this an artifact created by the debugger, or can it be real?

, - , . Service::releaseObject() , , , .

:

g++ v3.4.6 RHEL4. 64- , 32- , -m32. -O3. , , LIBFOO.

Service , vtable. RequesterImpl , vtable.

+3
2

, "" , , __lll_mutex_lock_wait ( ). , ( 2008 ), .

, GDB " ", ( # 2 # 8), , , .

+3

Stacktraces x86 : -O1 enable -fomit-frame-pointer.

+4

Source: https://habr.com/ru/post/1721436/


All Articles