Phosh often catches SIGSEGV when Librem 5 connected to external display

Hi,

I am currently trying to make Librem 5 work reliably with an external display. It appears that there are numerous problems which can make this feature somewhat unusable. These are some other problems I stumbled upon: Librem 5: Unexpected hard resets when on high load, How to preconfigure default settings for external display?.

This time I noticed that Phosh often crashes with SIGSEGV when an external display is connected. As this seems like (mostly) a software problem, I am posting it in this forum branch. Here are some logs taken with journalctl -S 18:00 -U 18:44 --grep 'phoc|phosh':

Jun 21 18:06:53 pureos kernel: etnaviv-gpu 38000000.gpu: offending task: phoc (/usr/bin/phoc -S -C /usr/share/phosh/phoc.ini -E bash -lc 'gnome-session --disable-acceleration-check --session=phosh --builtin')
Jun 21 18:09:09 pureos kernel: etnaviv-gpu 38000000.gpu: offending task: phoc (/usr/bin/phoc -S -C /usr/share/phosh/phoc.ini -E bash -lc 'gnome-session --disable-acceleration-check --session=phosh --builtin')
Jun 21 18:09:10 pureos kernel: etnaviv-gpu 38000000.gpu: offending task: phoc (/usr/bin/phoc -S -C /usr/share/phosh/phoc.ini -E bash -lc 'gnome-session --disable-acceleration-check --session=phosh --builtin')
Jun 21 18:09:10 pureos kernel: etnaviv-gpu 38000000.gpu: offending task: phoc (/usr/bin/phoc -S -C /usr/share/phosh/phoc.ini -E bash -lc 'gnome-session --disable-acceleration-check --session=phosh --builtin')
Jun 21 18:17:04 pureos kernel: etnaviv-gpu 38000000.gpu: offending task: phoc (/usr/bin/phoc -S -C /usr/share/phosh/phoc.ini -E bash -lc 'gnome-session --disable-acceleration-check --session=phosh --builtin')
Jun 21 18:17:05 pureos kernel: etnaviv-gpu 38000000.gpu: offending task: phoc (/usr/bin/phoc -S -C /usr/share/phosh/phoc.ini -E bash -lc 'gnome-session --disable-acceleration-check --session=phosh --builtin')
Jun 21 18:17:06 pureos kernel: etnaviv-gpu 38000000.gpu: offending task: phoc (/usr/bin/phoc -S -C /usr/share/phosh/phoc.ini -E bash -lc 'gnome-session --disable-acceleration-check --session=phosh --builtin')
Jun 21 18:17:06 pureos kernel: etnaviv-gpu 38000000.gpu: offending task: phoc (/usr/bin/phoc -S -C /usr/share/phosh/phoc.ini -E bash -lc 'gnome-session --disable-acceleration-check --session=phosh --builtin')
Jun 21 18:30:30 pureos kernel: etnaviv-gpu 38000000.gpu: offending task: phoc (/usr/bin/phoc -S -C /usr/share/phosh/phoc.ini -E bash -lc 'gnome-session --disable-acceleration-check --session=phosh --builtin')
Jun 21 18:38:57 pureos phoc[1024]: invalid unclassed pointer in cast to 'PhocOutput'
Jun 21 18:38:57 pureos phoc[1024]: invalid unclassed pointer in cast to 'PhocOutput'
Jun 21 18:38:57 pureos phoc[1024]: invalid unclassed pointer in cast to 'PhocOutput'
Jun 21 18:38:57 pureos phosh[1343]: phosh_monitor_is_configured: assertion 'PHOSH_IS_MONITOR (self)' failed
Jun 21 18:42:37 pureos phoc[1024]: invalid unclassed pointer in cast to 'PhocOutput'
Jun 21 18:42:37 pureos phoc[1024]: invalid unclassed pointer in cast to 'PhocOutput'
Jun 21 18:42:37 pureos phoc[1024]: invalid unclassed pointer in cast to 'PhocOutput'
Jun 21 18:42:39 pureos phosh[1343]: phosh_monitor_is_configured: assertion 'PHOSH_IS_MONITOR (self)' failed
Jun 21 18:42:49 pureos phoc[1024]: invalid unclassed pointer in cast to 'PhocOutput'
Jun 21 18:42:49 pureos phoc[1024]: invalid unclassed pointer in cast to 'PhocOutput'
Jun 21 18:42:49 pureos phoc[1024]: invalid unclassed pointer in cast to 'PhocOutput'
Jun 21 18:42:50 pureos phosh[1343]: phosh_monitor_is_configured: assertion 'PHOSH_IS_MONITOR (self)' failed
Jun 21 18:42:55 pureos systemd[1]: phosh.service: Main process exited, code=killed, status=11/SEGV
Jun 21 18:42:55 pureos systemd[1]: phosh.service: Failed with result 'signal'.
Jun 21 18:43:00 pureos systemd[1]: phosh.service: Scheduled restart job, restart counter is at 1.
Jun 21 18:43:00 pureos systemd[1]: Stopped Phosh, a shell for mobile phones.
Jun 21 18:43:01 pureos systemd[1]: Started Phosh, a shell for mobile phones.

It happens on PureOS Byzantium. Is there anyone else who experiences this? Is it a bug in Phosh which appears indiscriminately, or is it triggered by an unfortunate combination of hardware?

I have also tried to run memtester to check RAM, but it tells that everything is fine.

2 Likes

Is it a bug in Phosh which appears indiscriminately, or is it triggered by an unfortunate combination of hardware?

If there is a SIGSEGV crash then there is no excuse, that should not happen for any hardware. Please try to hold on to the case you have and note precisely how you can reproduce the crash, so that the bug(s) can be found and fixed.

I think one thing you could do to get more info about what is happening is to run phosh through the gdb debugger and make it print a stacktrace when the crash happens.

Not sure exactly how but I think it could be done wither by starting phosh via gdb from the commandline, or else by editing the script (or the.service file) from which the phosh executable is started.

Then, instead of only the line saying phosh.service: Main process exited, code=killed, status=11/SEGV you would get a whole stacktrace showing at which place in the source code the crash happened.

Pinging @guido.gunther in case he has time to help.

2 Likes