When I load a core dump with lldb 3.6, the tids displayed in “thread list” and more importantly returned by lldb::SBThread::GetThreadID() (used in a lldb plugin I wrote) doesn’t match the tids from the live session the core was generated from. gdb displays the correct tids on the same core dump (see below). My plugin depends on the above api returning the tid during the live session.
Can anybody help?
lldb-3.6
(lldb) target create --core /tmp/core-corerun-6-1000-1000-20870-1438119958 /tmp/corerun
Core file ‘/tmp/core-corerun-6-1000-1000-20870-1438119958’ (x86_64) was loaded.
Process 0 stopped
- thread #1: tid = 0x0000, 0x00007f01fe64d267 libc.so.6`gsignal + 55, name = ‘corerun’, stop reason = signal SIGABRT
frame #0: 0x00007f01fe64d267 libc.so.6`gsignal + 55
→ 0x7f01fe64d267: addb %al, (%rax)
0x7f01fe64d269: addb %al, (%rax)
0x7f01fe64d26b: addb %al, (%rax)
0x7f01fe64d26d: addb %al, (%rax)
thread #2: tid = 0x0001, 0x00007f01fe7138dd libc.so.6`__poll + 45, stop reason = signal SIGABRT
frame #0: 0x00007f01fe7138dd libc.so.6`__poll + 45
→ 0x7f01fe7138dd: addb %al, (%rax)
0x7f01fe7138df: addb %al, (%rax)
0x7f01fe7138e1: addb %al, (%rax)
0x7f01fe7138e3: addb %al, (%rax)
thread #3: tid = 0x0002, 0x00007f01fd27dda0 libpthread.so.0`__pthread_cond_wait + 192, stop reason = signal SIGABRT
frame #0: 0x00007f01fd27dda0 libpthread.so.0`__pthread_cond_wait + 192
→ 0x7f01fd27dda0: addb %al, (%rax)
0x7f01fd27dda2: addb %al, (%rax)
0x7f01fd27dda4: addb %al, (%rax)
0x7f01fd27dda6: addb %al, (%rax)
thread #4: tid = 0x0003, 0x00007f01fd27e149 libpthread.so.0`__pthread_cond_timedwait + 297, stop reason = signal SIGABRT
frame #0: 0x00007f01fd27e149 libpthread.so.0`__pthread_cond_timedwait + 297
→ 0x7f01fd27e149: addb %al, (%rax)
0x7f01fd27e14b: addb %al, (%rax)
0x7f01fd27e14d: addb %al, (%rax)
0x7f01fd27e14f: addb %al, (%rax)
thread #5: tid = 0x0004, 0x00007f01fe70f28d libc.so.6`__open64 + 45, stop reason = signal SIGABRT
frame #0: 0x00007f01fe70f28d libc.so.6`__open64 + 45
→ 0x7f01fe70f28d: addb %al, (%rax)
0x7f01fe70f28f: addb %al, (%rax)
0x7f01fe70f291: addb %al, (%rax)
0x7f01fe70f293: addb %al, (%rax)
thread #6: tid = 0x0005, 0x00007f01fe70f49d libc.so.6`__read + 45, stop reason = signal SIGABRT
frame #0: 0x00007f01fe70f49d libc.so.6`__read + 45
→ 0x7f01fe70f49d: addb %al, (%rax)
0x7f01fe70f49f: addb %al, (%rax)
0x7f01fe70f4a1: addb %al, (%rax)
0x7f01fe70f4a3: addb %al, (%rax)
(lldb) thread list
Process 0 stopped
- thread #1: tid = 0x0000, 0x00007f01fe64d267 libc.so.6`gsignal + 55, name = ‘corerun’, stop reason = signal SIGABRT
thread #2: tid = 0x0001, 0x00007f01fe7138dd libc.so.6`__poll + 45, stop reason = signal SIGABRT
thread #3: tid = 0x0002, 0x00007f01fd27dda0 libpthread.so.0`__pthread_cond_wait + 192, stop reason = signal SIGABRT
thread #4: tid = 0x0003, 0x00007f01fd27e149 libpthread.so.0`__pthread_cond_timedwait + 297, stop reason = signal SIGABRT
thread #5: tid = 0x0004, 0x00007f01fe70f28d libc.so.6`__open64 + 45, stop reason = signal SIGABRT
thread #6: tid = 0x0005, 0x00007f01fe70f49d libc.so.6`__read + 45, stop reason = signal SIGABRT