[cfe-dev] Debugging Clang with LLDB

Jan Svoboda via cfe-dev cfe-dev at lists.llvm.org
Thu Mar 28 04:12:16 PDT 2019


The bug report can be found here:
https://bugs.llvm.org/show_bug.cgi?id=41237
Turns out, the segmentation fault occurs only when the Clang binary was
linked with LLD or GNU Gold.
Binary linked with GNU ld works fine.

On Tue, 26 Mar 2019 at 12:19, Jan Svoboda <jansvoboda11 at gmail.com> wrote:

> I'm happy to try reproducers out, however when I run `$ lldb-8 --capture
> ./lldb-reproducer ./llvm-project/build/bin/clang` and `reproducer generate`
> after the error occurs, it only creates index.yaml and gdb-remote.yaml.
> That's in line with the reproducers description here:
> http://lists.llvm.org/pipermail/lldb-dev/2018-September/014184.html
> I just wanted to point the current behaviour out.
> I'll submit the whole Clang binary with debug info anyways, if Bugzilla
> lets me.
> Thanks for the help!
>
> On Tue, 26 Mar 2019 at 00:24, Jonas Devlieghere <jdevlieghere at apple.com>
> wrote:
>
>>
>>
>> > On Mar 25, 2019, at 2:05 PM, Adrian Prantl <aprantl at apple.com> wrote:
>> >
>> >
>> >
>> >> On Mar 25, 2019, at 1:13 PM, Jan Svoboda <jansvoboda11 at gmail.com>
>> wrote:
>> >>
>> >> The `argv.size()` expression doesn't crash with SIGSEGV when used
>> directly in the Clang binary though, only when evaluated in LLDB.
>> >> I'm running x64 Linux (Ubuntu 18.04) and compiled the binary in debug
>> mode using Clang, LLD, libc++ (all in version 8.0.0) installed from the
>> official APT repository.
>> >
>> > That sounds like an LLDB bug then. If you are interested you could
>> report it on the LLVM bugzilla and include steps to reproduce and most
>> importantly a full expression log (run "log enable lldb expr") before
>> running your command.
>> >
>> > +Jonas—are LLDB reproducers usable enough for this example already?
>>
>> It might be a good test case, let's find out!
>>
>> If you don't mind giving this experimental feature a shot, you can pass
>> --capture to the  lldb driver. After you see the error, type "reproducer
>> generate" in the command and it will tell you the path where it generated
>> the reproducer. The reproducer is a directory, which you'd have to compress
>> yourself (at least for now). Keep in mind that it will include binaries and
>> debug info, but since it's open source clang I assume that should be fine.
>>
>> >
>> > -- adrian
>>
>>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20190328/9839b96f/attachment.html>


More information about the cfe-dev mailing list