Page MenuHomeFreeBSD

[libthr] revert change of visibility of _thread_keytable to unbreak debugger
ClosedPublic

Authored by mizhka_gmail.com on Jul 26 2017, 3:36 PM.

Details

Summary

As of r321414, port sysutils/pstack doesn't work with multithreaded processes. Root cause is change of _thread_keytable visibility by r318539.
This fix is to revert field visibility change.

Test Plan

Before fix:

# pstack `pgrep firefox`
68450: /usr/local/lib/firefox/firefox
----------------- thread -1 (running) -----------------
 0x8020e056a _poll (f2232ef, 8, 6, 0, ffffffff, 0) + a

After fix:

# pstack `pgrep firefox`
71556: /usr/local/lib/firefox/firefox
----------------- thread 100258 (running) -----------------
 0x8020e056a _poll (75b4867, 8, 1, 0, 1, 8) + a
 0x8075b4867 _init (75b4944, 8, 7874470, 8, 7874948, 8) + 35827
 0x8075b4944 g_main_context_iteration (75b6556, 8, eaecba99, 23bc84bd, 143e130, 8) + 64
 0x8075b6556 _init (75dc43a, 8, 12a7d01, 8, 12a7d00, 8) + 37516
 0x8075dc43a _init (1d9ac45, 8, 0, 0, 0, 0) + 5d3fa
 0x801d9ac45 _init (0, 0) + 1b45

----------------- thread 100276 (running) -----------------
 0x8020e056a _poll (75b4867, 8, dfdfcf20, 7fff, 1, 1) + a
 0x8075b4867 _init (75b4bdf, 8, 3064020, 8, 1461000, 8) + 35827
 0x8075b4bdf g_main_loop_run (706f4ab, 8, eaecba99, 23bc84bd, 143e1d0, 8) + df
 0x80706f4ab _init (75dc43a, 8, 12a8701, 8, 12a8700, 8) + a6cf3
 0x8075dc43a _init (1d9ac45, 8, 0, 0, 0, 0) + 5d3fa
 0x801d9ac45 _init (0, 0) + 1b45

----------------- thread 100344 (running) -----------------
 0x80200765a kevent (144a4d98, 8, 146d4310, 8, cbab110, 8) + a
 0x8144a4d98 event_base_loop (d8b7f38, 8, eaecba99, 23bc84bd, 143eef0, 8) + 358
 0x80d8b7f38 _ZN4base19MessagePumpLibevent3RunEPNS_11MessagePump8DelegateE (2, 2, 319dd38, 8, 319dd38, 8) + f8

----------------- thread 100347 (running) -----------------
 0x801da8d2c _umtx_op_err (1da6aa8, 8, df9fad00, 7fff, cb31bb8, 8) + c
 0x801da6aa8 _init (1289f292, 8, 5978b84d, 0, 13729, 0) + d9a8
 0x81289f292 PR_WaitCondVar (d5e92c4, 8, cb31bb0, 8, 0, 406f4000) + e2

... (more lines)...

Diff Detail

Repository
rS FreeBSD src repository
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.

Event Timeline

mizhka_gmail.com edited the test plan for this revision. (Show Details)Jul 26 2017, 3:52 PM
kib added inline comments.Jul 26 2017, 3:54 PM
thread/thr_private.h
722 ↗(On Diff #31215)

"Used to access thread-specific data by libthread_db."

IMO the comment would be more useful if placed in thr_spec.c.

mizhka_gmail.com edited the test plan for this revision. (Show Details)Jul 26 2017, 3:54 PM
This revision was automatically updated to reflect the committed changes.