Allegro.cc - Online Community

Allegro.cc Forums » Allegro Development » al_create_dispkay() never returns on Pi4, Buster Lite

This thread is locked; no one can reply to it. rss feed Print
al_create_dispkay() never returns on Pi4, Buster Lite
chundermike
Member #16,629
January 2017

Hi

I'm trying to build an existing project on the Raspberry pi 4. Works fine on the pi3. Built the allegro library and my program fine, but when it runs, al_create_display() never returns. Allegro init worked fine, as did al_get_display_mode(). I'm running the latest Raspian Buster Lite. And Allegro version 5.2.4.

Any ideas?

Cheers
Mike

Edgar Reynaldo
Major Reynaldo
May 2007
avatar

chundermike
Member #16,629
January 2017

Hi,

Rebuilt with Allegro 5.2.5; al_create_display() still never returns. Here's a gdb backtrace if that's any use? I Ctrl-C'd the debug session after a few seconds when I knew it was in the hang state...

Cheers,
Mike

pi@raspberrypi:~/fruitbox_1.14base/build $ gdb --args ../fruitbox --test-buttons
GNU gdb (Raspbian 8.2.1-2) 8.2.1
Copyright (C) 2018 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
Type "show copying" and "show warranty" for details.
This GDB was configured as "arm-linux-gnueabihf".
Type "show configuration" for configuration details.
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>.
Find the GDB manual and other documentation resources online at:
<http://www.gnu.org/software/gdb/documentation/>.

For help, type "help".
Type "apropos word" to search for commands related to "word"...
Reading symbols from ../fruitbox...done.
(gdb) run
Starting program: /home/pi/fruitbox_1.14base/fruitbox --test-buttons
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/arm-linux-gnueabihf/libthread_db.so.1".

fruitbox v1.15beta2 (Oct 10 2019, 20:11:59) by Mike Kingsley
A customisable MP3 Retro Jukebox for the Raspberry Pi.
[New Thread 0xb5d49280 (LWP 16607)]
[New Thread 0xb53ff280 (LWP 16608)]
[New Thread 0xb4bfe280 (LWP 16609)]
[New Thread 0xb43fd280 (LWP 16610)]
^C
Thread 1 "fruitbox" received signal SIGINT, Interrupt.
0xb6bdd088 in futex_abstimed_wait_cancelable (private=0, abstime=0x0, expected=1, futex_word=0xb69a7a58 <khrn_queue+76>)
at ../sysdeps/unix/sysv/linux/futex-internal.h:205
205 ../sysdeps/unix/sysv/linux/futex-internal.h: No such file or directory.
(gdb) bt
#0 0xb6bdd088 in futex_abstimed_wait_cancelable (private=0, abstime=0x0, expected=1,
futex_word=0xb69a7a58 <khrn_queue+76>) at ../sysdeps/unix/sysv/linux/futex-internal.h:205
#1 do_futex_wait (sem=sem@entry=0xb69a7a58 <khrn_queue+76>, abstime=0x0) at sem_waitcommon.c:115
#2 0xb6bdd1f4 in __new_sem_wait_slow (sem=0xb69a7a58 <khrn_queue+76>, abstime=0x0) at sem_waitcommon.c:282
#3 0xb63c0b60 in vchiu_queue_pop () from /opt/vc/lib/libvchiq_arm.so
#4 0xb6981014 in rpc_recv () from /opt/vc/lib/libbrcmEGL.so
#5 0xb6976d40 in egl_context_create () from /opt/vc/lib/libbrcmEGL.so
#6 0xb697974c in eglCreateContext () from /opt/vc/lib/libbrcmEGL.so
#7 0x0014bc94 in pi_create_display (display=0x2ce388)
at /home/pi/fruitbox_1.14base/build/allegro-5.2.5.0/src/raspberrypi/pidisplay.c:331
#8 raspberrypi_create_display (w=<optimized out>, h=<optimized out>)
at /home/pi/fruitbox_1.14base/build/allegro-5.2.5.0/src/raspberrypi/pidisplay.c:431
#9 0x001167b4 in al_create_display (w=1184, h=624) at /home/pi/fruitbox_1.14base/build/allegro-5.2.5.0/src/display.c:53
#10 0x00092658 in DisplayClass::DisplayClass() ()
#11 0x000204e0 in main ()
(gdb)

Edgar Reynaldo
Major Reynaldo
May 2007
avatar

That's funny it's stuck inside a semaphore wait in eglCreateContext

Sounds like a deadlock if you want me to guess.

When you SIGINT, could you try these two commands and report back?

gdb>info threads
gdb>thread apply all bt

Also, google was no help with 'rpc recv rpi4 egl'.

