Skip to content

Fix calling convention of glGetStringi pointer in GLProbe - #1059

Open
Coastrnaut wants to merge 1 commit into
projectM-visualizer:masterfrom
Coastrnaut:fix-glprobe-getstringi-calling-convention
Open

Coastrnaut wants to merge 1 commit into
projectM-visualizer:masterfrom
Coastrnaut:fix-glprobe-getstringi-calling-convention

Conversation

@Coastrnaut

@Coastrnaut Coastrnaut commented Nov 7, 2026 •

Copy link
Copy Markdown

ResolvedGLFunctions::GetStringiFn in GLProbe.cpp was declared as a plain function pointer, without the GL calling convention:

using GetStringiFn = const GLubyte* (*) (GLenum, GLuint);

On 32-bit Windows, GL functions are __stdcall, so each call through this pointer leaves the stack unbalanced. In the Windows Store app, x86 Release builds fail their stack cookie check (0xc0000409) at startup. 64-bit builds are unaffected, since x64 has one calling convention.

This declares it as glad's PFNGLGETSTRINGIPROC, which includes GLAD_API_PTR. The other pointers in the struct already get the convention from decltype. Both glad/gl.h and glad/gles2.h define the type.

Desktop Win32 CI doesn't catch this because those builds don't crash on it. #1058 proposes a UWP build job that would.

Testing

  • Built the Windows Store app (frontend-uwp#7) for x86 Release against this branch, with its local workaround for this bug turned off.
  • Before this change, it crashed at startup.
  • After it, the app ran as a 32-bit process, rendering at 32 fps (the display's refresh rate), with no crash events.

Retested on current master (2026-11-12)

GetStringiFn was declared as a plain function pointer, without the GL
calling convention. On 32-bit Windows, GL functions are __stdcall, so
each call through it left the stack unbalanced, and x86 Release builds
failed their stack cookie check at startup. Use glad's
PFNGLGETSTRINGIPROC, which carries GLAD_API_PTR, like the other
pointers in the struct get from decltype.
@kblaschke

Copy link
Copy Markdown
Member

Oh, thanks for the large amount of PRs, which look useful. Also thanks for splitting changes up contextually, this will make reviewing them a breeze!

I've been building quite some backlog of PRs to review for the past few weeks, so bear with me as I'm slowly working through it as time allows!

@Coastrnaut

Copy link
Copy Markdown
Author

Any chance you can re-add me to the repos with push access? I am Robert Pancoast, original author of the ump frontend. I am already in authors.txt. Used to be a maintainer, but deleted my Githuub account. Since then I have recreated a new Github account and started dev work again. I want to merge all my changes upstream and get the store apps working again for Windows Store/Xbos. Also, just finished the iOS app using the new iOS 27, system app capture api for loopback. I would like to merge the required changes upstream for iOS and add both windows store and iOS store builds to the ci.

@Coastrnaut

Copy link
Copy Markdown
Author

@kblaschke

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants