Problems debugging desktop chrome for mac

407 views
Skip to first unread message

Pete Williamson

unread,
Aug 30, 2023, 1:58:05 PM8/30/23
to Chromium-dev
Can anyone who does debugging on the mac take a quick look and let me know if I've missed some common step, or run into some common gotcha?

I've been following the instructions here: https://chromium.googlesource.com/chromium/src/+/HEAD/docs/mac/debugging.md

I start LLDB like this, then I set a breakpoint and type "run", then it crashes before I see the chrome UI.

lldb ./out/dm/Chromium.app/Contents/MacOS/Chromium


When I run the chrome.app from XCode using a XCode-Ninja hybrid, I see a crash that looks the same.

Whether I use LLDB or XCode, the result is the same, there is a crash on startup.
I tried both with some changes, and a fresh empty git branch with no changes, and I get the same error.

This is the first time I've tried debugging on this mac after setting it up, so there could potentially be some error I made while setting up.

I am able to build and run chrome outside the debugger, and chrome seems to be working just fine.

Here is my command line session with a call stack.

(proto1)$ lldb ./out/dm/Chromium.app/Contents/MacOS/Chromium

(lldb) target create "./out/dm/Chromium.app/Contents/MacOS/Chromium"

Current executable set to '/Users/petewil/Source/chromium/src/out/dm/Chromium.app/Contents/MacOS/Chromium' (arm64).

(lldb) b ContentAutofillDriver::FocusOnFormField

Breakpoint 1: no locations (pending).

WARNING:  Unable to resolve breakpoint to any actual locations.

(lldb) b ContentAutofillDriver::ContentEditableFocusChanged

Breakpoint 2: no locations (pending).

WARNING:  Unable to resolve breakpoint to any actual locations.

(lldb) run

Process 23211 launched: '/Users/petewil/Source/chromium/src/out/dm/Chromium.app/Contents/MacOS/Chromium' (arm64)

1 location added to breakpoint 1

1 location added to breakpoint 2

[0830/102237.896841:FATAL:debugger_posix.cc(134)] Check failed: false. Detected lldb without sourcing //tools/lldb/lldbinit.py. lldb may not be able to find debug symbols. Please see debug instructions for using //tools/lldb/lldbinit.py:

https://chromium.googlesource.com/chromium/src/+/main/docs/lldbinit.md

To continue anyway, type 'continue' in lldb. To always skip this check, define an environment variable CHROMIUM_LLDBINIT_SOURCED=1

Process 23211 stopped

* thread #1, queue = 'com.apple.main-thread', stop reason = EXC_BREAKPOINT (code=1, subcode=0x101ea20a0)

    frame #0: 0x0000000101ea20a0 libbase.dylib`logging::LogMessage::~LogMessage() [inlined] base::ImmediateCrash() at immediate_crash.h:146:3

Target 0: (Chromium) stopped.

(lldb) continue

Process 23211 resuming

Process 23211 stopped

* thread #1, queue = 'com.apple.main-thread', stop reason = EXC_BREAKPOINT (code=1, subcode=0x101ea20a0)

    frame #0: 0x0000000101ea20a0 libbase.dylib`logging::LogMessage::~LogMessage() [inlined] base::ImmediateCrash() at immediate_crash.h:146:3

Target 0: (Chromium) stopped.

(lldb) continue

Process 23211 resuming

Process 23211 stopped

* thread #1, queue = 'com.apple.main-thread', stop reason = EXC_BREAKPOINT (code=1, subcode=0x101ea20a0)

    frame #0: 0x0000000101ea20a0 libbase.dylib`logging::LogMessage::~LogMessage() [inlined] base::ImmediateCrash() at immediate_crash.h:146:3

Target 0: (Chromium) stopped.

(lldb) br l

Current breakpoints:

1: name = 'ContentAutofillDriver::FocusOnFormField', locations = 1, resolved = 1, hit count = 0

  1.1: where = libchrome_dll.dylib`autofill::ContentAutofillDriver::FocusOnFormField(autofill::FormData const&, autofill::FormFieldData const&, gfx::RectF const&) + 68 at content_autofill_driver.cc:542:47, address = 0x00000002898efde8, resolved, hit count = 0 


2: name = 'ContentAutofillDriver::ContentEditableFocusChanged', locations = 1, resolved = 1, hit count = 0

  2.1: where = libchrome_dll.dylib`autofill::ContentAutofillDriver::ContentEditableFocusChanged() + 48 at content_autofill_driver.cc:562:3, address = 0x00000002898eff90, resolved, hit count = 0 


(lldb) bt