chundermike
Member #16,629
January 2017

pi@raspberrypi:~/fruitbox_1.14base $ gdb --args ./fruitbox --test-buttons
GNU gdb (Raspbian 8.2.1-2) 8.2.1
Copyright (C) 2018 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
Type "show copying" and "show warranty" for details.
This GDB was configured as "arm-linux-gnueabihf".
Type "show configuration" for configuration details.
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>.
Find the GDB manual and other documentation resources online at:
<http://www.gnu.org/software/gdb/documentation/>.

For help, type "help".
Type "apropos word" to search for commands related to "word"...
Reading symbols from ./fruitbox...done.
(gdb) run
Starting program: /home/pi/fruitbox_1.14base/fruitbox --test-buttons
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/arm-linux-gnueabihf/libthread_db.so.1".

fruitbox v1.15beta2 (Oct 10 2019, 20:11:59) by Mike Kingsley
A customisable MP3 Retro Jukebox for the Raspberry Pi.
[New Thread 0xb5d49280 (LWP 607)]
[New Thread 0xb53ff280 (LWP 608)]
[New Thread 0xb4bfe280 (LWP 609)]
[New Thread 0xb43fd280 (LWP 610)]
^C
Thread 1 "fruitbox" received signal SIGINT, Interrupt.
0xb6bdd088 in futex_abstimed_wait_cancelable (private=0, abstime=0x0, expected=1,
futex_word=0xb69a7a58 <khrn_queue+76>) at ../sysdeps/unix/sysv/linux/futex-internal.h:205
205 ../sysdeps/unix/sysv/linux/futex-internal.h: No such file or directory.
(gdb) bt
#0 0xb6bdd088 in futex_abstimed_wait_cancelable (private=0, abstime=0x0, expected=1,
futex_word=0xb69a7a58 <khrn_queue+76>) at ../sysdeps/unix/sysv/linux/futex-internal.h:205
#1 do_futex_wait (sem=sem@entry=0xb69a7a58 <khrn_queue+76>, abstime=0x0)
at sem_waitcommon.c:115
#2 0xb6bdd1f4 in __new_sem_wait_slow (sem=0xb69a7a58 <khrn_queue+76>, abstime=0x0)
at sem_waitcommon.c:282
#3 0xb63c0b60 in vchiu_queue_pop () from /opt/vc/lib/libvchiq_arm.so
#4 0xb6981014 in rpc_recv () from /opt/vc/lib/libbrcmEGL.so
#5 0xb69b0934 in glGetError () from /opt/vc/lib/libbrcmGLESv2.so
#6 0x0014f19c in ogl_upload_bitmap (bitmap=<optimized out>)
at /home/pi/fruitbox_1.14base/build/allegro-5.2.5.0/src/opengl/ogl_bitmap.c:515
#7 0x00102134 in _al_create_bitmap_params (current_display=current_display@entry=0x2ce388,
w=w@entry=512, h=h@entry=512, format=format@entry=2, flags=flags@entry=192,
depth=depth@entry=0, samples=0)
at /home/pi/fruitbox_1.14base/build/allegro-5.2.5.0/src/bitmap.c:164
#8 0x001021fc in al_create_bitmap (w=w@entry=512, h=512)
at /home/pi/fruitbox_1.14base/build/allegro-5.2.5.0/src/bitmap.c:191
#9 0x000edfe0 in really_load_png (png_ptr=0x0, info_ptr=0x2c9198, flags=0,
flags@entry=-1090522324)
at /home/pi/fruitbox_1.14base/build/allegro-5.2.5.0/addons/image/png.c:204
#10 0x000ee710 in _al_load_png_f (fp=0xb6ff5890, flags=-1090522324)
at /home/pi/fruitbox_1.14base/build/allegro-5.2.5.0/addons/image/png.c:394
#11 0x00092698 in DisplayClass::DisplayClass() ()
#12 0x000204e0 in main ()
(gdb) info threads
Id Target Id Frame

  • 1 Thread 0xb5d4a010 (LWP 596) "fruitbox" 0xb6bdd088 in futex_abstimed_wait_cancelable (private=0, abstime=0x0, expected=1, futex_word=0xb69a7a58 <khrn_queue+76>)

