http://bugs.winehq.org/show_bug.cgi?id=58493
Bug ID: 58493 Summary: Gothic and Gothic II crash with Access Violation Product: Wine Version: 8.18 Hardware: x86-64 OS: Linux Status: NEW Keywords: regression Severity: normal Priority: P2 Component: dmusic Assignee: wine-bugs@winehq.org Reporter: andrey.goosev@gmail.com CC: rbernon@codeweavers.com Regression SHA1: 8e596f4ddba3d19d6eea645e59d54101f93aa2bc Distribution: ---
Right before the main menu after skipping intros.
http://bugs.winehq.org/show_bug.cgi?id=58493
Stian Low wineryyyyy@gmail.com changed:
What |Removed |Added ---------------------------------------------------------------------------- CC| |wineryyyyy@gmail.com
--- Comment #1 from Stian Low wineryyyyy@gmail.com --- Created attachment 78950 --> http://bugs.winehq.org/attachment.cgi?id=78950 Access Violation Snapshot
Confirmed Access Violation for version wine-10.11-217-g3c4cc9d04b6 by this snapshot.
http://bugs.winehq.org/show_bug.cgi?id=58493
--- Comment #2 from Stian Low wineryyyyy@gmail.com --- Managed to fix Access Violation for wine-10.11-217-g3c4cc9d04b6 via these winetricks: dmband, dmcompose, dmime, dmloader, dmscript, dmstyle, dmsynth, dmmusic
https://appdb.winehq.org/objectManager.php?sClass=version&iId=7012 Night of the Raven: 2.6/2.7 mentions some of these winetricks and other instructions but only the winetricks above were needed to fix for wine-10.11-217-g3c4cc9d04b6.
Sound issues mentioned by AppDB seem mostly resolved but graphics issues persist which are not mentioned and are still being debugged for wine-10.11-217-g3c4cc9d04b6.
So far the graphics issues seem just aesthetical and don't break the game otherwise.
Grahics issues seem related to bad depth test or culling with flickering objects and floors and walls appearing and disappearing.
At the very beginning when the main character is going through the initial dialogue with the first NPC, you can see through the wall and floor behind the main character.
Once dialogue completes and character is movable it becomes clear that the wall and floor appear and disappear depending on how far they are away from the corner of the screen suggesting graphics culling bugs.
winetricks install of practically all d3d dlls didn't resolve this issue which is still being debugged.
http://bugs.winehq.org/show_bug.cgi?id=58493
--- Comment #3 from Stian Low wineryyyyy@gmail.com --- Created attachment 78951 --> http://bugs.winehq.org/attachment.cgi?id=78951 Gothic II Graphics issues after Access Violation fix
This snapshot shows the graphics issues described for Gothic II after Access Violation is fixed.
http://bugs.winehq.org/show_bug.cgi?id=58493
--- Comment #4 from Stian Low wineryyyyy@gmail.com --- See https://bugs.winehq.org/show_bug.cgi?id=58495 that will handle the remaining graphics issues after Access Violation is fixed for version wine-10.11-217-g3c4cc9d04b6:
http://bugs.winehq.org/show_bug.cgi?id=58493
Michael Stefaniuc mstefani@winehq.org changed:
What |Removed |Added ---------------------------------------------------------------------------- CC| |mstefani@winehq.org
--- Comment #5 from Michael Stefaniuc mstefani@winehq.org --- Please attach the compressed debug output of the crashing run with WINEDEBUG=+seh,+dsound,+dsound3d,+dswave,+dmband,+dmcompos,+dmdump,+dmfile,+dmfileraw,+dmime,+dmloader,+dmobj,+dmscript,+dmstyle,+dmsynth,+dmusic wine gothic.exe >> gothig-debug.log
Also please open a separate bug for the graphics issue. It is a different component.
http://bugs.winehq.org/show_bug.cgi?id=58493
--- Comment #6 from Andrey Gusev andrey.goosev@gmail.com --- Created attachment 78985 --> http://bugs.winehq.org/attachment.cgi?id=78985 debug output
(In reply to Michael Stefaniuc from comment #5)
Also please open a separate bug for the graphics issue. It is a different component.
I think the reporter of issue with graphics already did it and mentioned that in comment above.
http://bugs.winehq.org/show_bug.cgi?id=58493
--- Comment #7 from Michael Stefaniuc mstefani@winehq.org --- Thanks for the debug output:
0124:warn:dmfile:stream_chunk_get_data Chunk 'prth' (size 154, offset 15ee) doesn't contains the expected data size 160 0124:warn:dmloader:loader_GetObject : failed to (completely) load object (0x80004005) 0124:warn:dmstyle:parse_style_ref Failed to load reference: 0x80004005
And then later on 0124:trace:dmime:segment_GetTrack (0188E5B8, {00000000-0000-0000-0000-000000000000}, 0xffffffff, 0x4, 0135F304) 0124:trace:dmime:segment_GetParam (0188E5B8): not found 0124:trace:seh:dispatch_exception code=c0000005 (EXCEPTION_ACCESS_VIOLATION) flags=0 addr=004E956C
'prth' is DMUS_FOURCC_PART_CHUNK and the handling of that was indeed modified in 8e596f4ddba3d19d6eea645e59d54101f93aa2bc.
Now the question is why the gothic file misses the dwFlags (and two of the pad bytes from DMUS_IO_STYLEPART, but that's expected). The oldest DirectX SDK I have is from August 2007 and that is post DX8 and already includes those fields without a comment that those are a DX8 addition. But by the position after the padding that feels like dwFlags was a later addition.
http://bugs.winehq.org/show_bug.cgi?id=58493
--- Comment #8 from Michael Stefaniuc mstefani@winehq.org --- Created attachment 78990 --> http://bugs.winehq.org/attachment.cgi?id=78990 Proposed fix
Can you please test the attached fix?
http://bugs.winehq.org/show_bug.cgi?id=58493
Michael Stefaniuc mstefani@winehq.org changed:
What |Removed |Added ---------------------------------------------------------------------------- Keywords| |patch
http://bugs.winehq.org/show_bug.cgi?id=58493
--- Comment #9 from Andrey Gusev andrey.goosev@gmail.com --- If the main goal of patch is just to trigger the first condition then yes, it does and still crashes.
0124:warn:dmstyle:parse_part_list Missing dwFlags field in 'prth' chunk, size 154
Back to state of 8e596f4ddba3d19d6eea645e59d54101f93aa2bc
Line 483 -> IStream_Read (pStm, &Chunk, sizeof(FOURCC)+sizeof(DWORD), NULL); removing sizeof(FOURCC) or sizeof(DWORD) reproduces Access Violation.
http://bugs.winehq.org/show_bug.cgi?id=58493
--- Comment #10 from Michael Stefaniuc mstefani@winehq.org --- No, the idea of the patch was to accept the shorter chunk like the old code did. Can you please attach a debug run with the patch?
http://bugs.winehq.org/show_bug.cgi?id=58493
--- Comment #11 from Andrey Gusev andrey.goosev@gmail.com --- Created attachment 79008 --> http://bugs.winehq.org/attachment.cgi?id=79008 output with the fix
http://bugs.winehq.org/show_bug.cgi?id=58493
--- Comment #12 from Michael Stefaniuc mstefani@winehq.org --- OK, the parsing of the DMUS_FOURCC_PART_CHUNK succeeded with my patch. Now something else fails to parse later on: 0124:warn:dmfile:stream_chunk_get_array 'note' chunk, size 48: Array element size mismatch: got 22, expected 24 0124:warn:dmloader:loader_GetObject : failed to (completely) load object (0x88781150) 0124:warn:dmstyle:parse_style_ref Failed to load reference: 0x88781150
The crash is of course the same.
http://bugs.winehq.org/show_bug.cgi?id=58493
--- Comment #13 from Michael Stefaniuc mstefani@winehq.org --- OK, it makes sense now: Gothic uses pre-DX8 creates dmusic files. DMUS_IO_STYLENOTE and DMUS_IO_STYLECURVE have fields with "DX8" comment. DMUS_IO_STYLENOTE with size of 22 corresponds to the pre-DX8 version.
Most likely DMUS_IO_STYLEPART had at one point in time the dwFlags field added too. I'll need to review the whole change from 8e596f4ddba3d19d6eea645e59d54101f93aa2bc and add code to handle pre-DX8 files too.
http://bugs.winehq.org/show_bug.cgi?id=58493
--- Comment #14 from Michael Stefaniuc mstefani@winehq.org --- Created attachment 79014 --> http://bugs.winehq.org/attachment.cgi?id=79014 Second patch on top of first one
This fixes the reading of pre-DX8 versions of the DMUS_IO_STYLENOTE and DMUS_IO_STYLECURVE structs. Those are the only two documented ones with "DX8" added fields.
http://bugs.winehq.org/show_bug.cgi?id=58493
Michael Stefaniuc mstefani@winehq.org changed:
What |Removed |Added ---------------------------------------------------------------------------- Attachment #79014|0 |1 is obsolete| |
--- Comment #15 from Michael Stefaniuc mstefani@winehq.org --- Comment on attachment 79014 --> http://bugs.winehq.org/attachment.cgi?id=79014 Second patch on top of first one
The stream_chunk_get_array_alt() implementation is wrong for the alternate array element sizes. It needs to read each array element separately. I'll revisit the second patch later tonight.
http://bugs.winehq.org/show_bug.cgi?id=58493
--- Comment #16 from Michael Stefaniuc mstefani@winehq.org --- Found two more games with the old pre-DX8 DMUS_FOURCC_PART_LIST: - Chicken Tournament (hits the code with same failure but no crashes) - No One Lives Forever (No attempt to load any DMUS_FOURCC_PART_LIST chunk, most likely due to previous parsing errors. No crash).
So I'm testing my patches https://gitlab.winehq.org/wine/wine/-/merge_requests/8627 with Chicken Tournament.
You can try those with Gothic II too but I have feeling it will still crash as I still see the 0124:warn:dmstyle:parse_style_ref Failed to load reference: ... On a quick glance no longer a difference in chunk (struct) size but something else.
Also I see DX7 chunk (struct) size difference in DMUS_FOURCC_PATTERN_CHUNK from parse_pttn_list() that can later crash Gothic too. But that would be a regression from d1d13e50ec505e2cf4e40b9293853975bf3945e2.
Well, "regression"... the old code just skipped those chunks instead of parsing them correctly.
http://bugs.winehq.org/show_bug.cgi?id=58493
--- Comment #17 from Michael Stefaniuc mstefani@winehq.org --- OK, the "0124:warn:dmstyle:parse_style_ref Failed to load reference" is not relevant. References don't need to be fully satisfied when parsing the reference (afair).
The interesting part was the: 0024:warn:dmloader:loader_GetObject : failed to (completely) load object That succeeds now for me in Chicken Tournament after adding support for DX7 versions of DMUS_FOURCC_PATTERN_CHUNK and DMUS_FOURCC_PARTREF_CHUNK.
I pushed both those patches to https://gitlab.winehq.org/wine/wine/-/merge_requests/8627
I had to add also a patch to prevent Chicken Tournament from crashing as it seems to "finish" loading and runs into other unimplemented functions.
Can you please retry with the above MR and provide a debug log?
http://bugs.winehq.org/show_bug.cgi?id=58493
--- Comment #18 from Andrey Gusev andrey.goosev@gmail.com --- Created attachment 79027 --> http://bugs.winehq.org/attachment.cgi?id=79027 output with MR8627
http://bugs.winehq.org/show_bug.cgi?id=58493
--- Comment #19 from Michael Stefaniuc mstefani@winehq.org --- Thanks for the log. But I'm a little bit confused: While I don't see an EXCEPTION_ACCESS_VIOLATION, nor the dmloader warn, I don't see any dmstyle logs nor the chunks that failed to parse before.
http://bugs.winehq.org/show_bug.cgi?id=58493
--- Comment #20 from Andrey Gusev andrey.goosev@gmail.com --- Yes, I also noticed that. I used all debug channels from comment 5 each time.
http://bugs.winehq.org/show_bug.cgi?id=58493
Michael Stefaniuc mstefani@winehq.org changed:
What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |ASSIGNED
--- Comment #21 from Michael Stefaniuc mstefani@winehq.org --- OK, I'm puzzled. The only other DMusic related change was the signpost_track_Clone(). But there is no match for "signpost" in any of the log files. So no behavior change due to that.
Anyway, I have cleaned up my patches and submitted them as a new MR: https://gitlab.winehq.org/wine/wine/-/merge_requests/8644 I reviewed that all possible Style form chunks support now the DX7 version too.
http://bugs.winehq.org/show_bug.cgi?id=58493
--- Comment #22 from Rémi Bernon rbernon@codeweavers.com --- That MR has now been merged, is there still some regression?
http://bugs.winehq.org/show_bug.cgi?id=58493
Andrey Gusev andrey.goosev@gmail.com changed:
What |Removed |Added ---------------------------------------------------------------------------- Status|ASSIGNED |RESOLVED Resolution|--- |FIXED Fixed by SHA1| |6e8628a42850b1d4a37421e02a3 | |999d01f999566
--- Comment #23 from Andrey Gusev andrey.goosev@gmail.com --- Marking fixed.