After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 781301 - Stack pointer corrupted by incorrect call of NtNotifyChangeMultipleKeys
Stack pointer corrupted by incorrect call of NtNotifyChangeMultipleKeys
Status: RESOLVED FIXED
Product: glib
Classification: Platform
Component: win32
2.52.x
Other Windows
: Normal critical
: ---
Assigned To: gtk-win32 maintainers
gtk-win32 maintainers
Depends on:
Blocks:
 
 
Reported: 2017-04-14 06:14 UTC by John Lindgren
Modified: 2017-06-01 11:13 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Use correct calling convention (2.34 KB, patch)
2017-04-14 06:14 UTC, John Lindgren
committed Details | Review
Add calling convention to GetTickCount64 (807 bytes, patch)
2017-04-14 07:31 UTC, LRN
committed Details | Review

Description John Lindgren 2017-04-14 06:14:04 UTC
Created attachment 349850 [details] [review]
Use correct calling convention

The NtNotifyChangeMultipleKeysFunc typedef is missing the NTAPI (a.k.a. __stdcall) annotation.  This leads to GCC calling it as a __cdecl function and corrupting the stack pointer on return, with predictably disastrous results.
Comment 1 LRN 2017-04-14 07:31:45 UTC
Created attachment 349852 [details] [review]
Add calling convention to GetTickCount64

This is super scary.
Comment 2 Ignacio Casal Quinteiro (nacho) 2017-04-14 08:20:14 UTC
This is one the things I hate of windows API. Let's get this merged and backported if needed.
Comment 3 Fan, Chun-wei 2017-04-14 09:05:24 UTC
Hi,

I think this looks reasonable to me as well... This is likely to hit 32-bit builds more than 64-bit builds, due to the differences in the way __stdcall is handled (this should go into 2.52 and perhaps even 2.50 as well, as 2.50 is supposed to be our LTS release, although 2.52's codebase didn't actually bump the compiler requirements yet for C99 features).

With blessings, thank you!
Comment 4 Ignacio Casal Quinteiro (nacho) 2017-06-01 09:55:26 UTC
LRN are you taking care of pushing this?