at ../sysdeps/unix/sysv/linux/futex-internal.h:205
2 Thread 0xb5d49280 (LWP 607) "VCHIQ completio" 0xb673451c in ioctl ()
at ../sysdeps/unix/syscall-template.S:78
3 Thread 0xb53ff280 (LWP 608) "HDispmanx Notif" 0xb6bdd088 in futex_abstimed_wait_cancelable (private=0, abstime=0x0, expected=1,
futex_word=0xb696d480 <dispmanx_notify_available_event+24>)
at ../sysdeps/unix/sysv/linux/futex-internal.h:205
4 Thread 0xb4bfe280 (LWP 609) "HTV Notify" 0xb6bdd088 in futex_abstimed_wait_cancelable (private=0, abstime=0x0, expected=1,
futex_word=0xb696c5f4 <tvservice_notify_available_event+24>)
at ../sysdeps/unix/sysv/linux/futex-internal.h:205
5 Thread 0xb43fd280 (LWP 610) "HCEC Notify" 0xb6bdd088 in futex_abstimed_wait_cancelable (private=0, abstime=0x0, expected=1,
futex_word=0xb696d384 <cecservice_notify_available_event+24>)
at ../sysdeps/unix/sysv/linux/futex-internal.h:205
(gdb) thread apply all bt

Thread 5 (Thread 0xb43fd280 (LWP 610)):
#0 0xb6bdd088 in futex_abstimed_wait_cancelable (private=0, abstime=0x0, expected=1,
futex_word=0xb696d384 <cecservice_notify_available_event+24>)
at ../sysdeps/unix/sysv/linux/futex-internal.h:205
#1 do_futex_wait (sem=sem@entry=0xb696d384 <cecservice_notify_available_event+24>,
abstime=0x0) at sem_waitcommon.c:115
#2 0xb6bdd1f4 in __new_sem_wait_slow (
sem=0xb696d384 <cecservice_notify_available_event+24>, abstime=0x0)
at sem_waitcommon.c:282
#3 0xb6953720 in cecservice_notify_func () from /opt/vc/lib/libbcm_host.so
#4 0xb63a5cb0 in vcos_thread_entry (arg=0xb696d398 <cecservice_notify_task>)
at /home/dom/projects/staging/userland/interface/vcos/pthreads/vcos_pthreads.c:144
#5 0xb6bd3494 in start_thread (arg=0xb43fd280) at pthread_create.c:486
#6 0xb673c578 in ?? () at ../sysdeps/unix/sysv/linux/arm/clone.S:73
from /lib/arm-linux-gnueabihf/libc.so.6
Backtrace stopped: previous frame identical to this frame (corrupt stack?)

Thread 4 (Thread 0xb4bfe280 (LWP 609)):
#0 0xb6bdd088 in futex_abstimed_wait_cancelable (private=0, abstime=0x0, expected=1,
futex_word=0xb696c5f4 <tvservice_notify_available_event+24>)
at ../sysdeps/unix/sysv/linux/futex-internal.h:205
#1 do_futex_wait (sem=sem@entry=0xb696c5f4 <tvservice_notify_available_event+24>,
abstime=0x0) at sem_waitcommon.c:115
#2 0xb6bdd1f4 in __new_sem_wait_slow (sem=0xb696c5f4 <tvservice_notify_available_event+24>,
abstime=0x0) at sem_waitcommon.c:282
#3 0xb69523b0 in tvservice_notify_func () from /opt/vc/lib/libbcm_host.so
#4 0xb63a5cb0 in vcos_thread_entry (arg=0xb696c608 <tvservice_notify_task>)
at /home/dom/projects/staging/userland/interface/vcos/pthreads/vcos_pthreads.c:144
#5 0xb6bd3494 in start_thread (arg=0xb4bfe280) at pthread_create.c:486
#6 0xb673c578 in ?? () at ../sysdeps/unix/sysv/linux/arm/clone.S:73
from /lib/arm-linux-gnueabihf/libc.so.6
Backtrace stopped: previous frame identical to this frame (corrupt stack?)

Thread 3 (Thread 0xb53ff280 (LWP 608)):
#0 0xb6bdd088 in futex_abstimed_wait_cancelable (private=0, abstime=0x0, expected=1,
futex_word=0xb696d480 <dispmanx_notify_available_event+24>)
at ../sysdeps/unix/sysv/linux/futex-internal.h:205
#1 do_futex_wait (sem=sem@entry=0xb696d480 <dispmanx_notify_available_event+24>,
abstime=0x0) at sem_waitcommon.c:115
#2 0xb6bdd1f4 in __new_sem_wait_slow (sem=0xb696d480 <dispmanx_notify_available_event+24>,
--Type <RET> for more, q to quit, c to continue without paging--c
abstime=0x0) at sem_waitcommon.c:282
#3 0xb69564d4 in dispmanx_notify_func () from /opt/vc/lib/libbcm_host.so
#4 0xb63a5cb0 in vcos_thread_entry (arg=0xb696e1c0 <dispmanx_notify_task>) at /home/dom/projects/staging/userland/interface/vcos/pthreads/vcos_pthreads.c:144
#5 0xb6bd3494 in start_thread (arg=0xb53ff280) at pthread_create.c:486
#6 0xb673c578 in ?? () at ../sysdeps/unix/sysv/linux/arm/clone.S:73 from /lib/arm-linux-gnueabihf/libc.so.6
Backtrace stopped: previous frame identical to this frame (corrupt stack?)

