Mednafen Members Members   Search Search   Help Help   Register Register   Login Login   Home Home
Home » Mednafen » Development » Mednafen 0.8.4 Release Candidates on OS X - G3 processor ... crashes
Show: Today's Messages  :: Show Polls :: Message Navigator
Switch to threaded view of this topic Create a new topic Submit Reply
Mednafen 0.8.4 Release Candidates on OS X - G3 processor ... crashes [message #926] Wed, 12 September 2007 09:26 Go to next message
Jimbob_B  [PM]
I have a problem when compiling the latest 0.8.4 release candidates for a G3 processor on an OS X 10.4.10 machine. I have 2 Macs, an iMac with a G5 processor and an iBook with a G3 processor. Mednafen 0.8.4 rc1 works fine on the G5 but crashes instantly on the G3, for both rc1 and rc2. I'm trying to load some GBA games that previously worked in 0.8.1 (from memory).

The crash log is,

PID: 11388
Thread: 4

Exception: EXC_BAD_INSTRUCTION (0x0002)
Code[0]: 0x00000002
Code[1]: 0x0001effc


Thread 0:
0 libSystem.B.dylib 0x900411f8 mach_wait_until + 8
1 libSystem.B.dylib 0x90040fc4 nanosleep + 388
2 libSDL-1.2.0.dylib 0x01b5ac74 SDL_Delay + 116 (SDL_systimer.c:133)
3 mednafen 0x0007fa1c SDL_main + 1644
4 mednafen 0x000eadec -[SDLMain applicationDidFinishLaunching:] + 76 (SDLMain.m:305)
5 com.apple.Foundation 0x92bdeae4 _nsnote_callback + 180
6 com.apple.CoreFoundation 0x90805078 __CFXNotificationPost + 368
7 com.apple.CoreFoundation 0x907fd114 _CFXNotificationPostNotification + 684
8 com.apple.Foundation 0x92bc8eec -[NSNotificationCenter postNotificationName:object:userInfo:] + 92
9 com.apple.AppKit 0x9379ef98 -[NSApplication _postDidFinishNotification] + 112
10 com.apple.AppKit 0x9379ee84 -[NSApplication _sendFinishLaunchingNotification] + 92
11 com.apple.AppKit 0x9379e9cc -[NSApplication(NSAppleEventHandling) _handleAEOpen:] + 264
12 com.apple.AppKit 0x9379e574 -[NSApplication(NSAppleEventHandling) _handleCoreEvent:withReplyEvent:] + 92
13 com.apple.Foundation 0x92bdfaf0 -[NSAppleEventManager dispatchRawAppleEvent:withRawReply:handlerRefCon:] + 380
14 com.apple.Foundation 0x92bdf950 _NSAppleEventManagerGenericHandler + 92
15 com.apple.AE 0x914fd960 aeDispatchAppleEvent(AEDesc const*, AEDesc*, unsigned long, unsigned char*) + 208
16 com.apple.AE 0x914fd7fc dispatchEventAndSendReply(AEDesc const*, AEDesc*) + 44
17 com.apple.AE 0x914fd654 aeProcessAppleEvent + 284
18 com.apple.HIToolbox 0x932992e0 AEProcessAppleEvent + 60
19 com.apple.AppKit 0x9379ccbc _DPSNextEvent + 856
20 com.apple.AppKit 0x9379c7a8 -[NSApplication nextEventMatchingMask:untilDate:inMode:dequeue:] + 116
21 com.apple.AppKit 0x93798cec -[NSApplication run] + 472
22 mednafen 0x000eb424 main + 1300 (SDLMain.m:231)
23 mednafen 0x00002ebc _start + 760
24 mednafen 0x00002bc0 start + 48

Thread 1:
0 libSystem.B.dylib 0x900411f8 mach_wait_until + 8
1 libSystem.B.dylib 0x90040fc4 nanosleep + 388
2 libSDL-1.2.0.dylib 0x01b5ac74 SDL_Delay + 116 (SDL_systimer.c:133)
3 libSDL-1.2.0.dylib 0x01b5ace8 RunTimer + 72 (SDL_systimer.c:199)
4 libSDL-1.2.0.dylib 0x01b0f8e8 SDL_RunThread + 72 (SDL_thread.c:203)
5 libSDL-1.2.0.dylib 0x01b54da0 RunThread + 16 (SDL_systhread.c:48)
6 libSystem.B.dylib 0x9002bd08 _pthread_body + 96

Thread 2:
0 libSystem.B.dylib 0x9000b348 mach_msg_trap + 8
1 libSystem.B.dylib 0x9000b29c mach_msg + 60
2 com.apple.CoreFoundation 0x907ddba8 __CFRunLoopRun + 832
3 com.apple.CoreFoundation 0x907dd4ac CFRunLoopRunSpecific + 268
4 com.apple.audio.CoreAudio 0x9145663c HALRunLoop::OwnThread(void*) + 264
5 com.apple.audio.CoreAudio 0x914563dc CAPThread::Entry(CAPThread*) + 96
6 libSystem.B.dylib 0x9002bd08 _pthread_body + 96

Thread 3:
0 libSystem.B.dylib 0x90054388 semaphore_timedwait_signal_trap + 8
1 libSystem.B.dylib 0x90070be8 pthread_cond_timedwait_relative_np + 556
2 com.apple.audio.CoreAudio 0x91467794 CAGuard::WaitFor(unsigned long long) + 204
3 com.apple.audio.CoreAudio 0x914676a4 CAGuard::WaitUntil(unsigned long long) + 304
4 com.apple.audio.CoreAudio 0x914658e8 HP_IOThread::WorkLoop() + 852
5 com.apple.audio.CoreAudio 0x91465580 HP_IOThread::ThreadEntry(HP_IOThread*) + 16
6 com.apple.audio.CoreAudio 0x914563dc CAPThread::Entry(CAPThread*) + 96
7 libSystem.B.dylib 0x9002bd08 _pthread_body + 96

Thread 4 Crashed:
0 mednafen 0x0001effc MDFN_StateEvil(int) + 0
1 mednafen 0x00012420 MDFNI_Emulate(EmulateSpecStruct*) + 320
2 mednafen 0x0007ee14 GameLoop(void*) + 632
3 libSDL-1.2.0.dylib 0x01b0f8e8 SDL_RunThread + 72 (SDL_thread.c:203)
4 libSDL-1.2.0.dylib 0x01b54da0 RunThread + 16 (SDL_systhread.c:48)
5 libSystem.B.dylib 0x9002bd08 _pthread_body + 96


It's consistantly crashing in thread 4. I've also tried the SDL video driver but it still crashes, regardless.

I'm compiling with the latest XCode using gcc 4.0.1 and I'm also using the -force_cpusubtype_ALL flag to ensure the code works on a G3.

Any ideas on how to fix this?

The output from mednafen 0.8.4-rc2 is displayed below,

Starting Mednafen 0.8.4-rc2
Loading settings from "/Users/James/.mednafen/mednafen.cfg"...
Compiled against SDL 1.2.12, running with SDL 1.2.12

Initializing joysticks...
Loading XXXXXXXXX.gba.gz...

ROM: 0KiB
ROM CRC32: 0x1f1c08fb
ROM MD5: 0x605b89b67018abcea91e693a4dd25be3

Loading cheats from /Users/James/.mednafen/cheats/gba.cht...
Error opening file: No such file or directory

Initializing sound...
Using "SDL" audio driver with device "default":
Bits: 16
Rate: 48000
Channels: 2
Byte order: CPU Reversed
Buffer size: 1536 sample frames(32.000000 ms)
Initializing video...
Video Mode: 720 x 480 x 32 bpp
OpenGL: Yes
Pixel shader: none
Fullscreen: No
Special Scaler: None
Scanlines: Off
Destination Rectangle: X=0, Y=0, W=720, H=480
OpenGL Implementation: ATI Technologies Inc. ATI Radeon 7500 OpenGL Engine 1.3 ATI-1.4.18
Checking extensions:
Using power-of-2 sized textures.
Checking maximum texture size...
Apparently it is at least: 2048 x 2048
Illegal instruction

[Updated on: Wed, 12 September 2007 15:06]

Re: Mednafen 0.8.4 Release Candidates on OS X - G3 processor ... crashes [message #1299 is a reply to message #926 ] Mon, 21 July 2008 09:53 Go to previous messageGo to next message
Jimbob_B  [PM]
Apologies for digging up this thread again but I still have this problem on my G3 machine and I've recompiled mednafen 0.8.9 with -g -O0 to debug where it's crashing. Below is the output from gdb from where it crashes,

In mednafen.cpp
561 espec->NeedSoundReverse = MDFN_StateEvil(espec->NeedRewind);
(gdb) print espec->NeedRewind
$1 = false
(gdb) s

Program received signal EXC_BAD_INSTRUCTION, Illegal instruction/operand.
MDFN_StateEvil (rewind=38614224) at state.cpp:1004


So, in mednafen.cpp espec->NeedRewind is false (therefore, 0 I believe) but when it calls the MDFN_StateEvil function it's evaluated as 38614224. Anyone have any ideas exactly what's happening? Is it related to running on a big endian processor? This last question doesn't make much sense because it still runs fine on my iMac G5 (again a big endian processor).

EDIT:

If I cheat and remove the espec->NeedSoundReverse = MDFN_StateEvil(espec->NeedRewind); and replace it with espec->NeedSoundReverse = 1 it seems to work!!! It's very bizarre because changing it to espec->NeedSoundReverse = MDFN_StateEvil(0); still results in a crash. I'm using gcc 4.0.1 btw.

EDIT NO. 2:

It looks like it might be related to the altivec and gcc. I've just reconfigured and removed -faltivec and -maltivec from the CFLAGS and CPPFLAGS in the Makefiles and it works without changing mednafen.cpp.

Is there a way to disable the Altivec flags when running configure?? Something like --disable-altivec with --enable-altivec as the default.

Thanks!

[Updated on: Mon, 21 July 2008 12:57]

Re: Mednafen 0.8.4 Release Candidates on OS X - G3 processor ... crashes [message #1314 is a reply to message #926 ] Mon, 18 August 2008 11:47 Go to previous message
Administrator  [PM]
I'll add a configure option for 0.8.A(untested, but it should work).
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic:Compiling Mednafen under Mac OS X
Next Topic:nes color pallette
Goto Forum:
  

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ ]

Current Time: Sat May 18 07:46:35 CDT 2024
.:: Contact :: Home ::.

Powered by FUDforum.
Copyright © FUDforum Bulletin Board Software