1

I maintain a Python library that's written in C++ (using Pybind11). For the past couple of years, I've been able to debug it just fine with lldb, just by compiling the extension in debug mode (i.e.: disabling optimization and including symbols, with -g).

However, as of lldb-1300.0.42.3 on macOS Ventura 13.1 (22C65), lldb is completely unable to find the symbols and reports every stack frame as being from dyld:

(lldb) bt
* thread #2, stop reason = signal SIGSTOP
    frame #0: 0x0000000187110a00
    frame #1: 0x00000001003700fc dyld
    frame #2: 0x00000001003e2614 dyld
    frame #3: 0x00000001003dfbac dyld
    frame #4: 0x00000001003e3188 dyld
    frame #5: 0x000000010033df20 dyld
    frame #6: 0x000000010033d754 dyld
    frame #7: 0x00000001003dfe28 dyld
    frame #8: 0x00000001003e3188 dyld
    frame #9: 0x000000010033df20 dyld
  * frame #10: 0x000000010033d754 dyld
    frame #11: 0x00000001003dfe28 dyld
    frame #12: 0x00000001003e3188 dyld
    frame #13: 0x000000010033df20 dyld
    frame #14: 0x00000001003e2614 dyld
...

I've tried:

  • Ensuring that debug symbols are compiled into the executable
  • Adding a breakpoint on dlopen (which does not get hit)
  • Using image list to show the loaded binary images (which does not include my Python extension)
Peter Sobot
  • 2,476
  • 21
  • 20
  • 1
    I think you need to update your Xcode. Ventura changed how dyld was loaded into programs as they start running, and lldb had to adapt to that. The failure mode was that lldb only sees dyld get loaded (`image list` would also only report dyld). You have to get a newer lldb that understands the new loading method. – Jim Ingham Jan 23 '23 at 18:38
  • Thanks @JimIngham! Any links to documentation on that? I'm running the (supposedly) latest Xcode and `lldb` versions available on my machine. – Peter Sobot Jan 23 '23 at 19:36
  • The latest Xcode on the App Store is 14.2. All the 14 series Xcodes have lldb-14xx versions, and you are reporting a lldb-1300 version. So I think you have a 13.x version Xcode, but you need a 14 era version for Ventura. – Jim Ingham Jan 24 '23 at 23:08

1 Answers1

0

As pointed out by Jim Ingham, lldb version 13 predates macOS Ventura, and doesn't have the changes required to support debugging with symbols on Ventura. Upgrading to lldb 14+ (via Xcode) fixes the issue.

Peter Sobot
  • 2,476
  • 21
  • 20