https://bugs.winehq.org/show_bug.cgi?id=40866
Bug ID: 40866 Summary: DigitalMicrograph: crashes when a new script is added to the menu Product: Wine Version: 1.9.13 Hardware: x86 OS: Linux Status: UNCONFIRMED Severity: normal Priority: P2 Component: user32 Assignee: wine-bugs@winehq.org Reporter: niermann@physik.tu-berlin.de Distribution: ---
Created attachment 54885 --> https://bugs.winehq.org/attachment.cgi?id=54885 Wine output during crash
DigitalMicrograph by Gatan crashes when the "Install Script" dialog is closed. Independently of whether the dialog is opened via the "File->Install Script" or the "File->Install Script File" command.
To reproduce: Create new script (File->New Script) and try to install it (File->Install Script). In the "Install script" dialog simply press Enter without changing anything.
Bug occurs on DigitalMicrograph versions 1.8.3 and 2.3.0 (others not tested) and with wine 1.6.2 and wine-1.9.13 (others not tested).
From tracing the outputs and by debugging wine I found the reason for the crash
to be in dlls/user32/edit.c: The application calls EM_GETHANDLE and later WM_SETFONT on an edit control (without sending EM_SETHANDLE in between). During processing WM_SETFONT the es->text field is accessed, which at this point contains NULL due to the inhibited buffer locking after EM_GETHANDLE.
https://bugs.winehq.org/show_bug.cgi?id=40866
--- Comment #1 from niermann@physik.tu-berlin.de --- Created attachment 54907 --> https://bugs.winehq.org/attachment.cgi?id=54907 Patch for dll/user32/edit.c and associated test
https://bugs.winehq.org/show_bug.cgi?id=40866
--- Comment #2 from niermann@physik.tu-berlin.de --- Created attachment 54923 --> https://bugs.winehq.org/attachment.cgi?id=54923 Test program to produce similar behavior
"Get Handle" -> Send EM_GETHANDLE, handle is printed to the top right "Free Handle" -> Free handle obtained by "Get Handle" "Set Handle" -> Create new buffer and set it via EM_SETHANDLE "Set Font" -> Change font by sending WM_SETFONT to the edit control
To reproduce bug, press "Get Handle" than "Set Font". That causes no crash on Windows 7 (but in wine 1.9.13) "Get Handle", "Free Handle" than "Set Font" causes crash.
https://bugs.winehq.org/show_bug.cgi?id=40866
niermann@physik.tu-berlin.de changed:
What |Removed |Added ---------------------------------------------------------------------------- CC| |niermann@physik.tu-berlin.d | |e Keywords| |patch, testcase
https://bugs.winehq.org/show_bug.cgi?id=40866
--- Comment #3 from Nikolay Sivov bunglehead@gmail.com --- Please retest with current wine-git, this is probably fixed with f62d8dc58fb3fb5f11a8ab55620ab9b2fbdaf967.
https://bugs.winehq.org/show_bug.cgi?id=40866
--- Comment #4 from niermann@physik.tu-berlin.de --- I retested with wine-git version eebf1181f91bbef003dd519f2c2f4ee33f0acc0c (which contains commit f62d8dc58fb3fb5f11a8ab55620ab9b2fbdaf967) and Digital Micrograph (version 2.3.0, 32 bit) behaves like under Windows 7. This bug is now fixed.
For the record, also the test program (comment #2) works now identical under the current wine-git, Window 7 as-well-as Windows 10.
Nikolay, thanks for fixing this.
https://bugs.winehq.org/show_bug.cgi?id=40866
Nikolay Sivov bunglehead@gmail.com changed:
What |Removed |Added ---------------------------------------------------------------------------- Fixed by SHA1| |f62d8dc58fb3fb5f11a8ab55620 | |ab9b2fbdaf967 Status|UNCONFIRMED |RESOLVED Resolution|--- |FIXED
--- Comment #5 from Nikolay Sivov bunglehead@gmail.com --- Marking fixed, thanks for testing.
https://bugs.winehq.org/show_bug.cgi?id=40866
Alexandre Julliard julliard@winehq.org changed:
What |Removed |Added ---------------------------------------------------------------------------- Status|RESOLVED |CLOSED
--- Comment #6 from Alexandre Julliard julliard@winehq.org --- Closing bugs fixed in 3.0-rc1.
https://bugs.winehq.org/show_bug.cgi?id=40866
Michael Stefaniuc mstefani@winehq.org changed:
What |Removed |Added ---------------------------------------------------------------------------- Target Milestone|--- |2.0.x
https://bugs.winehq.org/show_bug.cgi?id=40866
Michael Stefaniuc mstefani@winehq.org changed:
What |Removed |Added ---------------------------------------------------------------------------- Target Milestone|2.0.x |---
--- Comment #7 from Michael Stefaniuc mstefani@winehq.org --- Removing the 2.0.x milestone from bugs included in 2.0.5.