Quuxplusone / LLVMBugzillaTest

0 stars 0 forks source link

Unable to step into __cxa_allocate_exception #35411

Open Quuxplusone opened 6 years ago

Quuxplusone commented 6 years ago
Bugzilla Link PR36438
Status NEW
Importance P normal
Reported by Dmitry Antipov (dmantipov@yandex.ru)
Reported on 2018-02-19 07:09:05 -0800
Last modified on 2018-10-31 19:44:24 -0700
Version 6.0
Hardware PC Linux
CC jingham@apple.com, llvm-bugs@lists.llvm.org, yuanfang.chen@sony.com
Fixed by commit(s)
Attachments t-throw.cc (308 bytes, text/x-c++src)
lldb-step-log.txt (24364 bytes, text/plain)
Blocks
Blocked by
See also
Created attachment 19902
Sample program

$ /home/dantipov/.local/llvm-6.0.0/bin/lldb t-throw
(lldb) target create "t-throw"
Current executable set to 't-throw' (x86_64).
(lldb) b t-throw.cc:10
Breakpoint 1: where = t-throw`main + 18 at t-throw.cc:10, address =
0x00000000004009a9
(lldb) r
Process 22330 launched: '/home/dantipov/tmp/t-throw' (x86_64)
Process 22330 stopped
* thread #1, name = 't-throw', stop reason = breakpoint 1.1
    frame #0: 0x00000000004009a9 t-throw`main(argc=1, argv=0x00007fffffffe2f8) at t-throw.cc:10
   7        try {
   8          try {
   9        try {
-> 10         throw new T ();
   11       } catch (...) {
   12         throw;
   13       }
(lldb) step
gotcha
Process 22330 exited with status = 1 (0x00000001)

vs:

$ gdb -q t-throw
Reading symbols from t-throw...done.
(gdb) b t-throw.cc:10
Breakpoint 1 at 0x4009a9: file t-throw.cc, line 10.
(gdb) r
Starting program: /home/dantipov/tmp/t-throw
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib64/libthread_db.so.1".

Breakpoint 1, main (argc=1, argv=0x7fffffffe2f8) at t-throw.cc:10
10        throw new T ();
(gdb) s
__cxxabiv1::__cxa_allocate_exception (thrown_size=8) at ../../../../libstdc++-
v3/libsupc++/eh_alloc.cc:280
280 {
(gdb) bt
#0  __cxxabiv1::__cxa_allocate_exception (thrown_size=8) at
../../../../libstdc++-v3/libsupc++/eh_alloc.cc:280
#1  0x00000000004009b3 in main (argc=1, argv=0x7fffffffe2f8) at t-throw.cc:10
Quuxplusone commented 6 years ago

Attached t-throw.cc (308 bytes, text/x-c++src): Sample program

Quuxplusone commented 6 years ago

Works correctly on macOS. __cxa_allocate_exception was a re-exported symbol on macOS, maybe it is also on linux, and we aren't handling those properly?

Quuxplusone commented 6 years ago

Can you do:

(lldb) log enable -f /tmp/lldb-step-log.txt lldb step

right before the "step" command, and then run the step. Then add that log to the radar. I can generally see what went wrong from there.

Quuxplusone commented 6 years ago

Attached lldb-step-log.txt (24364 bytes, text/plain): Step log