Bug 4603

Summary: zsnes always segfaults on SSE4.2-capable CPU running fedora 26
Product: Fedora Reporter: Gary Gatling <gsgatlin>
Component: zsnesAssignee: Andrea Musuruane <musuruan>
Status: RESOLVED UPSTREAM    
Severity: normal CC: dominik, mtasaka
Priority: P1    
Version: 26   
Hardware: x86_64   
OS: GNU/Linux   
namespace:
Attachments: backtrace
full backtrace
Working cpuinfo
Working /etc/pulse/client.conf

Description Gary Gatling 2017-07-21 22:05:40 CEST
zsnes always segfaults on any fedora 26 boxes I try to run it on. It works fine on fedora 25 however. Doesn't seem to matter if OS is i686 or x86_64.

The error text is:

Use ZSNES -? for command line definitions.

Starting Mouse detection.
Unable to poll /dev/input/event14. Make sure you have read permissions to it.
Unable to poll /dev/input/event13. Make sure you have read permissions to it.
Unable to poll /dev/input/event12. Make sure you have read permissions to it.
Unable to poll /dev/input/event11. Make sure you have read permissions to it.
Unable to poll /dev/input/event10. Make sure you have read permissions to it.
Unable to poll /dev/input/event9. Make sure you have read permissions to it.
Unable to poll /dev/input/event8. Make sure you have read permissions to it.
Unable to poll /dev/input/event7. Make sure you have read permissions to it.
Unable to poll /dev/input/event6. Make sure you have read permissions to it.
Unable to poll /dev/input/event5. Make sure you have read permissions to it.
Unable to poll /dev/input/event4. Make sure you have read permissions to it.
Unable to poll /dev/input/event3. Make sure you have read permissions to it.
Unable to poll /dev/input/event2. Make sure you have read permissions to it.
Unable to poll /dev/input/event1. Make sure you have read permissions to it.
Unable to poll /dev/input/event0. Make sure you have read permissions to it.
ManyMouse: 0 mice detected.
Segmentation fault (core dumped)


Let me know if there is further info I can provide? Thanks.
Comment 1 Andrea Musuruane 2017-08-16 10:29:18 CEST
Sorry for the late answer, but I've just upgraded to F26.

Anyway, I can't reproduce this bug. I installed ZSNES from scratch and it is fine on my x86_64 system. 

Please include the output of:
$ rpm -q zsnes

A stack trace would be helpful.
https://fedoraproject.org/wiki/StackTraces

BTW, do you have pulseaudio enabled right?
Comment 2 Gary Gatling 2017-08-16 16:06:57 CEST
Created attachment 1833 [details]
backtrace

backtrace
Comment 3 Gary Gatling 2017-08-16 16:07:28 CEST
Created attachment 1834 [details]
full backtrace

full backtrace
Comment 4 Gary Gatling 2017-08-16 16:11:39 CEST
Hello.

[root@y470b ~]# rpm -q zsnes
zsnes-1.51-17.fc26.i686


I am pretty sure pulse audio is enabled and working. The sound effects work in web browser, desktop, and games. I did not change anything. Using MATE desktop spin on lenovo ideapad 470. Fresh fedora 26 install. (Did not upgrade from fedora 25)

pactl list

gives a lot of output.  I tried running zsnes in a kvm vm but it also crashed. It did work in fedora 25 so I'm not sure what could have changed.
Comment 5 Andrea Musuruane 2017-08-17 17:19:29 CEST
Try running zsnes with different -ad options.

E.g.:
zsnes -ad sdl

You can find possible value running zsnes --help.
Comment 6 Gary Gatling 2017-08-18 15:20:00 CEST
Hmnn. It still crashes even if I use

zsnes -ad null

or any of the other -ad options. I tried them all.

I thought it would be a more widespread problem but maybe its just my machines and my virtual machines if its working on your computer.
Comment 7 Dominik 'Rathann' Mierzejewski 2017-08-20 02:16:00 CEST
Reproducible on my machine, Intel Core i7-4500U (Haswell), also crashes in __strspn_sse42 from glibc called from pa_config_parse.

It gets a bit further if I use -ad null, but still crashes in __strspn_sse42 called from pa_config_parse. I'm beginning to suspect pulseaudio/glibc bug on i686.
Comment 8 Andrea Musuruane 2017-08-20 09:44:44 CEST
Created attachment 1842 [details]
Working cpuinfo
Comment 9 Andrea Musuruane 2017-08-20 09:45:35 CEST
Created attachment 1843 [details]
Working /etc/pulse/client.conf
Comment 10 Andrea Musuruane 2017-08-20 09:46:47 CEST
Dominik, thanks for your support. 

I attached my /proc/cpuinfo and my /etc/pulse/client.conf.
Comment 11 Mamoru TASAKA 2017-08-20 11:40:39 CEST
Perhaps https://bugzilla.redhat.com/show_bug.cgi?id=1471427
Comment 12 Dominik 'Rathann' Mierzejewski 2017-08-21 16:50:05 CEST
(In reply to Andrea Musuruane from comment #8)
> Created attachment 1842 [details]
> Working cpuinfo

As I expected, your CPU doesn't support SSE4.2, so the __strspn_sse42 doesn't get used.
Comment 13 Dominik 'Rathann' Mierzejewski 2017-08-21 16:50:31 CEST
(In reply to Mamoru TASAKA from comment #11)
> Perhaps https://bugzilla.redhat.com/show_bug.cgi?id=1471427

It looks relevant, I'll try to test it tonight.
Comment 14 Dominik 'Rathann' Mierzejewski 2017-08-23 09:52:26 CEST
glibc-2.25-8.fc26 seems to fix the crash on my machine. zsnes still freezes when I click exit in the menu, but that's a different bug.
Comment 15 Andrea Musuruane 2017-08-23 11:24:19 CEST
@Gary, can you please update to glibc-2.25-8.fc26 to see if it fix the problem for you too?
Comment 16 Gary Gatling 2017-08-24 15:42:56 CEST
glibc-2.25-8.fc26  updated and it no longer segfaults. Now it crashes on "Exit" menu selection. 

Should I open a new ticket with backtrace? Or is there already a ticket about that? Thanks so much.
Comment 17 Andrea Musuruane 2017-08-25 09:49:44 CEST
(In reply to Gary Gatling from comment #16)
> glibc-2.25-8.fc26  updated and it no longer segfaults. Now it crashes on
> "Exit" menu selection. 
> 
> Should I open a new ticket with backtrace? Or is there already a ticket
> about that? Thanks so much.

Yes please. Open a new bug report and attach a backtrace. 

Again, I have not the same behaviour on my PC. zsnes exits fine with a) game -> quit menu b) X menu c) X on the window.
Comment 18 Mamoru TASAKA 2018-09-28 17:33:53 CEST
(In reply to Dominik 'Rathann' Mierzejewski from comment #14)
> glibc-2.25-8.fc26 seems to fix the crash on my machine. zsnes still freezes
> when I click exit in the menu, but that's a different bug.

I see zsnes freeze for a long time and now I tried debugging, bug 5036