Thread 2 (Thread 0xb5d49280 (LWP 607)):
#0 0xb673451c in ioctl () at ../sysdeps/unix/syscall-template.S:78
#1 0xb63be010 in completion_thread () from /opt/vc/lib/libvchiq_arm.so
#2 0xb63a5cb0 in vcos_thread_entry (arg=0xb63d1318 <vchiq_instance+16>) at /home/dom/projects/staging/userland/interface/vcos/pthreads/vcos_pthreads.c:144
#3 0xb6bd3494 in start_thread (arg=0xb5d49280) at pthread_create.c:486
#4 0xb673c578 in ?? () at ../sysdeps/unix/sysv/linux/arm/clone.S:73 from /lib/arm-linux-gnueabihf/libc.so.6
Backtrace stopped: previous frame identical to this frame (corrupt stack?)

Thread 1 (Thread 0xb5d4a010 (LWP 596)):
#0 0xb6bdd088 in futex_abstimed_wait_cancelable (private=0, abstime=0x0, expected=1, futex_word=0xb69a7a58 <khrn_queue+76>) at ../sysdeps/unix/sysv/linux/futex-internal.h:205
#1 do_futex_wait (sem=sem@entry=0xb69a7a58 <khrn_queue+76>, abstime=0x0) at sem_waitcommon.c:115
#2 0xb6bdd1f4 in __new_sem_wait_slow (sem=0xb69a7a58 <khrn_queue+76>, abstime=0x0) at sem_waitcommon.c:282
#3 0xb63c0b60 in vchiu_queue_pop () from /opt/vc/lib/libvchiq_arm.so
#4 0xb6981014 in rpc_recv () from /opt/vc/lib/libbrcmEGL.so
#5 0xb69b0934 in glGetError () from /opt/vc/lib/libbrcmGLESv2.so
#6 0x0014f19c in ogl_upload_bitmap (bitmap=<optimized out>) at /home/pi/fruitbox_1.14base/build/allegro-5.2.5.0/src/opengl/ogl_bitmap.c:515
#7 0x00102134 in _al_create_bitmap_params (current_display=current_display@entry=0x2ce388, w=w@entry=512, h=h@entry=512, format=format@entry=2, flags=flags@entry=192, depth=depth@entry=0, samples=0) at /home/pi/fruitbox_1.14base/build/allegro-5.2.5.0/src/bitmap.c:164
#8 0x001021fc in al_create_bitmap (w=w@entry=512, h=512) at /home/pi/fruitbox_1.14base/build/allegro-5.2.5.0/src/bitmap.c:191
#9 0x000edfe0 in really_load_png (png_ptr=0x0, info_ptr=0x2c9198, flags=0, flags@entry=-1090522324) at /home/pi/fruitbox_1.14base/build/allegro-5.2.5.0/addons/image/png.c:204
#10 0x000ee710 in _al_load_png_f (fp=0xb6ff5890, flags=-1090522324) at /home/pi/fruitbox_1.14base/build/allegro-5.2.5.0/addons/image/png.c:394
#11 0x00092698 in DisplayClass::DisplayClass() ()
#12 0x000204e0 in main ()
(gdb)

Edgar Reynaldo
Major Reynaldo
May 2007
avatar

Can you wait longer before hitting Ctrl-C? Let it cogitate for 5 minutes, and then do it. Because your last backtrace was caught in al_load_png_f, and not egl_create_context.

But other than that, it looks like a classic deadlock. There are 4 threads all waiting on SOMETHING....

chundermike
Member #16,629
January 2017

Ok, thanks for persisting with this. This time, I waited 30 mins before hitting Ctrl-C...

pi@raspberrypi:~/fruitbox_1.14base $ gdb --args ./fruitbox --test-buttons
GNU gdb (Raspbian 8.2.1-2) 8.2.1
Copyright (C) 2018 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
Type "show copying" and "show warranty" for details.
This GDB was configured as "arm-linux-gnueabihf".
Type "show configuration" for configuration details.
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>.
Find the GDB manual and other documentation resources online at:
<http://www.gnu.org/software/gdb/documentation/>.

For help, type "help".
Type "apropos word" to search for commands related to "word"...
Reading symbols from ./fruitbox...done.
(gdb) run
Starting program: /home/pi/fruitbox_1.14base/fruitbox --test-buttons
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/arm-linux-gnueabihf/libthread_db.so.1".

