[lldb-dev] Pending breakpoints to dlsym()ed functions

Pavel Labath via lldb-dev lldb-dev at lists.llvm.org
Thu Feb 15 04:25:40 PST 2018


Yes, it looks that way, but I cannot reproduce this on my side (which
is not surprising as it involves parsing debug info from your dynamic
linker). I'd need the relevant portions of that file (or just the
whole file) to see what's going on there.

That said, this shouldn't impact you unless you plan to debug the linker itself.

On 15 February 2018 at 11:56, Dmitry Antipov <dantipov at nvidia.com> wrote:
> On 02/15/2018 02:21 PM, Pavel Labath wrote:
>
>> I've tried your sample, and I was indeed able to reproduce the
>> problem. What makes your case special is that "sin" and "cos" are
>> indirect functions (STT_GNU_IFUNC), so we have to do some extra work
>> (call the resolver function) to resolve them.
>
>
> I've changed my sample to dlsym() a regular function instead of an indirect
> stub, and got a breakpoint hit, but:
>
> (lldb) attach 16196
> Process 16196 stopped
> * thread #1, name = 'main', stop reason = signal SIGSTOP
>     frame #0: 0x0000000000400798 main`main(argc=1, argv=0x00007ffd6f662668)
> at main.c:16
>    13     for (a = 0; a < DELAY + argc; a++)
>    14       for (b = 0; b < DELAY + argc; b++)
>    15         for (c = 0; c < DELAY + argc; c++)
> -> 16           z += a + b + c;
>    17     while (1)
>    18       {
>    19         void *handle = dlopen ("libfoo.so", RTLD_LAZY);
>
> Executable module set to "/home/dantipov/tmp/t-dl2/main".
> Architecture set to: x86_64--linux.
> (lldb) breakpoint set -n foo
> Breakpoint 1: no locations (pending).
> WARNING:  Unable to resolve breakpoint to any actual locations.
> (lldb) process continue
> Process 16196 resuming
> 1 location added to breakpoint 1
> (lldb) error: ld-linux-x86-64.so.2 0x0005d207: adding range
> [0x14eea-0x14f5a) which has a base that is less than the function's low PC
> 0x15730. Please file a bug and attach the file at the start of this error
> message
> error: ld-linux-x86-64.so.2 0x0005d207: adding range [0x14f70-0x14f76) which
> has a base that is less than the function's low PC 0x15730. Please file a
> bug and attach the file at the start of this error message
> error: ld-linux-x86-64.so.2 0x0005d268: adding range [0x14eea-0x14f5a) which
> has a base that is less than the function's low PC 0x15730. Please file a
> bug and attach the file at the start of this error message
> error: ld-linux-x86-64.so.2 0x0005d268: adding range [0x14f70-0x14f76) which
> has a base that is less than the function's low PC 0x15730. Please file a
> bug and attach the file at the start of this error message
> Process 16196 stopped
> * thread #1, name = 'main', stop reason = breakpoint 1.1
>     frame #0: 0x00007f3b1a8536f7
> libfoo.so`foo(v=0.00000000000003907985046680551) at libfoo.c:6
>    3    double
>    4    foo (double v)
>    5    {
> -> 6      return sin (v) + cos (v);
>    7    }
>
> This seems to be an another bug, isn't it?
>
>
> Dmitry
>
> -----------------------------------------------------------------------------------
> This email message is for the sole use of the intended recipient(s) and may
> contain
> confidential information.  Any unauthorized review, use, disclosure or
> distribution
> is prohibited.  If you are not the intended recipient, please contact the
> sender by
> reply email and destroy all copies of the original message.
> -----------------------------------------------------------------------------------


More information about the lldb-dev mailing list