https://bugs.winehq.org/show_bug.cgi?id=38400
Bug ID: 38400 Summary: Files fail to save and open in BDCraft Cubik Lite/Pro Product: Wine Version: 1.7.40 Hardware: x86-64 OS: Linux Status: UNCONFIRMED Severity: normal Priority: P2 Component: -unknown Assignee: wine-bugs@winehq.org Reporter: alexjvanderpotwebdesign@gmail.com Distribution: ---
Created attachment 51253 --> https://bugs.winehq.org/attachment.cgi?id=51253 Backtrace from "export json" attempt
File saving and opening fails in BDCraft Cubik in both the Pro and Lite versions. This makes the program effectively useless in Wine as you can not import/export models. A backtrace from a save attempt is attached.
https://bugs.winehq.org/show_bug.cgi?id=38400
ajvpot alexjvanderpotwebdesign@gmail.com changed:
What |Removed |Added ---------------------------------------------------------------------------- Distribution|--- |Debian
https://bugs.winehq.org/show_bug.cgi?id=38400
michael.becht@web.de changed:
What |Removed |Added ---------------------------------------------------------------------------- CC| |michael.becht@web.de
--- Comment #1 from michael.becht@web.de --- Same issue seen on 1.7.28. Also import and export fail.
https://bugs.winehq.org/show_bug.cgi?id=38400
super_man@post.com changed:
What |Removed |Added ---------------------------------------------------------------------------- CC| |super_man@post.com
--- Comment #2 from super_man@post.com --- Attach console output while you are trying to use save.
https://bugs.winehq.org/show_bug.cgi?id=38400
Pilvinen pilvinen@gmail.com changed:
What |Removed |Added ---------------------------------------------------------------------------- CC| |pilvinen@gmail.com
--- Comment #3 from Pilvinen pilvinen@gmail.com --- Created attachment 54054 --> https://bugs.winehq.org/attachment.cgi?id=54054 backtrace from import crash
This is an error log from import. The file operations have been broken in all versions of Wine, afaik.
BDcraft Cubik works 100% except for all the file operations, ie Import/export/save/load are broken and result in a crash. Otherwise the program runs flawlessly so I'm guessing this would be trivial to fix.
If someone from Wine project is willing to look into this I'm willing to help in any way I can - financially/error logs.
It would be super cool if some one could look into this.
https://bugs.winehq.org/show_bug.cgi?id=38400
--- Comment #4 from Pilvinen pilvinen@gmail.com --- Created attachment 54056 --> https://bugs.winehq.org/attachment.cgi?id=54056 Backtrace log from save crash
Getting this on save:
wine: Unhandled page fault on read access to 0x38003838 at address 0x38003838 (thread 0034), starting debugger...
https://bugs.winehq.org/show_bug.cgi?id=38400
--- Comment #5 from Pilvinen pilvinen@gmail.com --- Created attachment 54295 --> https://bugs.winehq.org/attachment.cgi?id=54295 Log from import with some extra debug flags enabled
Log from import crash with some extra debug flags enabled.
The crash also affects the free version of the software.
https://bugs.winehq.org/show_bug.cgi?id=38400
--- Comment #6 from Pilvinen pilvinen@gmail.com --- Created attachment 54296 --> https://bugs.winehq.org/attachment.cgi?id=54296 Log from save crash with some extra debug flags enabled
Log from save crash with some extra debug flags enabled.
This also affects the free demo version of the software.
https://bugs.winehq.org/show_bug.cgi?id=38400
Andrew Eikum aeikum@codeweavers.com changed:
What |Removed |Added ---------------------------------------------------------------------------- CC| |aeikum@codeweavers.com
https://bugs.winehq.org/show_bug.cgi?id=38400
--- Comment #7 from Andrew Eikum aeikum@codeweavers.com --- Can you provide a link to the free/demo version? Thanks.
https://bugs.winehq.org/show_bug.cgi?id=38400
--- Comment #8 from Pilvinen pilvinen@gmail.com --- Here you go, one link to the free version:
http://adf.ly/564553/bdc-cubik-lite
https://bugs.winehq.org/show_bug.cgi?id=38400
--- Comment #9 from Pilvinen pilvinen@gmail.com --- And in case that doesn't work here is the download page itself for the lite version:
https://bugs.winehq.org/show_bug.cgi?id=38400
Dmitry Timoshkov dmitry@baikal.ru changed:
What |Removed |Added ---------------------------------------------------------------------------- Ever confirmed|0 |1 Status|UNCONFIRMED |NEW
--- Comment #10 from Dmitry Timoshkov dmitry@baikal.ru --- It's a bug in the application, it works by a pure luck under Windows.
The app passes a not initialized ofn->lpstrFileTitle to GetSaveFileNameW(). Basically ofn->lpstrFileTitle points to the stack approximately 428 bytes above the current stack pointer, and since Wine's GetSaveFileNameW() uses more than 4096 bytes one of internal stack frames is guaranteed to be trashed after copying file name to ofn->lpstrFileTitle.
I managed to reduce stack utilization of GetSaveFileNameW() to about 2048 bytes by allocating most of temporary variables on the heap instead of stack but that doesn't help, simple dialog creation in Wine already takes more than 1024 bytes of stack.
I'd say invalid or won't fix.
https://bugs.winehq.org/show_bug.cgi?id=38400
Andrew Eikum aeikum@codeweavers.com changed:
What |Removed |Added ---------------------------------------------------------------------------- URL| |http://bdcraft.net/cubik-li | |te Keywords| |download
https://bugs.winehq.org/show_bug.cgi?id=38400
--- Comment #11 from Bruno Jesus 00cpxxx@gmail.com --- (In reply to Dmitry Timoshkov from comment #10)
It's a bug in the application, it works by a pure luck under Windows.
The app passes a not initialized ofn->lpstrFileTitle to GetSaveFileNameW(). Basically ofn->lpstrFileTitle points to the stack approximately 428 bytes above the current stack pointer, and since Wine's GetSaveFileNameW() uses more than 4096 bytes one of internal stack frames is guaranteed to be trashed after copying file name to ofn->lpstrFileTitle.
Same as bug 35200 then, at least I remember seeing a similar issue there and I attempted to create a patch [1] in order to mitigate the situation by checking how close the pointer is to the struct. But my tests on Windows led to crashes proving it would also overwrite the bad memory pointer, as you say it works by pure luck.
[1] https://bugs.winehq.org/attachment.cgi?id=52622&action=diff
https://bugs.winehq.org/show_bug.cgi?id=38400
--- Comment #12 from Dmitry Timoshkov dmitry@baikal.ru --- (In reply to Bruno Jesus from comment #11)
It's a bug in the application, it works by a pure luck under Windows.
The app passes a not initialized ofn->lpstrFileTitle to GetSaveFileNameW(). Basically ofn->lpstrFileTitle points to the stack approximately 428 bytes above the current stack pointer, and since Wine's GetSaveFileNameW() uses more than 4096 bytes one of internal stack frames is guaranteed to be trashed after copying file name to ofn->lpstrFileTitle.
Same as bug 35200 then, at least I remember seeing a similar issue there and I attempted to create a patch [1] in order to mitigate the situation by checking how close the pointer is to the struct. But my tests on Windows led to crashes proving it would also overwrite the bad memory pointer, as you say it works by pure luck.
Sounds pretty similar.
[1] https://bugs.winehq.org/attachment.cgi?id=52622&action=diff
I think that I've found a better (and easier) workaround.
https://bugs.winehq.org/show_bug.cgi?id=38400
--- Comment #13 from Dmitry Timoshkov dmitry@baikal.ru --- (In reply to Dmitry Timoshkov from comment #12)
(In reply to Bruno Jesus from comment #11)
It's a bug in the application, it works by a pure luck under Windows.
The app passes a not initialized ofn->lpstrFileTitle to GetSaveFileNameW(). Basically ofn->lpstrFileTitle points to the stack approximately 428 bytes above the current stack pointer, and since Wine's GetSaveFileNameW() uses more than 4096 bytes one of internal stack frames is guaranteed to be trashed after copying file name to ofn->lpstrFileTitle.
Same as bug 35200 then, at least I remember seeing a similar issue there and I attempted to create a patch [1] in order to mitigate the situation by checking how close the pointer is to the struct. But my tests on Windows led to crashes proving it would also overwrite the bad memory pointer, as you say it works by pure luck.
Sounds pretty similar.
The difference between these bugs is that the app in the bug 35200 calls GetSaveFileNameA while BDCraft Cubik calls GetSaveFileNameW. However both applications set ofn->lpstrFileTitle in a similar wrong way leading to stack trashing.
[1] https://bugs.winehq.org/attachment.cgi?id=52622&action=diff
I think that I've found a better (and easier) workaround.
A test shows that my workaround works also for the bug 35200 (and doesn't need any fancy checks).
https://bugs.winehq.org/show_bug.cgi?id=38400
Sebastian Lackner sebastian@fds-team.de changed:
What |Removed |Added ---------------------------------------------------------------------------- CC| |dmitry@baikal.ru, | |erich.e.hoover@wine-staging | |.com, michael@fds-team.de, | |sebastian@fds-team.de Staged patchset| |https://github.com/wine-com | |pholio/wine-staging/tree/ma | |ster/patches/comdlg32-lpstr | |FileTitle Status|NEW |STAGED
https://bugs.winehq.org/show_bug.cgi?id=38400
Bruno Jesus 00cpxxx@gmail.com changed:
What |Removed |Added ---------------------------------------------------------------------------- CC| |gyebro69@gmail.com
--- Comment #14 from Bruno Jesus 00cpxxx@gmail.com --- *** Bug 35200 has been marked as a duplicate of this bug. ***
https://bugs.winehq.org/show_bug.cgi?id=38400
--- Comment #15 from Bruno Jesus 00cpxxx@gmail.com --- Nice job, I hope to see it committed to vanilla soon.
https://bugs.winehq.org/show_bug.cgi?id=38400
André H. nerv@dawncrow.de changed:
What |Removed |Added ---------------------------------------------------------------------------- Staged patchset|https://github.com/wine-com |https://github.com/wine-sta |pholio/wine-staging/tree/ma |ging/wine-staging/tree/mast |ster/patches/comdlg32-lpstr |er/patches/comdlg32-lpstrFi |FileTitle |leTitle CC| |nerv@dawncrow.de
https://bugs.winehq.org/show_bug.cgi?id=38400
Alistair Leslie-Hughes leslie_alistair@hotmail.com changed:
What |Removed |Added ---------------------------------------------------------------------------- Component|-unknown |comctl32
https://bugs.winehq.org/show_bug.cgi?id=38400
Nikolay Sivov bunglehead@gmail.com changed:
What |Removed |Added ---------------------------------------------------------------------------- Component|comctl32 |comdlg32