Osmc on pi 3b+ sad face / Segmentation fault

I have osmc and a couple of other things (tvheadend, minidlna) running on a pi 3b+ which has been working fine for ages.

After a reboot, I got the sad face and it seems mediacenter is segfaulting.

Jan 25 21:44:07 raspiii mediacenter[550]: Mesa warning: failed to remap glInternalBufferSubDataCopyMESA
Jan 25 21:44:09 raspiii sudo[884]: pam_unix(sudo:session): session closed for user osmc
Jan 25 21:44:09 raspiii mediacenter[550]: /usr/bin/mediacenter: line 142:   884 Segmentation fault      sudo -u osmc LIRC_SOCKET_PATH=/var/run/lirc/lircd $KODI --standalone -fs
Jan 25 21:44:09 raspiii mediacenter[550]: Kodi exited with return code 139 after 0 hours, 0 minutes and 5 seconds

All apt packages are up-to-date.

I’ve tried with most of the USB devices (external storage / TV receiver) unplugged and I’ve also tried moving my ~/.kodi directory, but none of these seem to have made much difference.

Thanks in advance for any help (and for OSMC, which I’ve been using for quite a while!)

Logs: https://paste.osmc.tv/akugepemil

Might be not related but I see several occurances of

Yeah, I’ve noticed the under-voltage messages. I think they mostly stop once the system is booted, and I doubt they’d cause a segfault, but I don’t know for sure what is causing it so… yes. Maybe.

FWIW I managed to get a core dump from kodi and had a look at it with gdb:

Using host libthread_db library "/lib/arm-linux-gnueabihf/libthread_db.so.1".
Core was generated by `/usr/lib/kodi/kodi.bin'.
Program terminated with signal SIGSEGV, Segmentation fault.
#0  0x75fd198c in sc_reduce () from /usr/osmc/lib/libshairplay.so.0
[Current thread is 1 (Thread 0x722b3040 (LWP 21976))]
(gdb) bt
#0  0x75fd198c in sc_reduce () at /usr/osmc/lib/libshairplay.so.0
#1  0x08d7e05c in  ()

I’m not sure how useful that is.

I’ve also run kodi through strace, and noted that we see a log message saying the webserver has started on port 80, a syscall reading from /dev/urandom and then the segfault happens.

Again, not sure that’s actually very useful.

Surely would try with a proper power supply. Also Segfault could come from defect SD Card.

Tried with a different power supply, rated 2.5A

I still get under voltage with all of the peripherals plugged in, but it seems only during boot. Afterwards, everything else seems to work fine (tvheadend, minidlna, and I see no problems when ssh’ed in).

To eliminate the under voltage as a cause, I’ve booted with nothing plugged into USB.

No under voltage this time, but still the same mediacenter segmentation fault and sad face loop.

New logs: https://paste.osmc.tv/iyaxayilis

Is it a phone charger or a power supply? Also you can try a different USB cable.

Try new SD Card

It’s a proper power supply, not a phone charger. I think it was bought from pihut or similar, but don’t remember for sure.

I dd’ed everything onto a new SD card, but same problem as far as I can see.

New logs: https://paste.osmc.tv/wehajafayi

No under-voltage but mediacenter is still segfaulting.

~$ systemctl status mediacenter | tail -n4

Jan 27 11:40:23 raspiii mediacenter[502]: Mesa warning: failed to remap glInternalBufferSubDataCopyMESA
Jan 27 11:40:25 raspiii sudo[1550]: pam_unix(sudo:session): session closed for user osmc
Jan 27 11:40:25 raspiii mediacenter[502]: /usr/bin/mediacenter: line 142:  1550 Segmentation fault      sudo -u osmc LIRC_SOCKET_PATH=/var/run/lirc/lircd $KODI --standalone -fs
Jan 27 11:40:25 raspiii mediacenter[502]: Kodi exited with return code 139 after 0 hours, 0 minutes and 4 seconds

I might try and replace the relevant binaries from a clean install etc… but otherwise will try a new install of osmc and then set everything up again on top of it.

Curious why this suddenly started happening.

If your original SD hard had corruption caused by under-voltage then DDing it to a new card will also copy the corrupted files. I’d suggest a fresh install on the new SD card.