fruitbox v1.15beta2 (Oct 10 2019, 20:11:59) by Mike Kingsley
A customisable MP3 Retro Jukebox for the Raspberry Pi.
[New Thread 0xb5d49280 (LWP 2009)]
[New Thread 0xb53ff280 (LWP 2010)]
[New Thread 0xb4bfe280 (LWP 2011)]
[New Thread 0xb43fd280 (LWP 2012)]
^C
Thread 1 "fruitbox" received signal SIGINT, Interrupt.
0xb6bdd088 in futex_abstimed_wait_cancelable (private=0, abstime=0x0, expected=1, futex_word=0xb69a7a58 <khrn_queue+76>) at ../sysdeps/unix/sysv/linux/futex-internal.h:205
205 ../sysdeps/unix/sysv/linux/futex-internal.h: No such file or directory.
(gdb) bt
#0 0xb6bdd088 in futex_abstimed_wait_cancelable (private=0, abstime=0x0, expected=1, futex_word=0xb69a7a58 <khrn_queue+76>) at ../sysdeps/unix/sysv/linux/futex-internal.h:205
#1 do_futex_wait (sem=sem@entry=0xb69a7a58 <khrn_queue+76>, abstime=0x0) at sem_waitcommon.c:115
#2 0xb6bdd1f4 in __new_sem_wait_slow (sem=0xb69a7a58 <khrn_queue+76>, abstime=0x0) at sem_waitcommon.c:282
#3 0xb63c0b60 in vchiu_queue_pop () from /opt/vc/lib/libvchiq_arm.so
#4 0xb6981014 in rpc_recv () from /opt/vc/lib/libbrcmEGL.so
#5 0xb69b0934 in glGetError () from /opt/vc/lib/libbrcmGLESv2.so
#6 0x0014f19c in ogl_upload_bitmap (bitmap=<optimized out>) at /home/pi/fruitbox_1.14base/build/allegro-5.2.5.0/src/opengl/ogl_bitmap.c:515
#7 0x00102134 in _al_create_bitmap_params (current_display=current_display@entry=0x2ce388, w=w@entry=512, h=h@entry=512, format=format@entry=2, flags=flags@entry=192,
depth=depth@entry=0, samples=0) at /home/pi/fruitbox_1.14base/build/allegro-5.2.5.0/src/bitmap.c:164
#8 0x001021fc in al_create_bitmap (w=w@entry=512, h=512) at /home/pi/fruitbox_1.14base/build/allegro-5.2.5.0/src/bitmap.c:191
#9 0x000edfe0 in really_load_png (png_ptr=0x0, info_ptr=0x2c9198, flags=0, flags@entry=-1090522324) at /home/pi/fruitbox_1.14base/build/allegro-5.2.5.0/addons/image/png.c:204
#10 0x000ee710 in _al_load_png_f (fp=0xb6ff5890, flags=-1090522324) at /home/pi/fruitbox_1.14base/build/allegro-5.2.5.0/addons/image/png.c:394
#11 0x00092698 in DisplayClass::DisplayClass() ()
#12 0x000204e0 in main ()
(gdb) info threads
Id Target Id Frame

  • 1 Thread 0xb5d4a010 (LWP 2005) "fruitbox" 0xb6bdd088 in futex_abstimed_wait_cancelable (private=0, abstime=0x0, expected=1, futex_word=0xb69a7a58 <khrn_queue+76>)

at ../sysdeps/unix/sysv/linux/futex-internal.h:205
2 Thread 0xb5d49280 (LWP 2009) "VCHIQ completio" 0xb673451c in ioctl () at ../sysdeps/unix/syscall-template.S:78
3 Thread 0xb53ff280 (LWP 2010) "HDispmanx Notif" 0xb6bdd088 in futex_abstimed_wait_cancelable (private=0, abstime=0x0, expected=1,
futex_word=0xb696d480 <dispmanx_notify_available_event+24>) at ../sysdeps/unix/sysv/linux/futex-internal.h:205
4 Thread 0xb4bfe280 (LWP 2011) "HTV Notify" 0xb6bdd088 in futex_abstimed_wait_cancelable (private=0, abstime=0x0, expected=1,
futex_word=0xb696c5f4 <tvservice_notify_available_event+24>) at ../sysdeps/unix/sysv/linux/futex-internal.h:205
5 Thread 0xb43fd280 (LWP 2012) "HCEC Notify" 0xb6bdd088 in futex_abstimed_wait_cancelable (private=0, abstime=0x0, expected=1,
futex_word=0xb696d384 <cecservice_notify_available_event+24>) at ../sysdeps/unix/sysv/linux/futex-internal.h:205
(gdb) thread apply all bt

