Hang when reading from IMA image on PowerPC

Issue #109 resolved
_jef_
created an issue

Hi,

When you mount an IMA at the prompt, you can change the drive letter but Boxer will hang when you type dir or ls. This happens with all sizes of IMA images.

Comments (10)

  1. _jef_ reporter

    The same happens when trying to import it. If I change the extension to .img then I can mount it just fine in the Finder so I don't think it's corrupted. I tried different IMA files from different sources.

  2. Alun Bestor repo owner

    If you rename the IMA to IMG and Finder will mount it, then it's definitely not a DOSBox-compatible IMA file. Finder can only mount IMGs if they are in an ancient OS X-specific image format; not the Bochs IMA/IMG format supported by DOSBox.

    I need an example IMA file in order to diagnose the problem properly. Boxer's IMA image support has been tested to work with IMA/IMGs that are compatible with DOSBox. If IMA doesn't work in DOSBox, then this isn't a Boxer bug.

  3. Alun Bestor repo owner

    OK, the provided IMA file (now attached to this issue) works in Boxer 1.1 for me, and can also be mounted by Finder - not sure why the latter is the case, but anyway. This could very well be a PowerPC bug, i.e. there's some endianness problem. Could you Force Quit Boxer while it's hanging, and post the crash report as a comment on this issue?

  4. _jef_ reporter

    # Date/Time: 2011-07-22 19:35:03 +0200 OS Version: 10.5.8 (Build 9L31a) Architecture: ppc Report Version: 4

    Command: Boxer Path: /Applications/Boxer.app/Contents/MacOS/Boxer Version: 1.1 (20110715.1) Parent: launchd [94]

    PID: 514 Event: hang Time: 5.05s Steps: 12

    Process: Boxer [514] Path: /Applications/Boxer.app/Contents/MacOS/Boxer

    ADDRESS BINARY 00001000 /Applications/Boxer.app/Contents/MacOS/Boxer 020c3000 /System/Library/Frameworks/CoreMIDI.framework/Versions/A/CoreMIDI 020f5000 /Applications/Boxer.app/Contents/MacOS/../Frameworks/Sparkle.framework/Versions/A/Sparkle 02115000 /System/Library/Frameworks/ScriptingBridge.framework/Versions/A/ScriptingBridge 02145000 /Applications/Boxer.app/Contents/MacOS/../Frameworks/PhysFS.framework/Versions/A/PhysFS 0216b000 /Applications/Boxer.app/Contents/MacOS/../Frameworks/SDL_sound.framework/Versions/A/SDL_sound 02172000 /Applications/Boxer.app/Contents/MacOS/../Frameworks/DDHidLib.framework/Versions/A/DDHidLib 02185000 /usr/lib/libexpat.1.dylib 021ad000 /Applications/Boxer.app/Contents/Frameworks/SDL_sound.framework/Versions/A/Frameworks/Ogg.framework/Versions/A/Ogg 021b3000 /Applications/Boxer.app/Contents/Frameworks/SDL_sound.framework/Versions/A/Frameworks/Vorbis.framework/Versions/A/Vorbis 02549000 /System/Library/CoreServices/RawCamera.bundle/Contents/MacOS/RawCamera 0cb08000 /System/Library/Frameworks/ApplicationServices.framework/Versions/A/Frameworks/CoreGraphics.framework/Versions/A/Resources/libCGXCoreImage.A.dylib 0dca9000 /System/Library/Extensions/AudioIPCDriver.kext/Contents/Resources/AudioIPCPlugIn.bundle/Contents/MacOS/AudioIPCPlugIn 0dcb2000 /System/Library/Extensions/IOAudioFamily.kext/Contents/PlugIns/AOAHALPlugin.bundle/Contents/MacOS/AOAHALPlugin 110ec000 /System/Library/Frameworks/OpenGL.framework/Resources/GLEngine.bundle/GLEngine 11296000 /System/Library/Extensions/ATIRadeon9700GLDriver.bundle/Contents/MacOS/ATIRadeon9700GLDriver 115ac000 /System/Library/Frameworks/OpenGL.framework/Versions/A/Resources/GLRendererFloat.bundle/GLRendererFloat 30000000 /Applications/Boxer.app/Contents/MacOS/../Frameworks/SDL.framework/Versions/A/SDL 33000000 /Applications/Boxer.app/Contents/MacOS/../Frameworks/SDL_net.framework/Versions/A/SDL_net 70000000 /System/Library/Components/CoreAudio.component/Contents/MacOS/CoreAudio b0000000 /Applications/Boxer.app/Contents/MacOS/../Frameworks/BGHUDAppKit.framework/Versions/A/BGHUDAppKit bb100000 /System/Library/CoreServices/Encodings/libLatinSuppConverter.dylib c0000000 /Applications/Boxer.app/Contents/MacOS/../Frameworks/Growl.framework/Versions/A/Growl

    Thread id: 2bed750 User stack: 12 start + 68 (in Boxer) [0x3658] 12 _main + 16 (in Boxer) [0x36bc] 12 _NSApplicationMain + 444 (in AppKit) [0x9552929c] 12 -[NSApplication run] + 748 (in AppKit) [0x955588a0] 12 -[NSApplication nextEventMatchingMask:untilDate:inMode:dequeue:] + 116 (in AppKit) [0x9555ec00] 12 DPSNextEvent + 600 (in AppKit) [0x9555f248] 12 _BlockUntilNextEventMatchingListInMode + 88 (in HIToolbox) [0x9364777c] 12 _ReceiveNextEventCommon + 416 (in HIToolbox) [0x9364793c] 12 _RunCurrentEventLoopInMode + 268 (in HIToolbox) [0x93647b18] 12 _CFRunLoopRunSpecific + 2972 (in CoreFoundation) [0x918fc81c] 12 _NSFireDelayedPerform + 384 (in Foundation) [0x9307eeb4] 12 -[BXSession _startEmulator] + 244 (in Boxer) [0x9f1c] 12 -[BXEmulator start] + 136 (in Boxer) [0x15804] 12 -[BXEmulator(BXEmulatorInternals) _startDOSBox] + 564 (in Boxer) [0x173f4] 12 ZN6Config7StartUpEv + 24 (in Boxer) [0x27e2b8] 12 Z10SHELL_Initv + 2448 (in Boxer) [0x287d68] 12 ZN9DOS_Shell3RunEv + 596 (in Boxer) [0x28699c] 12 ZN9DOS_Shell9ParseLineEPc + 676 (in Boxer) [0x28702c] 12 ZN9DOS_Shell9DoCommandEPc + 496 (in Boxer) [0x290408] 12 ZN9DOS_Shell7CMD_DIREPc + 2196 (in Boxer) [0x28befc] 12 ZN8fatDrive14AllocationInfoEPtPhS0_S0_ + 176 (in Boxer) [0x13a80c] 12 ZN8fatDrive15getClusterValueEj + 240 (in Boxer) [0x13acec] 8 ZN9imageDisk19Read_AbsoluteSectorEjPv + 84 (in Boxer) [0x25f900] 6 _fread + 192 (in libSystem.B.dylib) [0x910febac] 6 _srefill + 380 (in libSystem.B.dylib) [0x910f9000] 6 _read_nocancel + 12 (in libSystem.B.dylib) [0x910afd34] 1 _fread + 216 (in libSystem.B.dylib) [0x910febc4] 1 _memmove + 0 (in libSystem.B.dylib) [0x910afac0] 4 ZN9imageDisk19Read_AbsoluteSectorEjPv + 64 (in Boxer) [0x25f8ec] 4 _fseek + 120 (in libSystem.B.dylib) [0x910fa694] 4 fseeko + 1164 (in libSystem.B.dylib) [0x910f8828] 3 _lseek + 12 (in libSystem.B.dylib) [0x910bd494] 1 _lseek + 8 (in libSystem.B.dylib) [0x910bd490] Kernel stack: 5 _trap + 3400 [0xb12d0] 5 _ast_taken + 192 [0x27888] 5 _thread_block_reason + 180 [0x36b98] 5 _Switch_context + 452 [0xb1fa4] 2 _shandler + 328 [0xb4448] 1 _unix_syscall + 536 [0x3100ac] 1 _lseek + 204 [0xfa4a4] 1 _mac_file_check_change_offset + 160 [0x3a632c] 1 _thandler + 280 [0xb4278] 1 _trap + 432 [0xb0738] 1 _ast_taken + 192 [0x27888] 1 _thread_block_reason + 180 [0x36b98] 1 _Switch_context + 452 [0xb1fa4] 1 _thandler + 280 [0xb4278] 1 _trap + 432 [0xb0738] 1 _ast_taken + 192 [0x27888] 1 _thread_block_reason + 180 [0x36b98] 1 _Switch_context + 452 [0xb1fa4]

    Thread id: 202e998 User stack: 12 pthread_start + 320 (in libSystem.B.dylib) [0x910f0f74] 12 _select$DARWIN_EXTSN + 12 (in libSystem.B.dylib) [0x91112c14]

    Thread id: 43c7248 User stack: 12 pthread_start + 320 (in libSystem.B.dylib) [0x910f0f74] 12 _SDL_SemWait + 24 (in SDL) [0x30039ec0] 12 _SDL_Linked_Version + 416 (in SDL) [0x3002cc84] 12 _SDL_Delay + 532 (in SDL) [0x3003a2b4] 12 _mach_wait_until + 8 (in libSystem.B.dylib) [0x910af1f8]

    Thread id: 31195f0 User stack: 12 pthread_start + 320 (in libSystem.B.dylib) [0x910f0f74] 12 ZN9CAPThread5EntryEPS_ + 108 (in CoreAudio) [0x90678de8] 12 ZN10HALRunLoop9OwnThreadEPv + 216 (in CoreAudio) [0x90678fac] 12 _CFRunLoopRunSpecific + 1816 (in CoreFoundation) [0x918fc398] 12 _mach_msg_trap + 8 (in libSystem.B.dylib) [0x910af078]

    Thread id: 2bed000 User stack: 12 pthread_start + 320 (in libSystem.B.dylib) [0x910f0f74] 12 ZN9CAPThread5EntryEPS_ + 108 (in CoreAudio) [0x90678de8] 12 ZN11HP_IOThread11ThreadEntryEPS_ + 16 (in CoreAudio) [0x9068a7f4] 12 ZN11HP_IOThread8WorkLoopEv + 492 (in CoreAudio) [0x9068a9f4] 12 ZN7CAGuard7WaitForEy + 212 (in CoreAudio) [0x9068a784] 12 _semaphore_timedwait_signal_trap + 8 (in libSystem.B.dylib) [0x910af0f8]

    Thread id: 43c7d40 User stack: 12 pthread_start + 320 (in libSystem.B.dylib) [0x910f0f74] 12 _glvmDoWork + 124 (in libGLProgrammability.dylib) [0x91b71b6c] 12 _semwait_signal + 12 (in libSystem.B.dylib) [0x910b5a8c]

    Thread id: 34d5d40 User stack: 12 pthread_start + 320 (in libSystem.B.dylib) [0x910f0f74] 12 _gleCmdProcessor + 148 (in GLEngine) [0x111c5764] 12 _semwait_signal + 12 (in libSystem.B.dylib) [0x910b5a8c] #

  5. Alun Bestor repo owner

    Yup, there is indeed an endianness bug in DOSBox, when reading the image file's header into a struct. This neglects to convert certain header data from the little-endian storage format into big-endian integers on PowerPCs and as a result, later read operations will try to seek beyond the end of the image file and die a horrible death.

    A fix for this will be arriving in Boxer 1.1.1.

  6. Alun Bestor repo owner

    ...on closer inspection, directory reads (and writes) from FAT images are also riddled with endianness bugs. And these haven't been fixed in trunk either. It's a wonder nobody's reported it, but then FAT images aren't very common in the wild.

  7. Log in to comment