Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Stack-buffer-overflow when creating a window #951

nnorwitz opened this issue Feb 22, 2017 · 2 comments


None yet
3 participants
Copy link

commented Feb 22, 2017

When using AddressSanitizer ( on GLFW code where long = 64 bits, there is a seg fault with this info:

==35010==ERROR: AddressSanitizer: stack-buffer-overflow on address 0x7ffd022b0850 at pc 0x7effc37d0fa7 bp 0x7ffd022b0440 sp 0x7ffd022b0438
READ of size 8 at 0x7ffd022b0850 thread T0
    #0 0x7effc37d0fa6 in _XData32 Xorg/libX11-1.6.3/src/XlibInt.c:1608:15
    #1 0x7effc378e31a in XChangeProperty Xorg/libX11-1.6.3/src/ChProp.c:83:6
    #2 0x7effc372a82c in createWindow GLFW/src/x11_window.c:536:9
    #3 0x7effc372a82c in _glfwPlatformCreateWindow GLFW/src/x11_window.c:1527
    #4 0x7effc373cb5f in glfwCreateWindow GLFW/src/window.c:195:10

When disabling the pid section in:
the problem goes away. I suspect if you cast the pid_t to a long it will avoid the problem.

This seems like a similar to this where the length was changed to a long:

There may be other problems, but avoiding the pid code solved the problem in my environment.


This comment has been minimized.

Copy link

commented Feb 22, 2017

const pid_t pid = getpid(); should be replaced with const long pid = getpid() or some such

@elmindreda elmindreda self-assigned this Feb 23, 2017

@elmindreda elmindreda added the verified label Feb 23, 2017

@elmindreda elmindreda changed the title stack-buffer-overflow when creating an X11 window Stack-buffer-overflow when creating a window Feb 23, 2017

@elmindreda elmindreda added this to the 3.3 milestone Feb 23, 2017


This comment has been minimized.

Copy link

commented Feb 26, 2017

This should be fixed now with 5352e2c. Thank you @nnorwitz and @kcc!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.