yoth
Posts: 2
Joined: Fri Mar 22, 2013 1:26 pm

FIXED: Repeatedly using EGL freezes VideoCore

Fri Mar 22, 2013 2:10 pm

Hi.
I created an application that uses EGL and I wondered why it freezes. Them problem lies with EGL. It can be reproduced with the following code:

Code: Select all

int main(int argc, char *argv[])
{
	EGLDisplay	display_ = EGL_NO_DISPLAY;

	bcm_host_init();

	display_ = eglGetDisplay(EGL_DEFAULT_DISPLAY);
	eglInitialize(display_, NULL, NULL);

	eglTerminate(display_);
	display_ = EGL_NO_DISPLAY;

	bcm_host_deinit();

	return 0;
}
I just call eglInitialize and eglTerminate repeatedly. EGL itself works properly but when I start that application around 5 to 100 times it freezes randomly at startup. The process cannot be killed (even with kill -9) and never returns.

Debugging shows that it hangs at:

Code: Select all

#0  0xb6d17b5c in ioctl () from /lib/libc.so.6
#1  0xb6f41908 in create_service.constprop.4 () from /usr/lib/libvchiq_arm.so
#2  0xb6f4404c in vchi_service_open () from /usr/lib/libvchiq_arm.so
#3  0xb6f53c84 in vc_vchi_gencmd_init () from /usr/lib/libbcm_host.so
#4  0xb6f5256c in bcm_host_init () from /usr/lib/libbcm_host.so
#5  0x00008660 in main (argc=<optimized out>, argv=<optimized out>) at egl_bug.cpp:17
Any ideas?

yoth


NOTE: Problem was fixed in https://github.com/raspberrypi/firmware/issues/185
Last edited by yoth on Mon Jul 15, 2013 11:02 am, edited 1 time in total.

pudding
Posts: 96
Joined: Sat Jan 12, 2013 3:55 pm
Location: UK

Re: Repeatedly using EGL freezes VideoCore

Mon May 27, 2013 6:01 pm

Yes I'm getting this occasionally. I haven't managed to debug this happening yet. Only way to get around it is to reboot.
Running 2013-02-09-wheezy with default kernel.

pudding
Posts: 96
Joined: Sat Jan 12, 2013 3:55 pm
Location: UK

Re: Repeatedly using EGL freezes VideoCore

Tue May 28, 2013 1:06 pm

Have you logged an issue on the official Raspberry Pi kernel dev site? They're very good on there at responding to issues.

https://github.com/raspberrypi/firmware

User avatar
paddyg
Posts: 2464
Joined: Sat Jan 28, 2012 11:57 am
Location: UK

Re: Repeatedly using EGL freezes VideoCore

Wed Jun 05, 2013 3:22 pm

Maybe we're (pi3d) having the same issue. We assumed it was a graphics memory leak due our (aka my) slack coding :D

https://groups.google.com/forum/?hl=en- ... 4PkC2bjvcM

I made a new SD card with the 2013-05-25 rasbian yesterday and I can't remember it hanging yet (I wasn't watching out for it) I will post here as soon (or if) it does.

Paddy
also https://groups.google.com/forum/?hl=en-GB&fromgroups=#!forum/pi3d

User avatar
paddyg
Posts: 2464
Joined: Sat Jan 28, 2012 11:57 am
Location: UK

Re: Repeatedly using EGL freezes VideoCore

Wed Jun 05, 2013 3:35 pm

I've just created and destroyed a Display (entailing the calls you make in your code snippet) a hundred times and reproduced the freezing so that answers my last point about the raspbian version.
also https://groups.google.com/forum/?hl=en-GB&fromgroups=#!forum/pi3d

FantasyDR
Posts: 4
Joined: Mon May 13, 2013 4:01 am

Re: Repeatedly using EGL freezes VideoCore

Sat Jun 08, 2013 11:32 am

Yes, I got the same issue. Application freezed after bcm_host_init() was called.
I could only reboot it...

User avatar
Jim Manley
Posts: 1600
Joined: Thu Feb 23, 2012 8:41 pm
Location: SillyCon Valley, California, and Powell, Wyoming, USA, plus The Universe
Contact: Website

Re: Repeatedly using EGL freezes VideoCore

Sun Jun 30, 2013 2:27 am

In the unlikely event anyone here interested isn't already plugged into the bugs list, this has been fixed ... and then some!

https://github.com/raspberrypi/firmware/issues/185

Requires an apt-get update in order to get the Pi's firmware to a new revision containing the fix.
The best things in life aren't things ... but, a Pi comes pretty darned close! :D
"Education is not the filling of a pail, but the lighting of a fire." -- W.B. Yeats
In theory, theory & practice are the same - in practice, they aren't!!!

User avatar
paddyg
Posts: 2464
Joined: Sat Jan 28, 2012 11:57 am
Location: UK

Re: Repeatedly using EGL freezes VideoCore

Fri Jul 05, 2013 11:24 pm

Jim, I found that the apt-get update didn't cut the mustard, it needed rpi-update
also https://groups.google.com/forum/?hl=en-GB&fromgroups=#!forum/pi3d

yoth
Posts: 2
Joined: Fri Mar 22, 2013 1:26 pm

Re: Repeatedly using EGL freezes VideoCore

Mon Jul 15, 2013 11:01 am

The problem is fixed in the new firmware.

Return to “OpenGLES”