Project

General

Profile

Actions

Bug #13615

open

mdb has issues resolving some symbols in shared libraries

Added by Jason King 9 months ago.

Status:
New
Priority:
Normal
Assignee:
-
Category:
mdb - modular debugger
Start date:
Due date:
% Done:

0%

Estimated time:
Difficulty:
Medium
Tags:
Gerrit CR:

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

test.tar (4.5 KB) test.tar Test program source Jason King, 2021-03-10 03:06 AM

Related issues

Related to illumos gate - Feature #13576: Add mdb ::linkerset commandClosedJason King

Actions
Actions

Also available in: Atom PDF