lldb API uses wrong executable filename

Bug #1894159 reported by Aleksandar Nikolic
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
llvm-toolchain-10 (Ubuntu)
New
Undecided
Unassigned

Bug Description

I've noticed that some of my debugging scripts that use lldb to launch and debug processes don't work and hang indefinitely on Ubuntu Focal with latest llvm toolchain installed.

The culprit is the fact that lldb API tries to launch a binary named "lldb-server-10.0.0" which doesn't exist (installing lldb installs lldb-server as a symlink to lldb-server-10 , but not lldb-server-10.0.0).

This becomes apparent when logging is enabled for the debugger:

1599167975.387668848 python 0x238adc0 Listener::StartListeningForEvents (broadcaster = 0x236c6f0, mask = 0x00020004) acquired_mask = 0x00020004 for lldb.process.gdb-remote.async-listener
1599167975.387677193 python successfully created process
1599167975.387685061 python setting up hijacker
1599167975.387690544 python 0x238b500 Listener::Listener('lldb.PlatformLinux.DebugProcess.hijack')
1599167975.387698174 python 0x0000000002369F20 Broadcaster("lldb.process")::HijackBroadcaster (listener("lldb.PlatformLinux.DebugProcess.hijack")=0x000000000238B500)
1599167975.387704611 python launching process with the following file actions:
1599167975.387755871 python 0x000000000236C170 Communication::Disconnect ()
1599167975.387762785 python Process::SetPublicState (state = launching, restarted = 0)
1599167975.387876272 python shlib dir -> `/usr/lib/x86_64-linux-gnu/`
1599167975.387891054 python HostInfo::ComputePathRelativeToLibrary() attempting to derive the path /bin relative to liblldb install path: /usr/lib/x86_64-linux-gnu
1599167975.387899160 python HostInfo::ComputePathRelativeToLibrary() derived the path as: /usr/lib/bin
1599167975.387925148 python support exe dir -> `/usr/bin/`
1599167975.387954235 python process launch failed: unable to locate lldb-server-10.0.0

This issue is simply resolved by making yet another symlink to lldb-server to point to lldb-server-10.0.0 but without logging enabled, it isn't obvious where the problem is.

This behavior can be observed by executing the attached python script (slightly modified lldb example from https://lldb.llvm.org/use/python-reference.html).

Expected behavior is that breakpoint is set and hit, but due to missing lldb-server-10.0.0 binary, the process is never launched.

Revision history for this message
Aleksandar Nikolic (alnikoli) wrote :
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.