Segmentation Fault on OS X Mavericks (10.9.2)

Linux geeks and Mac OS hipsters unite! A board for discussion of Supermodel on non-Windows platforms.
Forum rules
Keep it classy!

  • No ROM requests or links.
  • Do not ask to be a play tester.
  • Do not ask about release dates.
  • No drama!

Segmentation Fault on OS X Mavericks (10.9.2)

Postby PartyMummy » Mon Jun 09, 2014 2:48 pm

I'm having issues getting Supermodel to successfully run since my update to Mavericks. It was previously working fine in Snow Leopard, and I think it was fine in Lion.

I tried deleting my old install and recompiling using this guide: http://www.supermodel3.com/Forum/viewtopic.php?f=5&t=1036, but the problem persists.

When I try to launch Supermodel from Terminal, i.e. /Applications/Supermodel_02a/Supermodel swtrilgy.zip, the game starts, it shows the first couple of screens (in this case the Sega logo then the LucasArts logo) and then it crashes. The Terminal simply states "Segmentation Fault: 11".

I've tried running it with gdb, but it doesn't seem to be finding the function names. Here is what it generated:

(gdb) run /Users/Home/Desktop/swtrilgy.zip
Starting program: /Applications/Emulators/Supermodel_02a/Supermodel /Users/Home/Desktop/swtrilgy.zip
Supermodel: A Sega Model 3 Arcade Emulator (Version 0.2a)
Copyright (C) 2011 by Bart Trzynadlowski and Nik Henson

Title: Star Wars Trilogy (Revision A)
ROM Set: swtrilgy
Developer: Sega, LucasArts
Year: 1998
Step: 2.1
Extra Hardware: Digital Sound Board (Type 2)

[New Thread 0x1a0b of process 6803]
[New Thread 0x1b03 of process 6803]
[New Thread 0x1c03 of process 6803]
[New Thread 0x1d03 of process 6803]
[New Thread 0x1e03 of process 6803]
[New Thread 0x1f03 of process 6803]
[New Thread 0x2003 of process 6803]

Program received signal SIGSEGV, Segmentation fault.
0x0000123440310917 in ?? ()
(gdb) backtrace
#0 0x0000123440310917 in ?? ()
#1 0x0000000100000001 in ?? ()
#2 0x000000000000000f in ?? ()
#3 0x0000000101852c00 in ?? ()
#4 0x00000000003f0083 in ?? ()
#5 0x00000000003f0083 in ?? ()
#6 0x0000000000000001 in ?? ()
#7 0x00007fff5fbfbb10 in ?? ()
#8 0x0000123440310837 in ?? ()
#9 0x0000000101630000 in ?? ()
#10 0x0000007e01070000 in ?? ()
#11 0x0000000000000010 in ?? ()
#12 0x000000011582da68 in ?? ()
#13 0x000000011582dfb8 in ?? ()
#14 0x0000000000000000 in ?? ()
(gdb)

Any help would be much appreciated!
PartyMummy
 
Posts: 4
Joined: Sun Jun 08, 2014 7:04 pm

Re: Segmentation Fault on OS X Mavericks (10.9.2)

Postby Bart » Mon Jun 09, 2014 4:57 pm

The backtrace is useless because Supermodel was built with optimization enabled. Edit the Makefile and replace "-O3" (optimizations, level 3) in COMPILER_FLAGS with "-g" (retain debugging information). Recompile and try again. Don't worry about ENABLE_DEBUGGER, it is for debugging Model 3 games, not the emulator itself.
User avatar
Bart
Site Admin
 
Posts: 1859
Joined: Thu Sep 01, 2011 2:13 pm
Location: New York City

Re: Segmentation Fault on OS X Mavericks (10.9.2)

Postby PartyMummy » Mon Jun 09, 2014 7:04 pm

I tried rebuilding with that flag changed. gdb still doesn't give useful information. My build gave some warnings about the debugger - pasted terminal output here:

http://pastebin.com/Cwt7mgN8

So I guess the debug build isn't building correctly?
PartyMummy
 
Posts: 4
Joined: Sun Jun 08, 2014 7:04 pm

Re: Segmentation Fault on OS X Mavericks (10.9.2)

Postby Bart » Tue Jun 10, 2014 6:35 am

I would disable the debugger. You need to "make clean" before running "make" again. This should delete the contents of the obj directory before rebuilding. Otherwise, files won't be recompiled with the -g option.
User avatar
Bart
Site Admin
 
Posts: 1859
Joined: Thu Sep 01, 2011 2:13 pm
Location: New York City

Re: Segmentation Fault on OS X Mavericks (10.9.2)

