-
Notifications
You must be signed in to change notification settings - Fork 285
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
segfault on exit on Linux #1549
Comments
#include <stdio.h>
#include <allegro5/allegro5.h>
#include <allegro5/allegro_font.h>
int main()
{
if(!al_init()){
printf("couldn't initialize allegro\n");
return 1;
}
ALLEGRO_DISPLAY* disp = al_create_display(640, 480);
if(!disp){
printf("couldn't initialize display\n");
return 1;
}
al_destroy_display(disp);
printf("Return\n");
return 0;
} Command: gcc test.c -o test $(pkg-config allegro-5 allegro_font-5 allegro_image-5 allegro_primitives-5 --libs --cflags) |
What Linux-distro are you on? I cannot reproduce this on Debian stable, Nvidia graphics driver, nor Debian unstable, on virtualbox on the same machine, allegro from latest git in both cases. (Neither with the allegro examples, or @kris659 short code example from here). |
I'm using Ubuntu on WSL (someone from discord is using wayland Ubuntu) |
Ubuntu 22.04.3 LTS + AMD here + X11 here. |
Yeah, I am on X11 too on both my tests, just mention it for completion (Problem seems to be both X11 and wayland though). |
Spent a little time on this today. It's possible to bisect a crash like this to commit d0e5746, but reverting it in today's Allegro does nothing (because it crashes before it gets to it for me). One reliable way to avoid this crash for me is to call |
So, perhaps all we have to do is add those manual calls to the examples? |
I could reproduce this bug on Fedora 37 with Mesa 23.0.3. However, I could not reproduce this on Ubuntu 20 with Mesa 21.2.6, nor Debian 12 with Mesa 22.3.6. I tracked down the segfault to line 732 in xdisplay.c: glXDestroyWindow(s->x11display, glx->glxwindow);
If I remove the whole conditional block starting in line 731, e.g. replacing it by For my Ubuntu and Debian tests, I also checked that this conditional branch is actually run, and it exits fine. |
This happens reliably with most examples. Exact reasons unknown.
The text was updated successfully, but these errors were encountered: