liballeg / allegro5

The official Allegro 5 git repository. Pull requests welcome!
https://liballeg.org
Other
1.89k stars 286 forks source link

Linux Mint 22 core dump caused by al_set_new_bitmap_flags(ALLEGRO_VIDEO_BITMAP) #1571

Closed geecab closed 3 months ago

geecab commented 3 months ago

Hi there!

I've just installed Linux Mint 22 Cinnamon edition. Doing the following gives me allegro 5.2.9.2: sudo apt-get update sudo apt-get install g++ cmake liballegro5-dev

Running my test app (test.c) core dumps when creating the display (Comment out the al_set_new_bitmap_flags() line and it runs ok): `

include

include <allegro5/allegro5.h>

include <allegro5/allegro_font.h>

int main() { if(!al_init()){ printf("couldn't initialize allegro\n"); return 1; }

//This Line gives you a core dump on Mint 22... al_set_new_bitmap_flags(ALLEGRO_VIDEO_BITMAP);

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; } `

Compiled by doing:- gcc test.c -o test $(pkg-config allegro-5 allegro_font-5 allegro_image-5 allegro_primitives-5 --libs --cflags)

Just wondered if anyone has seen this issue before?

Many thanks :)

allefant commented 3 months ago

Can you get a backtrace? Your code seems to work for me.

geecab commented 3 months ago

Hi there, thanks for the response, does this help? I'm not sure how to get the debug symbols for allegro...

qwetry@qwetry-RM-ONE-ECOQUIET-210:~/my_work/ex1$ coredumpctl debug PID: 2643 (test) UID: 1000 (qwetry) GID: 1000 (qwetry) Signal: 11 (SEGV) Timestamp: Fri 2024-08-09 14:17:51 BST (4s ago) Command Line: ./test Executable: /home/qwetry/my_work/ex1/test Control Group: /user.slice/user-1000.slice/user@1000.service/app.slice/app-org.gnome.Terminal.slice/vte-spawn-b9c4d21b-7632-4b3b-91f4-378763e3eda8.scope Unit: user@1000.service User Unit: vte-spawn-b9c4d21b-7632-4b3b-91f4-378763e3eda8.scope Slice: user-1000.slice Owner UID: 1000 (qwetry) Boot ID: ed40e27571b44b8ea1b663220ffc3c5f Machine ID: 3ef08070ab9241eaae96c800cf99c670 Hostname: qwetry-RM-ONE-ECOQUIET-210 Storage: /var/lib/systemd/coredump/core.test.1000.ed40e27571b44b8ea1b663220ffc3c5f.2643.1723209471000000.zst (present) Size on Disk: 1.2M Message: Process 2643 (test) of user 1000 dumped core.

            Module libzstd.so.1 from deb libzstd-1.5.5+dfsg2-2build1.amd64
            Stack trace of thread 2643:
            #0  0x000076285515d314 al_lock_bitmap (liballegro.so.5.2 + 0x43314)
            #1  0x00007628551deb05 n/a (liballegro.so.5.2 + 0xc4b05)
            #2  0x00007628551e546c n/a (liballegro.so.5.2 + 0xcb46c)
            #3  0x000076285517ad7c al_create_display (liballegro.so.5.2 + 0x60d7c)
            #4  0x00005cc7b24c423f n/a (/home/qwetry/my_work/ex1/test + 0x123f)
            #5  0x0000762854e2a1ca __libc_start_call_main (libc.so.6 + 0x2a1ca)
            #6  0x0000762854e2a28b __libc_start_main_impl (libc.so.6 + 0x2a28b)
            #7  0x00005cc7b24c4125 n/a (/home/qwetry/my_work/ex1/test + 0x1125)
            ELF object binary architecture: AMD x86-64

(gdb) bt

0 0x000076285515d314 in al_lock_bitmap () from /lib/x86_64-linux-gnu/liballegro.so.5.2

1 0x00007628551deb05 in ?? () from /lib/x86_64-linux-gnu/liballegro.so.5.2

2 0x00007628551e546c in ?? () from /lib/x86_64-linux-gnu/liballegro.so.5.2

3 0x000076285517ad7c in al_create_display () from /lib/x86_64-linux-gnu/liballegro.so.5.2

4 0x00005cc7b24c423f in main () at test.c:15

geecab commented 3 months ago

Just wanted to double check, are you definitely running Mint 22 and allegro 5.2.9.2 ?

gusnan commented 3 months ago

Try to call al_set_new_bitmap_flags after you have called al_create_display. Also, I'm curious to where have you found allegro 5.2.9.2...

geecab commented 3 months ago

Hi there!

Try to call al_set_new_bitmap_flags after you have called al_create_display.

OK, and yes that has stopped the core dump.

Also, I'm curious to where have you found allegro 5.2.9.2...

Its what this gave me... sudo apt-get update sudo apt-get install g++ cmake liballegro5-dev

:)

SiegeLord commented 3 months ago

Thanks for the report.