[Linux] Zsnes segfaults when attempting to save state

Found a bug? Please report it, but remember to follow the bug reporting guidelines.
Missing a sane feature? Let us know!
But please do NOT request ports to other systems.

Moderator: ZSNES Mods

Post Reply
CommonOddity
New Member
Posts: 7
Joined: Sun Feb 10, 2013 4:34 pm

[Linux] Zsnes segfaults when attempting to save state

Post by CommonOddity »

Hey folks,

Linux myhostname 3.4.11-2.16-desktop
OpenSuSE 12.2
Cinnamon on top of out-of-the-box Gnome (with updates from repo, obv)
zsnes-1.51-7.86.i586 from the OpenSuSE factory repo

Whenever I attempt to save a state zsnes segfaults. There's no further console output so I don't really have much to go on. I know that this latest build was configured to turn libao support off as apparently this was previously causing segfaults. I'm at my wit's end as I'm not sure how to dig up any further information. Has anyone else ran across this issue? I left a post in the OpenSuSE forums asking someone else to confirm that this isn't affecting only me but no one has responded yet (I'll update the thread accordingly).

Is there a way to pinpoint the issue? Is it known? Can I do anything to help?
grinvader
ZSNES Shake Shake Prinny
Posts: 5632
Joined: Wed Jul 28, 2004 4:15 pm
Location: PAL50, dood !

Re: [Linux] Zsnes segfaults when attempting to save state

Post by grinvader »

CommonOddity wrote:Is there a way to pinpoint the issue?
Try getting a backtrace.
Is it known?
Can't say it is.
Can I do anything to help?
If you're a dejected billionnaire with a heart of gold, I'm sure we can come up with something.
皆黙って俺について来い!!

Code: Select all

<jmr> bsnes has the most accurate wiki page but it takes forever to load (or something)
Pantheon: Gideon Zhi | CaitSith2 | Nach | kode54
CommonOddity
New Member
Posts: 7
Joined: Sun Feb 10, 2013 4:34 pm

Re: [Linux] Zsnes segfaults when attempting to save state

Post by CommonOddity »

Err, how do I get a backtrace? Sorry, I'm not tremendously savvy with debugging. I tried running zsnes with -d, but I imagine this requires the build to be slapped together with debugging configured/turned on, yes?

Tried looking around for a way to do this, but so far I am stumped.
grinvader
ZSNES Shake Shake Prinny
Posts: 5632
Joined: Wed Jul 28, 2004 4:15 pm
Location: PAL50, dood !

Re: [Linux] Zsnes segfaults when attempting to save state

Post by grinvader »

Aww, not a billionaire.


Running zsnes with -d runs the SNES debugger (a DOS port feature), which is not what you want here.

First just run zsnes through a debugger like gdb or insight or similar. When it crashes, the debugger will let you get a backtrace (check the documentation of the one you're using).
This is best done with a zsnes compiled with debug flags enabled, but doing that is another can of worms.
皆黙って俺について来い!!

Code: Select all

<jmr> bsnes has the most accurate wiki page but it takes forever to load (or something)
Pantheon: Gideon Zhi | CaitSith2 | Nach | kode54
CommonOddity
New Member
Posts: 7
Joined: Sun Feb 10, 2013 4:34 pm

Re: [Linux] Zsnes segfaults when attempting to save state

Post by CommonOddity »

Well, not quite a billionaire. I am definitely willing to make a humble donation though. You guys have kicked a lot of ass over the years and I got my SNES fix with Zsnes plenty of times :)

So I did run this against gdb, and indeed, debugging flags were disabled in this build:

Code: Select all

name@hostname:~/Desktop> gdb zsnes
GNU gdb (GDB) SUSE (7.4.50.20120603-2.1.2)
Copyright (C) 2012 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.  Type "show copying"
and "show warranty" for details.
This GDB was configured as "i586-suse-linux".
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>...
Reading symbols from /usr/bin/zsnes...(no debugging symbols found)...done.
(gdb) run
Starting program: /usr/bin/zsnes 
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/libthread_db.so.1".
ZSNES v1.51, (c) 1997-2007, ZSNES Team
Be sure to check http://www.zsnes.com/ for the latest version.

ZSNES is written by the ZSNES Team (See AUTHORS.TXT)
ZSNES comes with ABSOLUTELY NO WARRANTY.  This is free software,
and you are welcome to redistribute it under certain conditions;
please read 'LICENSE.TXT' thoroughly before doing so.

Use ZSNES -? for command line definitions.

Starting Mouse detection.
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.
Unable to poll /dev/input/event18. Make sure you have read permissions to it.
Unable to poll /dev/input/event17. Make sure you have read permissions to it.
Unable to poll /dev/input/event16. Make sure you have read permissions to it.
Unable to poll /dev/input/event15. Make sure you have read permissions to it.
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.
ManyMouse: 0 mice detected.
[New Thread 0xb4fe3b40 (LWP 22362)]
[New Thread 0xaf6fcb40 (LWP 22364)]
[Thread 0xaf6fcb40 (LWP 22364) exited]
[New Thread 0xaf6fcb40 (LWP 22365)]

Audio Opened.
Driver: Simple DirectMedia Layer output
Channels: 2
Rate: 44100

Device 0 Generic X-Box pad
  6 axis, 11 buttons, 1 hats, 0 balls
[New Thread 0xaecffb40 (LWP 22366)]

Program received signal SIGSEGV, Segmentation fault.
0x0826712a in ?? ()
Missing separate debuginfos, use: zypper install zsnes-debuginfo-1.51-7.86.i586
Welp, time to take a look at all the build deps... Thanks for the help/direction so far grim. I'll see if I can get you some proper info here soon.
grinvader
ZSNES Shake Shake Prinny
Posts: 5632
Joined: Wed Jul 28, 2004 4:15 pm
Location: PAL50, dood !

Re: [Linux] Zsnes segfaults when attempting to save state

Post by grinvader »

Typing 'bt' at the crash point will give you the trace.
皆黙って俺について来い!!

Code: Select all

<jmr> bsnes has the most accurate wiki page but it takes forever to load (or something)
Pantheon: Gideon Zhi | CaitSith2 | Nach | kode54
paulguy
Zealot
Posts: 1076
Joined: Sat Jul 02, 2005 2:01 am
Contact:

Re: [Linux] Zsnes segfaults when attempting to save state

Post by paulguy »

Did you try doing what it said to do in the last line? You probably don't need to build it. Looks like you can download the debug info separately.
Maybe these people were born without that part of their brain that lets you try different things to see if they work better. --Retsupurae
CommonOddity
New Member
Posts: 7
Joined: Sun Feb 10, 2013 4:34 pm

Re: [Linux] Zsnes segfaults when attempting to save state

Post by CommonOddity »

Ugh. This is slightly frustrating.

When I run zsnes outside gdb and I attempt to save a state, it simply crashes and quits. However, when I do run zsnes from gdb it crashes and hangs (which I imagine is expected per gdb) and I can't input "bt" to get a proper backtrace for you folks. I'll fiddle around with this again when I have more time but right now my brain is mush from stabbing away at this.
CommonOddity
New Member
Posts: 7
Joined: Sun Feb 10, 2013 4:34 pm

Re: [Linux] Zsnes segfaults when attempting to save state

Post by CommonOddity »

Finally since I had a little more time, I attempted to provide something a little more useful, however:

Code: Select all

Program received signal SIGSEGV, Segmentation fault.
0x082982bc in ?? ()
(gdb) bt
#0  0x082982bc in ?? ()
#1  0x080817dd in ?? ()
#2  0x08081b87 in ?? ()
#3  0x08164329 in ?? ()
Backtrace stopped: previous frame inner to this frame (corrupt stack?)
After attempting this twice in a row, this is all the output I got from the backtrace. I can't seem to get anything aside for this. Is there anything else I could provide/attempt to help flesh out the issue? I really hope that save states will work on Linux again. I usually play my games legit but it's a bummer when I gotta dash out and the pc needs to shutdown and there's no save point.

Edit: Also, I am still looking to find the debug rpm for this. I imagine that would give some more meaningful output.
grinvader
ZSNES Shake Shake Prinny
Posts: 5632
Joined: Wed Jul 28, 2004 4:15 pm
Location: PAL50, dood !

Re: [Linux] Zsnes segfaults when attempting to save state

Post by grinvader »

Yeah, the trace looks like that because the crash happens somewhere missing debug symbols.
Was worth a shot anyway, but you'll have to run a version compiled with the debug flag for something helpful.
皆黙って俺について来い!!

Code: Select all

<jmr> bsnes has the most accurate wiki page but it takes forever to load (or something)
Pantheon: Gideon Zhi | CaitSith2 | Nach | kode54
CommonOddity
New Member
Posts: 7
Joined: Sun Feb 10, 2013 4:34 pm

Re: [Linux] Zsnes segfaults when attempting to save state

Post by CommonOddity »

Thanks for the help and guidance- I'm learning a fair amount by doing this.

Just curious Grim, is the debuginfo rpm even required if zsnes is being compiled from scratch with debug turned on? I imagine it wouldn't be.
grinvader
ZSNES Shake Shake Prinny
Posts: 5632
Joined: Wed Jul 28, 2004 4:15 pm
Location: PAL50, dood !

Re: [Linux] Zsnes segfaults when attempting to save state

Post by grinvader »

A binary RPM would save you the hassle of compiling yourself, because sadly due to the lack of maintenance zsnes is pretty bitchy to compile nowadays. Compilers and libs have evolved and a lot of cruft makes it really, really tedious.

Although I have no idea if that package is really what you want, it sounds like it is at least.
皆黙って俺について来い!!

Code: Select all

<jmr> bsnes has the most accurate wiki page but it takes forever to load (or something)
Pantheon: Gideon Zhi | CaitSith2 | Nach | kode54
CommonOddity
New Member
Posts: 7
Joined: Sun Feb 10, 2013 4:34 pm

Re: [Linux] Zsnes segfaults when attempting to save state

Post by CommonOddity »

I don't know what was done (or if anything was actually done) but save states seem to work now! Version 1.51 (July 29th, 2013 build) has no issues with save states anymore. Thank you for your time folks- Woo! :D
grinvader
ZSNES Shake Shake Prinny
Posts: 5632
Joined: Wed Jul 28, 2004 4:15 pm
Location: PAL50, dood !

Re: [Linux] Zsnes segfaults when attempting to save state

Post by grinvader »

Distro-side patches, which we never see the tiniest bit of. Thank them, if anything.
皆黙って俺について来い!!

Code: Select all

<jmr> bsnes has the most accurate wiki page but it takes forever to load (or something)
Pantheon: Gideon Zhi | CaitSith2 | Nach | kode54
Post Reply