Thread 5 (Thread 0xb43fd280 (LWP 2012)):
#0 0xb6bdd088 in futex_abstimed_wait_cancelable (private=0, abstime=0x0, expected=1, futex_word=0xb696d384 <cecservice_notify_available_event+24>)
at ../sysdeps/unix/sysv/linux/futex-internal.h:205
#1 do_futex_wait (sem=sem@entry=0xb696d384 <cecservice_notify_available_event+24>, abstime=0x0) at sem_waitcommon.c:115
#2 0xb6bdd1f4 in __new_sem_wait_slow (sem=0xb696d384 <cecservice_notify_available_event+24>, abstime=0x0) at sem_waitcommon.c:282
#3 0xb6953720 in cecservice_notify_func () from /opt/vc/lib/libbcm_host.so
#4 0xb63a5cb0 in vcos_thread_entry (arg=0xb696d398 <cecservice_notify_task>) at /home/dom/projects/staging/userland/interface/vcos/pthreads/vcos_pthreads.c:144
#5 0xb6bd3494 in start_thread (arg=0xb43fd280) at pthread_create.c:486
#6 0xb673c578 in ?? () at ../sysdeps/unix/sysv/linux/arm/clone.S:73 from /lib/arm-linux-gnueabihf/libc.so.6
Backtrace stopped: previous frame identical to this frame (corrupt stack?)

Thread 4 (Thread 0xb4bfe280 (LWP 2011)):
#0 0xb6bdd088 in futex_abstimed_wait_cancelable (private=0, abstime=0x0, expected=1, futex_word=0xb696c5f4 <tvservice_notify_available_event+24>)
at ../sysdeps/unix/sysv/linux/futex-internal.h:205
#1 do_futex_wait (sem=sem@entry=0xb696c5f4 <tvservice_notify_available_event+24>, abstime=0x0) at sem_waitcommon.c:115
#2 0xb6bdd1f4 in __new_sem_wait_slow (sem=0xb696c5f4 <tvservice_notify_available_event+24>, abstime=0x0) at sem_waitcommon.c:282
#3 0xb69523b0 in tvservice_notify_func () from /opt/vc/lib/libbcm_host.so
#4 0xb63a5cb0 in vcos_thread_entry (arg=0xb696c608 <tvservice_notify_task>) at /home/dom/projects/staging/userland/interface/vcos/pthreads/vcos_pthreads.c:144
#5 0xb6bd3494 in start_thread (arg=0xb4bfe280) at pthread_create.c:486
#6 0xb673c578 in ?? () at ../sysdeps/unix/sysv/linux/arm/clone.S:73 from /lib/arm-linux-gnueabihf/libc.so.6
Backtrace stopped: previous frame identical to this frame (corrupt stack?)

Thread 3 (Thread 0xb53ff280 (LWP 2010)):
#0 0xb6bdd088 in futex_abstimed_wait_cancelable (private=0, abstime=0x0, expected=1, futex_word=0xb696d480 <dispmanx_notify_available_event+24>)
at ../sysdeps/unix/sysv/linux/futex-internal.h:205
#1 do_futex_wait (sem=sem@entry=0xb696d480 <dispmanx_notify_available_event+24>, abstime=0x0) at sem_waitcommon.c:115
#2 0xb6bdd1f4 in __new_sem_wait_slow (sem=0xb696d480 <dispmanx_notify_available_event+24>, abstime=0x0) at sem_waitcommon.c:282
#3 0xb69564d4 in dispmanx_notify_func () from /opt/vc/lib/libbcm_host.so
#4 0xb63a5cb0 in vcos_thread_entry (arg=0xb696e1c0 <dispmanx_notify_task>) at /home/dom/projects/staging/userland/interface/vcos/pthreads/vcos_pthreads.c:144
#5 0xb6bd3494 in start_thread (arg=0xb53ff280) at pthread_create.c:486
#6 0xb673c578 in ?? () at ../sysdeps/unix/sysv/linux/arm/clone.S:73 from /lib/arm-linux-gnueabihf/libc.so.6
Backtrace stopped: previous frame identical to this frame (corrupt stack?)

Thread 2 (Thread 0xb5d49280 (LWP 2009)):
#0 0xb673451c in ioctl () at ../sysdeps/unix/syscall-template.S:78
#1 0xb63be010 in completion_thread () from /opt/vc/lib/libvchiq_arm.so
#2 0xb63a5cb0 in vcos_thread_entry (arg=0xb63d1318 <vchiq_instance+16>) at /home/dom/projects/staging/userland/interface/vcos/pthreads/vcos_pthreads.c:144
#3 0xb6bd3494 in start_thread (arg=0xb5d49280) at pthread_create.c:486
#4 0xb673c578 in ?? () at ../sysdeps/unix/sysv/linux/arm/clone.S:73 from /lib/arm-linux-gnueabihf/libc.so.6
Backtrace stopped: previous frame identical to this frame (corrupt stack?)

