Opened 8 years ago

Closed 7 years ago

Last modified 6 years ago

#12757 closed Bug Report - Crash (Fixed)

Raspberry pi: Seg Fault when running on Ubuntu Mate xenial

Reported by: Peter Bennett <pgbennett@…> Owned by: Peter Bennett
Priority: minor Milestone: unknown
Component: Ports - rPi Version: 0.28.0
Severity: high Keywords: raspberry pi
Cc: Ticket locked: no

Description

Running any of the MythTV GUI programs (mythfrontend, mythwelcome, myhtv-setup) on Ubuntu Mate xenial results in the follwoing log messages before the main window is displayed:

Unable to find an X11 visual which matches EGL config 20
Could not initialize OpenGL for RasterGLSurface, reverting to RasterSurface.
2016-04-28 14:13:10.555541 I  Using Frameless Window
2016-04-28 14:13:10.555581 I  Using Full Screen Window
Handling Segmentation fault
Segmentation fault (core dumped)

The back trace on the core dump is as follows:

Examining core dump with gdb gives this backtrace
Program terminated with signal SIGSEGV, Segmentation fault.
#0  0x7127314c in platform_get_handle () from /opt/vc/lib/libEGL.so
[Current thread is 1 (Thread 0x6e9e1000 (LWP 17607))]
(gdb) bt
#0  0x7127314c in platform_get_handle () from /opt/vc/lib/libEGL.so
#1  0x71268e80 in eglCreateWindowSurface () from /opt/vc/lib/libEGL.so
#2  0x6e7d89d2 in ?? () from /usr/lib/arm-linux-gnueabihf/qt5/plugins/xcbglintegrations/libqxcb-egl-integration.so
Backtrace stopped: previous frame identical to this frame (corrupt stack?)

These all work fine on ubuntu wily.

I am looking into this, but I am hampered by the fact that gdb is not working on raspberry pi xenial: https://bugs.launchpad.net/bugs/1576432

This will take me some time to figure out.

Change History (8)

comment:1 Changed 8 years ago by Peter Bennett <pgbennett@…>

In Raspberry pi ubuntu xenial there are two copies of libGLESv2.so

/opt/vc/lib/libGLESv2.so
/usr/lib/arm-linux-gnueabihf/mesa-egl/libGLESv2.so

The one in /opt/vc/lib/ causes a segfault when the qt show() function is called. The workaround for this is change the invocation of mythfrontend to the following command line

env LD_LIBRARY_PATH=/usr/lib/arm-linux-gnueabihf/mesa-egl /usr/bin/mythfrontend

I tried various ways to build the application so that it will use the correct libGLESv2.so without an explicit LD_LIBRARY_PATH but it looks like that would require changes in many files. This does not apply to Raspbian, it also has two copies of that library but works fine with the one in /opt/vc/lib.

I tried creating a simple qt program that shows a window and does nothing else. If I link it with the openmax library (/opt/vc/lib/libopenmaxil.so), it crashes wuth this same seg fault. If I do not link that library it works. So the problem is not some bug in MythTV, it occurs with a QT GUI program if you just link in the openmax library (which is required for MythTV), unless you use the LD_LIBRARY_PATH override.

comment:2 Changed 8 years ago by Karl Egly

Component: MythTV - GeneralPorts - rPi

comment:3 Changed 8 years ago by Peter Bennett

Owner: set to Peter Bennett
Status: newaccepted

comment:4 Changed 8 years ago by Peter Bennett

Resolution: Fixed
Status: acceptedclosed

Fixed in commit 4852d9c93. A fix in the .pro files for 3 GUI programs changes the way it is linked so as to pull in the correct libraries.

comment:5 Changed 7 years ago by eliteforce82nd@…

The workaround or fix is no longer working in Xubuntu arm 16.04.2 using kernel 4.9.30-v7+ setting env no longer fixes it and the libegl are ln -s correctly in /usr/lib/arm-linux-gnueabihf/mesa-egl

-rw-r--r-- 1 root root     38 Jan 25 19:36 ld.so.conf
lrwxrwxrwx 1 root root     15 Jan 25 19:36 libEGL.so -> libEGL.so.1.0.0
lrwxrwxrwx 1 root root     15 Jan 25 19:36 libEGL.so.1 -> libEGL.so.1.0.0
-rw-r--r-- 1 root root 126516 Jan 25 19:37 libEGL.so.1.0.0
lrwxrwxrwx 1 root root     18 Jan 25 19:36 libGLESv2.so -> libGLESv2.so.2.0.0
lrwxrwxrwx 1 root root     18 Jan 25 19:36 libGLESv2.so.2 -> libGLESv2.so.2.0.0
-rw-r--r-- 1 root root  29996 Jan 25 19:37 libGLESv2.so.2.0.0

The error is the same

