I am working with Chromium in C++ and I keep encountering an error that I can’t seem to resolve. I am fairly new to Chromium and C++. When I start the browser and interact with the UI, at some buttons, i.e. when I try to pack an extension, the browser crashes. To get further information, I tried to start the browser with the logging functionality, i.e. –enable-logging –v=1. The error log shows a dangling raw_ptr with id=0x000055f80149aff8. Here is the error message:
[18532:9928:0624/134827.383:ERROR:partition_alloc_support.cc(677)] Detected dangling raw_ptr with id=0x000055f80149aff8:
[DanglingSignature] IsSandboxedProcess sqlite3_dbdata_init IsSandboxedProcess sqlite3_dbdata_init
The memory was freed at:
IsSandboxedProcess [0x00007FF852CB8CC2+1882050]
IsSandboxedProcess [0x00007FF852CC8DFE+1947902]
IsSandboxedProcess [0x00007FF852CBAD3F+1890367]
IsSandboxedProcess [0x00007FF852DBBD50+2943056]
ChromeMain [0x00007FF84C198EA0+32368]
IsSandboxedProcess [0x00007FF853F5E11C+21433372]
sqlite3_dbdata_init [0x00007FF859CB5529+82592105]
sqlite3_dbdata_init [0x00007FF85AB7518B+98057675]
sqlite3_dbdata_init [0x00007FF855058A2C+2520684]
sqlite3_dbdata_init [0x00007FF8550598DD+2524445]
ChromeMain [0x00007FF84CE7C7F8+13547464]
CrashForExceptionInNonABICompliantCodeRange [0x00007FF85089CDC9+22394361]
ChromeMain [0x00007FF84C303EB4+1519236]
IsSandboxedProcess [0x00007FF852CFA154+2149460]
GetHandleVerifier [0x00007FF8545DCD0F+235391]
GetHandleVerifier [0x00007FF8545DC0AC+232220]
IsSandboxedProcess [0x00007FF852CA4E02+1800450]
IsSandboxedProcess [0x00007FF852CA3B27+1795623]
GetHandleVerifier [0x00007FF8545DE1BD+240685]
IsSandboxedProcess [0x00007FF852D1BACE+2287054]
CrashForExceptionInNonABICompliantCodeRange [0x00007FF85001798F+13459903]
CrashForExceptionInNonABICompliantCodeRange [0x00007FF85001A19E+13470158]
CrashForExceptionInNonABICompliantCodeRange [0x00007FF8500135D8+13442568]
CrashForExceptionInNonABICompliantCodeRange [0x00007FF852353D23+50406739]
CrashForExceptionInNonABICompliantCodeRange [0x00007FF8523561A5+50416085]
CrashForExceptionInNonABICompliantCodeRange [0x00007FF852355B19+50414409]
CrashForExceptionInNonABICompliantCodeRange [0x00007FF8523533AE+50404318]
CrashForExceptionInNonABICompliantCodeRange [0x00007FF8523535AB+50404827]
ChromeMain [0x00007FF84C191429+1017]
GetPakFileHashes [0x00007FF6BD2225F7+5623]
GetPakFileHashes [0x00007FF6BD2217DD+2013]
GetHandleVerifier [0x00007FF6BD4349C2+1546818]
BaseThreadInitThunk [0x00007FF8D0437974+20]
RtlUserThreadStart [0x00007FF8D09DA2F1+33]
Task trace:
sqlite3_dbdata_init [0x00007FF855059C93+2525395]
IsSandboxedProcess [0x00007FF85304B0D5+5626837]
The dangling raw_ptr was released at:
IsSandboxedProcess [0x00007FF852CB8CC2+1882050]
IsSandboxedProcess [0x00007FF852CC8DFE+1947902]
IsSandboxedProcess [0x00007FF852CBAE0E+1890574]
IsSandboxedProcess [0x00007FF852D78793+2667155]
sqlite3_dbdata_init [0x00007FF85AB75010+98057296]
sqlite3_dbdata_init [0x00007FF85AB752E0+98058016]
sqlite3_dbdata_init [0x00007FF85AB751AD+98057709]
sqlite3_dbdata_init [0x00007FF855058A2C+2520684]
sqlite3_dbdata_init [0x00007FF8550598DD+2524445]
ChromeMain [0x00007FF84CE7C7F8+13547464]
CrashForExceptionInNonABICompliantCodeRange [0x00007FF85089CDC9+22394361]
ChromeMain [0x00007FF84C303EB4+1519236]
IsSandboxedProcess [0x00007FF852CFA154+2149460]
GetHandleVerifier [0x00007FF8545DCD0F+235391]
GetHandleVerifier [0x00007FF8545DC0AC+232220]
IsSandboxedProcess [0x00007FF852CA4E02+1800450]
IsSandboxedProcess [0x00007FF852CA3B27+1795623]
GetHandleVerifier [0x00007FF8545DE1BD+240685]
IsSandboxedProcess [0x00007FF852D1BACE+2287054]
CrashForExceptionInNonABICompliantCodeRange [0x00007FF85001798F+13459903]
CrashForExceptionInNonABICompliantCodeRange [0x00007FF85001A19E+13470158]
CrashForExceptionInNonABICompliantCodeRange [0x00007FF8500135D8+13442568]
CrashForExceptionInNonABICompliantCodeRange [0x00007FF852353D23+50406739]
CrashForExceptionInNonABICompliantCodeRange [0x00007FF8523561A5+50416085]
CrashForExceptionInNonABICompliantCodeRange [0x00007FF852355B19+50414409]
CrashForExceptionInNonABICompliantCodeRange [0x00007FF8523533AE+50404318]
CrashForExceptionInNonABICompliantCodeRange [0x00007FF8523535AB+50404827]
ChromeMain [0x00007FF84C191429+1017]
GetPakFileHashes [0x00007FF6BD2225F7+5623]
GetPakFileHashes [0x00007FF6BD2217DD+2013]
GetHandleVerifier [0x00007FF6BD4349C2+1546818]
BaseThreadInitThunk [0x00007FF8D0437974+20]
RtlUserThreadStart [0x00007FF8D09DA2F1+33]
Task trace:
sqlite3_dbdata_init [0x00007FF855059C93+2525395]
IsSandboxedProcess [0x00007FF85304B0D5+5626837]
I have been following the links:
https://chromium.googlesource.com/chromium/src.git/+/main/docs/dangling_ptr.md
and
https://chromium.googlesource.com/chromium/src/+/main/docs/dangling_ptr_guide.md
The “easy” way which I am currently trying to follow would be to disable the dangling pointer detection, but I would also like to know which part in the Chromium C++ code base is actually causing to alert the dangling pointer detection so that the browser crashes and how I would fix then those code parts.
I am building the browser on Windows. Is the dangling pointer detection there enabled by default in release builds? I could only find, that it is enabled by default on Linux.
Please give me an advice how I can find the part in the source code which causes the browser’s crash through the dangling pointer exception or how I could debug that. I have never debugged Chromium before.
I am sure there is something I am not aware of.
Thanks.