Thread 1 (Thread 0xb5d4a010 (LWP 2005)):
#0 0xb6bdd088 in futex_abstimed_wait_cancelable (private=0, abstime=0x0, expected=1, futex_word=0xb69a7a58 <khrn_queue+76>) at ../sysdeps/unix/sysv/linux/futex-internal.h:205
#1 do_futex_wait (sem=sem@entry=0xb69a7a58 <khrn_queue+76>, abstime=0x0) at sem_waitcommon.c:115
#2 0xb6bdd1f4 in __new_sem_wait_slow (sem=0xb69a7a58 <khrn_queue+76>, abstime=0x0) at sem_waitcommon.c:282
#3 0xb63c0b60 in vchiu_queue_pop () from /opt/vc/lib/libvchiq_arm.so
#4 0xb6981014 in rpc_recv () from /opt/vc/lib/libbrcmEGL.so
#5 0xb69b0934 in glGetError () from /opt/vc/lib/libbrcmGLESv2.so
#6 0x0014f19c in ogl_upload_bitmap (bitmap=<optimized out>) at /home/pi/fruitbox_1.14base/build/allegro-5.2.5.0/src/opengl/ogl_bitmap.c:515
#7 0x00102134 in _al_create_bitmap_params (current_display=current_display@entry=0x2ce388, w=w@entry=512, h=h@entry=512, format=format@entry=2, flags=flags@entry=192,
depth=depth@entry=0, samples=0) at /home/pi/fruitbox_1.14base/build/allegro-5.2.5.0/src/bitmap.c:164
#8 0x001021fc in al_create_bitmap (w=w@entry=512, h=512) at /home/pi/fruitbox_1.14base/build/allegro-5.2.5.0/src/bitmap.c:191
#9 0x000edfe0 in really_load_png (png_ptr=0x0, info_ptr=0x2c9198, flags=0, flags@entry=-1090522324) at /home/pi/fruitbox_1.14base/build/allegro-5.2.5.0/addons/image/png.c:204
#10 0x000ee710 in _al_load_png_f (fp=0xb6ff5890, flags=-1090522324) at /home/pi/fruitbox_1.14base/build/allegro-5.2.5.0/addons/image/png.c:394
#11 0x00092698 in DisplayClass::DisplayClass() ()
#12 0x000204e0 in main ()
(gdb)

Edgar Reynaldo
Major Reynaldo
May 2007
avatar

SiegeLord
Member #7,827
October 2006
avatar

How are you building Allegro, using the RPI backend or the regular linux one?