pvr@pvr-pi4:~$ env LD_LIBRARY_PATH=/usr/lib/arm-linux-gnueabihf/mesa-egl /usr/local/bin/mythfrontend
2017-06-08 04:13:59.667313 I  Setup Interrupt handler
2017-06-08 04:13:59.667399 I  Setup Terminated handler
2017-06-08 04:13:59.667423 I  Setup Segmentation fault handler
2017-06-08 04:13:59.667568 I  Setup Aborted handler
2017-06-08 04:13:59.667592 I  Setup Bus error handler
2017-06-08 04:13:59.667619 I  Setup Floating point exception handler
2017-06-08 04:13:59.667640 I  Setup Illegal instruction handler
2017-06-08 04:13:59.667670 I  Setup Real-time signal 0 handler
2017-06-08 04:13:59.667700 I  Setup User defined signal 1 handler
2017-06-08 04:13:59.667732 I  Setup User defined signal 2 handler
2017-06-08 04:13:59.667754 I  Setup Hangup handler
2017-06-08 04:13:59.668059 C  mythfrontend version: fixes/0.28 [v0.28.1-31-g98550be] www.mythtv.org
2017-06-08 04:13:59.668087 C  Qt version: compile: 5.5.1, runtime: 5.5.1
2017-06-08 04:13:59.668099 N  Enabled verbose msgs:  general
2017-06-08 04:13:59.668149 N  Setting Log Level to LOG_INFO
2017-06-08 04:13:59.679329 I  Added logging to the console
2017-06-08 04:13:59.679366 N  Using runtime prefix = /usr/local
2017-06-08 04:13:59.679379 N  Using configuration directory = /home/pvr/.mythtv
2017-06-08 04:13:59.679574 I  Assumed character encoding: en_US.UTF-8
2017-06-08 04:13:59.680793 N  Empty LocalHostName.
2017-06-08 04:13:59.680813 I  Using localhost value of pvr-pi4
2017-06-08 04:13:59.697874 I  Testing network connectivity to '192.168.0.120'
2017-06-08 04:13:59.698556 I  Starting process manager
2017-06-08 04:13:59.701470 I  Starting process signal handler
2017-06-08 04:13:59.702107 I  Starting IO manager (read)
2017-06-08 04:13:59.702334 I  Starting IO manager (write)
2017-06-08 04:13:59.765241 N  Setting QT default locale to en_US
2017-06-08 04:13:59.765286 I  Current locale en_US
2017-06-08 04:13:59.765439 N  Reading locale defaults from /usr/local/share/mythtv//locales/en_us.xml
2017-06-08 04:13:59.855030 I  ScreenSaverX11Private: DPMS is disabled.
2017-06-08 04:14:00.002160 E  X11 ModeLine query returned zeroes
2017-06-08 04:14:00.002633 N  Desktop video mode: 1680x1050 60.000 Hz
2017-06-08 04:14:00.084459 I  Listening on TCP 127.0.0.1:6547
2017-06-08 04:14:00.084603 I  Listening on TCP 192.168.0.88:6547
2017-06-08 04:14:00.084693 I  Listening on TCP [::1]:6547
2017-06-08 04:14:00.084956 I  Listening on TCP [fe80::98ec:c7fd:2e0c:2407%enxb827eb0fba70]:6547
2017-06-08 04:14:02.142165 I  Loading en_us translation for module mythfrontend
2017-06-08 04:14:02.208379 E  LIRC: Failed to connect to Unix socket '/var/run/lirc/lircd'
                        eno: No such file or directory (2)
2017-06-08 04:14:02.208550 I  No joystick configuration found, not enabling joystick control
2017-06-08 04:14:02.405402 E  CECAdapter: Failed to find any CEC devices.
2017-06-08 04:14:02.905783 I  CECAdapter: Closing down CEC.
2017-06-08 04:14:02.905880 I  UDPListener: Enabling
2017-06-08 04:14:02.908455 I  Binding to UDP 127.0.0.1:6948
2017-06-08 04:14:02.908559 I  Binding to UDP 192.168.0.88:6948
2017-06-08 04:14:02.908655 I  Binding to UDP [::1]:6948
2017-06-08 04:14:02.908817 I  Binding to UDP [fe80::98ec:c7fd:2e0c:2407%enxb827eb0fba70]:6948
2017-06-08 04:14:02.908930 I  Binding to UDP 192.168.0.255:6948
Unable to find an X11 visual which matches EGL config 20
Could not initialize OpenGL for RasterGLSurface, reverting to RasterSurface.
2017-06-08 04:14:03.050571 I  Using Frameless Window
2017-06-08 04:14:03.050599 I  Using Full Screen Window
Handling Segmentation fault
Segmentation fault

This is using mythbuntu ppa and compiling from git 0.28/fixes.

comment:6 Changed 7 years ago by Peter Bennett

Resolution: Fixed
Status: closednew

comment:7 Changed 7 years ago by Peter Bennett

Resolution: Fixed
Status: newclosed

This should have been fixed with Stretch fixes. See #13110 for details.

comment:8 Changed 6 years ago by Peter Bennett

Owner: changed from Peter Bennett to Peter Bennett
Note: See TracTickets for help on using tickets.