* thread #1, queue = 'com.apple.main-thread', stop reason = EXC_BREAKPOINT (code=1, subcode=0x101ea20a0)

  * frame #0: 0x0000000101ea20a0 libbase.dylib`logging::LogMessage::~LogMessage() [inlined] base::ImmediateCrash() at immediate_crash.h:146:3

    frame #1: 0x0000000101ea20a0 libbase.dylib`logging::LogMessage::~LogMessage(this=0x000000017ff048a0) at logging.cc:959:7

    frame #2: 0x0000000101e4a75c libbase.dylib`logging::(anonymous namespace)::DCheckLogMessage::~DCheckLogMessage(this=0x000000017ff048a0) at check.cc:90:3

    frame #3: 0x0000000101e4a6cc libbase.dylib`logging::(anonymous namespace)::DCheckLogMessage::~DCheckLogMessage(this=0x000000017ff048a0) at check.cc:86:32

    frame #4: 0x0000000101e4a6f8 libbase.dylib`logging::(anonymous namespace)::DCheckLogMessage::~DCheckLogMessage(this=0x000000017ff048a0) at check.cc:86:32

    frame #5: 0x0000000101e4a164 libbase.dylib`logging::CheckError::~CheckError(this=0x000000016fdfea88) at check.cc:267:3

    frame #6: 0x0000000101e4a1bc libbase.dylib`logging::CheckError::~CheckError(this=0x000000016fdfea88) at check.cc:259:27

    frame #7: 0x00000001021cb884 libbase.dylib`base::debug::VerifyDebugger() at debugger_posix.cc:134:3

    frame #8: 0x00000001274f317c libcontent.dylib`content::ContentMainRunnerImpl::Initialize(this=0x0000600002c0c100, params=ContentMainParams @ 0x000000016fdfeda0) at content_main_runner_impl.cc:997:3

    frame #9: 0x00000001274f0314 libcontent.dylib`content::RunContentProcess(params=ContentMainParams @ 0x000000016fdfeeb8, content_main_runner=0x0000600002c0c100) at content_main.cc:301:38

    frame #10: 0x00000001274f0bcc libcontent.dylib`content::ContentMain(params=ContentMainParams @ 0x000000016fdfef28) at content_main.cc:343:10

    frame #11: 0x0000000280008ea0 libchrome_dll.dylib`::ChromeMain(argc=1, argv=0x000000016fdff548) at chrome_main.cc:187:12

    frame #12: 0x000000010000092c Chromium`main(argc=1, argv=0x000000016fdff548) at chrome_exe_main_mac.cc:216:8

    frame #13: 0x0000000189e33f28 dyld`start + 2236

(lldb) 


Robert Sesek

unread,
Aug 30, 2023, 2:24:52 PM8/30/23
to pet...@google.com, Chromium-dev
Did you set up lldb per the instructions printed from the DCHECK?

[0830/102237.896841:FATAL:debugger_posix.cc(134)] Check failed: false. Detected lldb without sourcing //tools/lldb/lldbinit.py. lldb may not be able to find debug symbols. Please see debug instructions for using //tools/lldb/lldbinit.py:

https://chromium.googlesource.com/chromium/src/+/main/docs/lldbinit.md

--
--
Chromium Developers mailing list: chromi...@chromium.org
View archives, change email options, or unsubscribe:
http://groups.google.com/a/chromium.org/group/chromium-dev
---
You received this message because you are subscribed to the Google Groups "Chromium-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to chromium-dev...@chromium.org.
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/chromium-dev/CAHsSLHDPhhaLLcqR27kmFGCzjg0fEekkNN1FBsMMAGj3ku6bcg%40mail.gmail.com.

Pete Williamson

unread,
Aug 30, 2023, 2:44:55 PM8/30/23
to Robert Sesek, Chromium-dev
Robert's advice worked.  Thanks, Robert!

Pete Williamson

unread,
Aug 30, 2023, 3:30:09 PM8/30/23
to Robert Sesek, Chromium-dev
Seting up ~/.lldbinit worked fine for the command line, but still fails when I try to debug from Xcode.  Do I need to do something special when trying to debug with Xcode to get the right lldbinit to run?

Robert Sesek

unread,
Aug 30, 2023, 3:57:48 PM8/30/23
to Pete Williamson, Chromium-dev
Sorry, I don’t use Xcode so I don’t know. But according to https://stackoverflow.com/questions/31743326/lldbinit-doesnt-work-in-xcode, Xcode may read lldbinit before a target is created, so the target settings don’t work. You can always manually `command source ~/.lldbinit` or try setting the "LLDB Init File" setting in the Xcode scheme.

Jayson Adams

unread,
Aug 30, 2023, 4:01:00 PM8/30/23
to pet...@google.com, Chromium-dev
Check out VerifyDebugger() in base/debug/debugger_posix.cc .


Reply all
Reply to author
Forward
0 new messages