Bug #13615
openmdb has issues resolving some symbols in shared libraries
0%
Description
While testing #13576, I discovered a strange inconsistency in the behavior on how mdb resolves symbols. I've attached a small test case which has a linker set in the main binary as well as one in a shared library. Running the program verifies it is able to resolve the linker sets from it's output:
root@pi:/ws/mdbtest# ./test 1: abcd 2: efgh 1: 12345 2: 678910 1 2112 0 ^C
Looking at the symbols, aside from one set residing in a shared library, they appear to be largely similar:
> ::nm ! egrep '__(start|stop)_set_' 0x00000000004013e8|0x0000000000000000|NOTY |GLOB |0x3 |18 |__start_set_bar_set 0x00000000004013f8|0x0000000000000000|NOTY |GLOB |0x3 |18 |__stop_set_bar_set 0xfffffc7fef120f00|0x0000000000000000|NOTY |GLOB |0x3 |24 |__stop_set_foo_set 0xfffffc7fef120ef0|0x0000000000000000|NOTY |GLOB |0x3 |24 |__start_set_foo_set
Yet, the symbols for the linker set for 'bar' (in the main program) can be found, while 'foo' (in the shared library) cannot:
> __stop_set_bar_set=J 4013f8 > __start_set_bar_set=J 4013e8 > __start_set_foo_set=J mdb: failed to dereference symbol: unknown symbol name > __stop_set_foo_set=J mdb: failed to dereference symbol: unknown symbol name >
(Prefixing with libtest.so`
yields the same results)
The 'lookup symbol by name' and 'iterate through all symbols' go through different functions in the mdb proc target (and ultimately through different functions in libproc). I haven't been able to dig deeper into this yet, but it seems almost certain something in the 'lookup by name' path is ignoring those symbols in the shared library, but there doesn't seem to be an obvious reason why they should be ignored.
Files
Related issues
Updated by Jason King over 2 years ago
- Related to Feature #13576: Add mdb ::linkerset command added