"For in much wisdom is much grief: and he that increases knowledge increases sorrow."-Ecclesiastes 1:18
[SiegeLord's Abode][Codes]:[DAllegro5]:[RustAllegro]

chundermike
Member #16,629
January 2017

Hi,

All the source code for the entire project is in:

https://github.com/chundermike/rpi-fruitbox/tree/master/build

The display constructor is in display.cpp. If you look at fruitbox.cpp lines 244 onwards you can see that I initialise Allegro (and check for success) before the display constructor is called and any assets are loaded.

I built the Allegro libraries using:

cmake .. -DCMAKE_TOOLCHAIN_FILE=../cmake/Toolchain-raspberrypi.cmake -DSHARED=off

(The complete build process is described in build.txt in the build directory on GitHub.)

Just to confirm, the exact same executable works absolutely fine on my Pi3 (and zero), including on Buster Lite. I basically took the SD card from my Pi4, stuck it in my Pi3 and fruitbox works perfectly, so would that rule out any config / OS issues? I'm not sure if the OS configures itself differently when detecting different hardware? The only thing I know is the that Pi4 uses a different Broadcom SoC to the Pi3 (ARM version and VideoCore version).

Again, thanks for your ongoing support.

Cheers,
Mike

Edgar Reynaldo
Major Reynaldo
May 2007
avatar

Well, to be specific, it's failing in ogl_upload_bitmap in src/opengl/ogl_bitmap.c:515 . It calls glGetError, which is not returning.

The only thing I can think of is rpi4 changed their GLES without telling anyone. Can you update your graphics drivers on a Raspberry Pi 4?

Also, can you try a purely Linux based build and see if it does the same thing?

chundermike
Member #16,629
January 2017

Ok...I'll look into updating my graphics drivers; to be honest haven't got a clue how to do that but I'll have a google.

Regarding pure linux version, I've successfully built and run it on my Ubuntu PC if that helps?

EDIT: I've done a bit of googling, and found this discussion...

https://www.raspberrypi.org/forums/viewtopic.php?f=68&t=243892&sid=8252e28d34347707d59e995b68290f68

...not sure it'll throw any light on the situation though? The second-to-last paragraph in this entry suggests initialisation may fail...

https://www.raspberrypi.org/forums/viewtopic.php?t=243892#p1489670

Edgar Reynaldo
Major Reynaldo
May 2007
avatar

SiegeLord
Member #7,827
October 2006
avatar

I obtained a RPI4 for testing, but waiting on an micro HDMI adapter to actually start doing so...

EDIT: Alright, I got the adapter and got Allegro installed. I went the newly recommended route: treat RPI as a regular Linux OS, so I didn't use the custom toolchain. Basically, everything that I tested worked fine (creating windows, fullscreen windows, audio with ALSA), so I think maybe it's just the dedicated Rpi backend that's not working.

"For in much wisdom is much grief: and he that increases knowledge increases sorrow."-Ecclesiastes 1:18
[SiegeLord's Abode][Codes]:[DAllegro5]:[RustAllegro]

chundermike
Member #16,629
January 2017

Thanks SiegeLord,

I tried building Allegro 5.2.5 for regular Linux (cmake .. -DSHARED=off), but it still doesn't work (get failure returned from al_get_display_mode(), which is subtly different to the original failure). That happens if I chose Legacy (non-GL) driver or GL (Fake KMS) driver.

Any chance you could provide a step-by-step build guide of what you exactly did? (sorry to be a pain)

EDIT: that was using Buster Lite...maybe Buster Desktop will work (If I understand correctly that uses X11??), so I'll try that...

EDIT2: So I tried it with Buster desktop and it works ok, so thanks very much for the help and support...much appreciated. However, I've got a few more questions now if that's ok...

1. What's the point of the Raspberry Pi cmake version if the plain Linux one works? Presumably it's something to do now with the fact that the Pi4 uses more standard Linux graphics drivers? (complete guess as it's not something I know much about).

2. Instead of building the allegro library from scratch, could I just do a "sudo-apt get allegro5-dev" as it seems that allegro is part of the Raspbian repository.

3. What can I do to get Allegro working in Buster Lite (i.e. without the desktop)? My app doesn't run particularly smoothly when the Pi is running the desktop. Presumably it's just a matter of installing the graphics libraries that are part of the desktop image and not included in the Lite version? If so, do you know what I need to install?

Many thanks again,
Mike

SiegeLord
Member #7,827
October 2006
avatar

Glad you got one working configuration!

What's the point of the Raspberry Pi cmake version if the plain Linux one works?

The dedicated RPI backend came before the plain Linux one worked, now it has limited use cases (maybe none?)

Quote:

Instead of building the allegro library from scratch, could I just do a "sudo-apt get allegro5-dev" as it seems that allegro is part of the Raspbian repository.

Yes, you can try it! It might be slightly outdated, but it's certainly worth trying.

Quote:

What can I do to get Allegro working in Buster Lite

That's my bad, I completely missed the 'Lite' part! I'll need to test this configuration and get back to you.

"For in much wisdom is much grief: and he that increases knowledge increases sorrow."-Ecclesiastes 1:18
[SiegeLord's Abode][Codes]:[DAllegro5]:[RustAllegro]

Edgar Reynaldo
Major Reynaldo
May 2007
avatar

{"name":"bump-w8-1.png","src":"\/\/djungxnpq2nug.cloudfront.net\/image\/cache\/5\/0\/5002f8c93a35d72afb281c89d8ef800f.png","w":500,"h":500,"tn":"\/\/djungxnpq2nug.cloudfront.net\/image\/cache\/5\/0\/5002f8c93a35d72afb281c89d8ef800f"}bump-w8-1.png

Rodolfo Lam
Member #16,045
August 2015

Does Raspbian Lite contain any graphics stack at all? You could try instead of using Raspbian Desktop, using a lightweight window manager with Raspbian Lite instead of a Desktop Environment. That way your application can start from an already initialized graphics stack.

chundermike
Member #16,629
January 2017

Allegro works fine with Raspian Stretch (and Jessie) Lite, so the problem is just with Buster Lite. The only difference I'm aware of with Buster is that they've changed all the graphics drivers...

SiegeLord
Member #7,827
October 2006
avatar

Another bump, this is still on the TODO list.

"For in much wisdom is much grief: and he that increases knowledge increases sorrow."-Ecclesiastes 1:18
[SiegeLord's Abode][Codes]:[DAllegro5]:[RustAllegro]

Go to: