[Bug 248745] /usr/bin/lldb dumps core when attempting to print variable with `p`, `fr v` works

bugzilla-noreply at freebsd.org bugzilla-noreply at freebsd.org
Tue Aug 18 22:47:47 UTC 2020


https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=248745

            Bug ID: 248745
           Summary: /usr/bin/lldb dumps core when attempting to print
                    variable with `p`, `fr v` works
           Product: Base System
           Version: 12.1-STABLE
          Hardware: Any
                OS: Any
            Status: New
          Severity: Affects Only Me
          Priority: ---
         Component: bin
          Assignee: bugs at FreeBSD.org
          Reporter: dmgk at freebsd.org

$ uname -v
FreeBSD 12.1-STABLE r364355

$ /usr/bin/lldb -v
lldb version 10.0.1 (git at github.com:llvm/llvm-project.git revision
llvmorg-10.0.1-0-gef32c611aa2)
  clang revision llvmorg-10.0.1-0-gef32c611aa2
  llvm revision llvmorg-10.0.1-0-gef32c611aa2

$ cat <<EOD > testcase.c
int main(int argc, char *argv[])
{
    return 0;
}
EOD

$ cc -O0 -g testcase.c

$ /usr/bin/lldb a.out
...
(lldb) b main
Breakpoint 1: where = a.out`main + 20 at testcase.c:5:5, address =
0x00000000002018d4
(lldb) r
Process 27744 launching
Process 27744 launched: '/home/dg/tmp/a.out' (x86_64)
Process 27744 stopped
* thread #1, name = 'a.out', stop reason = breakpoint 1.1
    frame #0: 0x00000000002018d4 a.out`main(argc=1, argv=0x00007fffffffe480) at
testcase.c:5:5
   2
   3    int main(int argc, char *argv[])
   4    {
-> 5        return 0;
   6    }
(lldb) p argc
Program aborted due to an unhandled Error:
Error value was Success. (Note: Success values must still be checked prior to
being destroyed).
Stack dump:
0.      Program arguments: /usr/bin/lldb a.out
1.      HandleCommand(command = "p argc")
#0 0x0000000003b848de PrintStackTrace
/usr/src/contrib/llvm-project/llvm/lib/Support/Unix/Signals.inc:564:13
#1 0x0000000003b82b37 RunSignalHandlers
/usr/src/contrib/llvm-project/llvm/lib/Support/Signals.cpp:69:18
#2 0x0000000003b851d0 SignalHandler
/usr/src/contrib/llvm-project/llvm/lib/Support/Unix/Signals.inc:0:3
#3 0x000000080477dd22 handle_signal /usr/src/lib/libthr/thread/thr_sig.c:0:3
Abort trap (core dumped)

What's interesting is that `fr v` works fine:

...
(lldb) b main
Breakpoint 1: where = a.out`main + 20 at testcase.c:5:5, address =
0x00000000002018d4
(lldb) r
Process 28540 launching
Process 28540 launched: '/home/dg/tmp/a.out' (x86_64)
Process 28540 stopped
* thread #1, name = 'a.out', stop reason = breakpoint 1.1
    frame #0: 0x00000000002018d4 a.out`main(argc=1, argv=0x00007fffffffe480) at
testcase.c:5:5
   2
   3    int main(int argc, char *argv[])
   4    {
-> 5        return 0;
   6    }
(lldb) fr v argc
(int) argc = 1
(lldb)

-- 
You are receiving this mail because:
You are the assignee for the bug.


More information about the freebsd-bugs mailing list