Postby PartyMummy » Tue Jun 10, 2014 9:29 pm

Thanks for the reply. I used make clean before using make, but the issue still persists. Even though it says "Reading symbols from ./Supermodel...done." when I start Supermodel in gdb, if I do "bt full", I receive many "No symbol table info available." errors.

I realize that at this point it's an issue with me understanding gdb, and not a problem with Supermodel. I'm trying to troubleshoot it on my own, but if you have any suggestions in the meantime, I'll definitely give them a try. Otherwise, I'll report back if I can figure this out.

Just to make sure I'm not doing anything stupid, here is what I'm doing, step by step.

1) Download source from http://www.supermodel3.com/Files/Superm ... 2a_Src.zip
2) Unzip, copy Makefile.SDL.OSX.GCC from ../Supermodel_0.2a_Src/Makefiles/ to ../Supermodel_0.2a_Src/
3) Modify Makefile.SDL.OSX.GCC to add -F/Library/Frameworks/ to lines 68 and 71, and replace -O3 with -g in COMPILER_FLAGS
4) Rename Makefile.SDL.OSX.GCC to makefile
5) In terminal, cd to ../Supermodel_0.2a_Src/, and run "make"
6) cd to ../Supermodel_0.2a_Src/bin/ and run "sudo ggdb ./Supermodel" (ggdb is the name of gdb when downloaded through macports)
7) run "run /Users/Home/Desktop/lostwsga.zip" in gdb
8) After segmentation fault, run "backtrace" or "backtrace full" in gdb
PartyMummy
 
Posts: 4
Joined: Sun Jun 08, 2014 7:04 pm

Re: Segmentation Fault on OS X Mavericks (10.9.2)

Postby Bart » Wed Jun 11, 2014 5:33 pm

That all sounds correct to me. I wish I had a Mac to help you out. Maybe later this summer if I find some time to work on Supermodel (I've been wanting to rewrite the graphics engine so that it performs better and works on Radeon and Intel GPUs), I'll purchase a Mac laptop.

The only other thing I would suggest trying is building from the latest SVN source. This is not officially supported but it is much newer code than 0.2a. Go here and you should be able to download a snapshot of the latest code. Make the equivalent modifications to the Makefile and build it from scratch. I think you are using gdb correctly and I'm rather surprised to see it not working. The only thing I can think of without seeing it firsthand is that SDL is blowing up before it is even transfers control to Supermodel's main() function. But that seems unlikely, especially if you can run Supermodel without any arguments and get it to print the help text.
User avatar
Bart
Site Admin
 
Posts: 1859
Joined: Thu Sep 01, 2011 2:13 pm
Location: New York City

Re: Segmentation Fault on OS X Mavericks (10.9.2)

Postby PartyMummy » Thu Jun 19, 2014 8:12 am

Sorry for the delayed reply, I was too busy to test for a little while.

Great news - it looks like compiling from the latest SVN source did the trick! I'll post a compiled version for those having similar trouble when I get a chance.
PartyMummy
 
Posts: 4
Joined: Sun Jun 08, 2014 7:04 pm

Re: Segmentation Fault on OS X Mavericks (10.9.2)

Postby mattsoft » Fri Jul 18, 2014 9:09 pm

Hey PartyMummy -- could you please post instructions for getting the latest snapshot of supermodel to compile on Mavericks (Xcode 5.1 I presume)? I cannot get this thing to compile to save my life. thanks!
mattsoft
 
Posts: 7
Joined: Sat Jul 12, 2014 8:39 pm

Re: Segmentation Fault on OS X Mavericks (10.9.2)

Postby Arbee » Thu Aug 07, 2014 8:52 am

If you upgraded from Snow Leopard to Mavericks, chances are good you didn't upgrade your SDL framework to 1.2.15. 1.2.14 and previous will crash on Lion and later just as you described.
Arbee
 
Posts: 67
Joined: Sun Sep 25, 2011 6:41 pm

Re: Segmentation Fault on OS X Mavericks (10.9.2)

Postby mattsoft » Fri Aug 08, 2014 4:37 pm

Arbee wrote:If you upgraded from Snow Leopard to Mavericks, chances are good you didn't upgrade your SDL framework to 1.2.15. 1.2.14 and previous will crash on Lion and later just as you described.


Doh! Upgraded SDL 1.2.15, downloaded latest snapshot, made changes to makefile, recompiled and (ding ding ding) we have a winner. Thanks!
mattsoft
 
Posts: 7
Joined: Sat Jul 12, 2014 8:39 pm

Next

Return to Alternative Fashion

Who is online

Users browsing this forum: No registered users and 1 guest