https://bugs.winehq.org/show_bug.cgi?id=55964
Bug ID: 55964 Summary: wine-mono: Dlls include reference to filenames different to the files in wine-mono-8.1.0-dbgsym.tar.xz Product: Wine Version: 8.19 Hardware: x86-64 OS: Linux Status: UNCONFIRMED Severity: normal Priority: P2 Component: mscoree Assignee: wine-bugs@winehq.org Reporter: bernhardu@mailbox.org Distribution: ---
I was trying get a backtrace from #55736 with debug symbols. Therefore I tried using a windows build of LLDB. Unfortunately it took me some time to figure out that the PDB file name embedded in the dll files did not match the filename in the archive wine-mono-8.1.0-dbgsym.tar.xz. After renaming to the name libmonosgen-2.0.pdb it got found by LLDB.
Maybe either the build can be modified to build with the expected file names in the first place, or add a short readme to the archive file describing this issue?
$ strings windows/mono/mono-2.0/bin/libmono-2.0-x86*.dll | grep -i "mono.*.pdb" /vagrant/build/mono-x86_64/mono/mini/.libs/libmonosgen-2.0.pdb /vagrant/build/mono-x86/mono/mini/.libs/libmonosgen-2.0.pdb
https://bugs.winehq.org/show_bug.cgi?id=55964
--- Comment #1 from Bernhard Übelacker bernhardu@mailbox.org --- Just for reference, the PDB filename hides in the ".buildid" section:
x86_64-w64-mingw32-objdump libmono-2.0-x86_64.dll --full-contents | grep ibmonosgen-2.0.p -A2 -B7 Contents of section .buildid: 18042b000 00000000 83eb2e65 00000000 02000000 .......e........ 18042b010 57000000 1cb04200 1c9a4200 52534453 W.....B...B.RSDS 18042b020 d81d12a9 828fa723 4c4c4420 5044422e .......#LLD PDB. 18042b030 01000000 2f766167 72616e74 2f627569 ..../vagrant/bui 18042b040 6c642f6d 6f6e6f2d 7838365f 36342f6d ld/mono-x86_64/m 18042b050 6f6e6f2f 6d696e69 2f2e6c69 62732f6c ono/mini/.libs/l 18042b060 69626d6f 6e6f7367 656e2d32 2e302e70 ibmonosgen-2.0.p 18042b070 646200 db. Contents of section .data:
Unfortunately I found no easy way to edit this information in a finished dll.
But as another workaround that worked for me, following just does a hard replacement:
cp -a libmono-2.0-x86_64.dll libmono-2.0-x86_64.dll.orig x86_64-w64-mingw32-objcopy libmono-2.0-x86_64.dll --dump-section .buildid=tmp.tmp sed -i -E "s@ibs/libmonosgen-2.0.pdb@/libmono-2.0-x86_64.pdb@g" tmp.tmp x86_64-w64-mingw32-objcopy libmono-2.0-x86_64.dll --update-section .buildid=tmp.tmp
cp -a libmono-2.0-x86.dll libmono-2.0-x86.dll.orig x86_64-w64-mingw32-objcopy libmono-2.0-x86.dll --dump-section .buildid=tmp.tmp sed -i -E "s@/libmonosgen-2.0.pdb@/libmono-2.0-x86.pdb@g" tmp.tmp x86_64-w64-mingw32-objcopy libmono-2.0-x86.dll --update-section .buildid=tmp.tmp
(The sed command might also work on the plain dll file, too.)
https://bugs.winehq.org/show_bug.cgi?id=55964
--- Comment #2 from Esme Povirk madewokherd@gmail.com --- Are the debug symbols working OK otherwise? I never worked out how to use them.
Unfortunately, it's hard to move/rename the libmono dll's because old Wine versions will look for them in the old place. I'm hoping it'll be possible to specify the pdb name in LDFLAGS at build time.
Other dlls where we add the dll's architecture to the filename are likely to have the same problem. I think we should switch from e.g. lib/FAudio-x86.dll to lib/x86/FAudio.dll, as we do for some of the more modern ones.
https://bugs.winehq.org/show_bug.cgi?id=55964
--- Comment #3 from Bernhard Übelacker bernhardu@mailbox.org --- (In reply to Esme Povirk from comment #2)
Are the debug symbols working OK otherwise? I never worked out how to use them.
LLDB was able to use, with environment LLDB_USE_NATIVE_PDB_READER=1 and native msdia140.dll it showed also inlined frames. So yes, the PDB itself works like a charm.
Unfortunately, it's hard to move/rename the libmono dll's because old Wine versions will look for them in the old place. I'm hoping it'll be possible to specify the pdb name in LDFLAGS at build time.
I do not want to change anything about the final "libmono-2.0-x86_64.dll" filename in existing or new wineprefixes.
It is just the dll is built into filename libmonosgen-2.0.dll, therefore both x86 and x86_64 contain therefore the PDB reference to "libmonosgen-2.0.pdb".
During install step it gets copied into image/bin/libmono-2.0-x86_64.{dll,pdb}, but the dlls still point to "libmonosgen-2.0.pdb".
The relevant install step from "make bin":
do_install () { cp "$(printf %s "$1"|sed -e 's/....$/.pdb/')" "$(printf %s "$2"|sed -e 's/....$/.pdb/')"; cp "$1" "$2" PATH=.../llvm-mingw-20210423-ucrt-ubuntu-18.04-x86_64/bin:$PATH x86_64-w64-mingw32-strip "$2"; }; do_install ".//build/mono-x86_64/mono/mini/.libs/libmonosgen-2.0.dll" ".//image/bin/libmono-2.0-x86_64.dll"
https://bugs.winehq.org/show_bug.cgi?id=55964
--- Comment #4 from Esme Povirk madewokherd@gmail.com --- I know, I just mentioned it because it would've been a possible solution (probably the best one) if not for the compatibility issue.
https://bugs.winehq.org/show_bug.cgi?id=55964
--- Comment #5 from Bernhard Übelacker bernhardu@mailbox.org --- Would a plain text replacement by sed be acceptable? Attached patch would be called in do_install after the actual copy, and tries to replace the pdb name, without changing file size.
This would modify: libmono-2.0-x86*.dll, MonoPosixHelper-x86*.dll libmono-btls-x86*.dll FNA3D-x86*.dll FAudio-x86*.dll
https://bugs.winehq.org/show_bug.cgi?id=55964
--- Comment #6 from Esme Povirk madewokherd@gmail.com --- No, it should be possible to build with the proper PDB filename. I'm working on it.
https://bugs.winehq.org/show_bug.cgi?id=55964
--- Comment #7 from Esme Povirk madewokherd@gmail.com --- This should fix it for the libmono dll's: https://github.com/madewokherd/wine-mono/commit/2943bec61e8345f5ee91b13022e2...
For the other dll's, I think it will be better to just remove the -arch from the name and move them to architecture-specific directories.
https://bugs.winehq.org/show_bug.cgi?id=55964
--- Comment #8 from Esme Povirk madewokherd@gmail.com --- Did some further cleanups. All the PE dll's in the lib directory should have matching pdb's now.
https://bugs.winehq.org/show_bug.cgi?id=55964
Esme Povirk madewokherd@gmail.com changed:
What |Removed |Added ---------------------------------------------------------------------------- CC| |madewokherd@gmail.com
https://bugs.winehq.org/show_bug.cgi?id=55964
Bernhard Übelacker bernhardu@mailbox.org changed:
What |Removed |Added ---------------------------------------------------------------------------- Status|UNCONFIRMED |RESOLVED Fixed by SHA1| |e891073c9eacc391cfa1bdb65e7 | |34922742c2c17 Resolution|--- |FIXED
--- Comment #9 from Bernhard Übelacker bernhardu@mailbox.org --- Resolving fixed. Since wine-mono 9.0.0 the embedded PDB file names match the real filenames in the dbgsym.tar.xz.
https://bugs.winehq.org/show_bug.cgi?id=55964
Alexandre Julliard julliard@winehq.org changed:
What |Removed |Added ---------------------------------------------------------------------------- Status|RESOLVED |CLOSED
--- Comment #10 from Alexandre Julliard julliard@winehq.org --- Closing bugs fixed in 9.17.