On Sat Nov 23 15:16:39 2024 +0000, Chih-Hsuan Yen wrote:
But I can't repro here. Could you share your configure options? Maybe
I didn't retest with your combination. Regarding the issue with `-g` and `-gdwarf-4`, I can still reproduce with the AUR package wine-git (see [PKGBUILD](https://aur.archlinux.org/cgit/aur.git/tree/PKGBUILD?h=wine-git#n109) for configure options). I can see mingw compilers are invoked with `-g` instead of `-gdwarf-4` in build logs. Complete logs: [wine-git-9.22.r0.g51ccd95c49c-1-x86_64-build.log.gz](/uploads/827938ba7eacbec7d561b0d25ff74163/wine-git-9.22.r0.g51ccd95c49c-1-x86_64-build.log.gz) Here the wine-git package undergoes similar modifications below, while without `-g` -> `-gdwarf-4` changes.
dbghelp (with this MR) searches both /usr/lib/debug/.build-id/xxx/yyy
and /usr/lib/debug/.build-id/xxx/yyy.debug so something else must be going wrong. It seems dbghelp stops after it doesn't find debug symbols in /usr/lib/debug/.build-id/xxx/yyy. I ran a test program which crashes in msvcrt.exe and got:
017c:trace:dbghelp:image_locate_build_id_target_in_dir checking L"/usr/lib/debug/.build-id/b7/7e9f19b7d1e8f889b2b790d6116a1d" 017c:trace:dbghelp:image_check_debug_link_gnu_id Located debug information file at L"/usr/lib/debug/.build-id/b7/7e9f19b7d1e8f889b2b790d6116a1d" 017c:trace:dbghelp:pe_load_stabs failed to load the STABS debug info 017c:trace:dbghelp_dwarf:dwarf2_parse Loading Dwarf2 information for L"msvcrt" 017c:trace:dbghelp:image_load_debugaltlink No .gnu_debugaltlink section found for L"msvcrt" 017c:trace:dbghelp:pe_load_dwarf successfully loaded the DWARF debug info
Here /usr/lib/debug/.build-id/b7/7e9f19b7d1e8f889b2b790d6116a1d points to /usr/lib/wine/x86_64-windows/msvcrt.dll. Complete wine logs: [winedbg.log](/uploads/5b93c494acfd801b282b8cae3cb0154b/winedbg.log) Test program: [test-debugging-symbols.c](/uploads/cc7979fadadec245c548b49355106383/test-debugging-symbols.c) Here wine is built using wine-git AUR package with the following modifications:
diff --git a/PKGBUILD b/PKGBUILD index e679471..ccdf826 100644 --- a/PKGBUILD +++ b/PKGBUILD @@ -88,6 +88,15 @@ sha256sums=('SKIP' prepare() { rm -rf build-{32,64} mkdir -p build-{32,64} + + cd wine + + # https://gitlab.winehq.org/wine/wine/-/merge_requests/6715 + git cherry-pick -n 3e0eda8986172fe77c3f871100d46f62c9fcd2d6 + git cherry-pick -n 4fb40e04a6d41508beb53a70a70470cc1102a863 + git cherry-pick -n 8283999ec06e5cd8af5fd4fdf6d29765571c6f63 + + autoreconf -ifv } pkgver() { @@ -98,8 +107,8 @@ build() { export CFLAGS+=' -ffat-lto-objects' # apply flags for cross-compilation - export CROSSCFLAGS="${CFLAGS/-Werror=format-security/} -g" - export CROSSCXXFLAGS="${CXXFLAGS/-Werror=format-security/} -g" + export CROSSCFLAGS="${CFLAGS/-Werror=format-security/} -gdwarf-4" + export CROSSCXXFLAGS="${CXXFLAGS/-Werror=format-security/} -gdwarf-4" export CROSSLDFLAGS="${LDFLAGS//-Wl,-z*([^[:space:]])/}" # build wine 64-bit @@ -112,6 +121,7 @@ build() { --with-x \ --with-wayland \ --with-gstreamer \ + --enable-build-id \ --enable-win64 make @@ -125,6 +135,7 @@ build() { --with-x \ --with-wayland \ --with-gstreamer \ + --enable-build-id \ --with-wine64="${srcdir}/build-64" make }
thanks for taking the time to retest
Regarding the issue with `-g` and `-gdwarf-4`, I can still reproduce with the AUR package wine-git (see [PKGBUILD](https://aur.archlinux.org/cgit/aur.git/tree/PKGBUILD?h=wine-git#n109) for configure options). I can see mingw compilers are invoked with `-g` instead of `-gdwarf-4` in build logs.
updated the MR, hopefully this should work now
It seems dbghelp stops after it doesn't find debug symbols in /usr/lib/debug/.build-id/xxx/yyy. I ran a test program which crashes in msvcrt.exe and got:
it's likely we shouldn't try `/usr/lib/debug/.build-id/xxx/yyy` (which points to the stripped image) but `/usr/lib/debug/.build-id/xxx/yyy.debug` instead. (updated MR to only try the later, previously was trying the former first, and in case of failure the later)
Side note: looks like your test program is not compiled in dwarf-4 (but that shouldn't matter for getting the right information for the rest of the backtrace)
017c:trace:dbghelp_dwarf:dwarf2_parse Loading Dwarf2 information for L"test-debugging-symbols" 017c:trace:dbghelp:image_load_debugaltlink No .gnu_debugaltlink section found for L"test-debugging-symbols" 017c:trace:dbghelp_dwarf:dwarf2_parse_compilation_unit_head Compilation Unit Header found at 0x0: 017c:trace:dbghelp_dwarf:dwarf2_parse_compilation_unit_head - length: 9868 017c:trace:dbghelp_dwarf:dwarf2_parse_compilation_unit_head - version: 5 017c:trace:dbghelp_dwarf:dwarf2_parse_compilation_unit_head - abbrev_offset: 2049 017c:trace:dbghelp_dwarf:dwarf2_parse_compilation_unit_head - word_size: 0 017c:trace:dbghelp_dwarf:dwarf2_parse_compilation_unit_head - offset_size: 4
and there's a crash when quitting the debugger