Skip to content
This repository has been archived by the owner on Jun 8, 2022. It is now read-only.

GRIM: Game crashes on startup (ARM linux) #1073

Closed
arjunkc opened this issue Aug 20, 2014 · 11 comments
Closed

GRIM: Game crashes on startup (ARM linux) #1073

arjunkc opened this issue Aug 20, 2014 · 11 comments

Comments

@arjunkc
Copy link

arjunkc commented Aug 20, 2014

I compiled residualvm 0.1.1 on my ARM linux laptop. But it crashes on the opening splash screen: it shows Manny riding the bike, and then freezes. The console shows the following:

WARNING: Font treb13bs.laf, char 0xb8 exceeds font height by 1, increasing font height!
WARNING: Lua_V1::SetGamma, implement opcode, level: 0!
WARNING: !!!! Trying to call MakeSectorActive without a scene!
WARNING: !!!! Trying to call MakeSectorActive without a scene!
WARNING: !!!! Trying to call MakeSectorActive without a scene!
WARNING: !!!! Trying to call MakeSectorActive without a scene!
WARNING: !!!! Trying to call MakeSectorActive without a scene!
<BR>
<BR>
<CENTER>(Introduction)</CENTER>
<BR>
<BR>
Illegal instruction

I compiled the github version 0.2.0git0bd0bf6-dirty and again, I get the same output and it crashes. Except, the 'Illegal Instruction' does not show up on the console.
gdb log in version 0.1.1:

Starting program: /home/arjun/packages-local/residualvm-0.1.1/residualvm 
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/arm-linux-gnueabihf/libthread_db.so.1".
[New Thread 0x764aa450 (LWP 4421)]
[New Thread 0x7593c450 (LWP 4423)]

Program received signal SIGILL, Illegal instruction.
[Switching to Thread 0x7593c450 (LWP 4423)]
0x02189810 in ?? ()
#0  0x02189810 in ?? ()
Cannot access memory at address 0x3e8
#1  0x0013516c in Audio::CopyRateConverter<true, true>::~CopyRateConverter (
    this=0x5622, __in_chrg=<optimized out>) at audio/rate_arm.cpp:389
Backtrace stopped: previous frame inner to this frame (corrupt stack?)

gdb log for 0.2.0git0bd0bf6-dirty

Starting program: /home/arjun/packages-local/residualvm/residualvm 
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/arm-linux-gnueabihf/libthread_db.so.1".
[New Thread 0x761df450 (LWP 4476)]
[New Thread 0x759df450 (LWP 4477)]

Program received signal SIGSEGV, Segmentation fault.
[Switching to Thread 0x761df450 (LWP 4476)]
0x00000000 in ?? ()
#0  0x00000000 in ?? ()
#1  0x003179d4 in Audio::AACDecoder::AACDecoder (this=0x40d9990, extraData=
    0x3fa0fc0, disposeExtraData=4782216) at audio/decoders/aac.cpp:79
#2  0x00000758 in ?? ()
#3  0x00000758 in ?? ()
Backtrace stopped: previous frame identical to this frame (corrupt stack?)

My configure output:

Running ResidualVM configure...
Looking for C++ compiler... g++
Checking for compiler version... 4.6, ok
Building as C++11... no
Checking for whether -Wglobal-constructors work... no
Checking endianness... little
Checking 64-bitness... no
Type with 1 byte... char
Type with 2 bytes... short
Type with 4 bytes... int
Type with 8 bytes... long long
Alignment required... yes
Checking host CPU architecture... ARM
Checking hosttype... linux-gnueabihf
Looking for sdl-config... /usr/bin/sdl-config
Checking if host is POSIX compliant... yes
Checking whether to have a verbose build... no
Checking whether building plugins was requested... no
Checking for Ogg Vorbis... yes
Checking for Tremor... no (Ogg Vorbis/Tremor support is mutually exclusive)
Checking for FLAC >= 1.0.1... yes
Checking for MAD... yes
Checking for ALSA >= 0.9... yes
Checking for libjpeg >= v6b... yes
Checking for PNG >= 1.2.8... yes
Checking for libtheoradec >= 1.0... yes
Checking for libfaad... yes
Checking for SEQ MIDI... no
Checking for sndio... no
Checking for TiMidity... yes
Checking for zlib... yes
Checking for libmpeg2 >= 0.4.0... yes
Checking for Sparkle... no
Checking for libfluidsynth... no
Checking for readline... skipping (text console disabled)
Checking for libunity... no
Looking for freetype-config... /usr/bin/freetype-config
Checking for FreeType2... yes
Checking for OpenGL... yes (shaders disabled)
Building translation support... no
Building taskbar integration support... no
Building Bink video support... yes
Building SafeDisc decryption support... no
Building updates support... no
Backend... sdl (1.2.14), savegame timestamp

Engines (builtin):
    Grim [all games]
    Myst 3 


Creating config.h
Creating config.mk
Creating engines/engines.mk
Creating engines/plugins_table.h

My make compilation output can be found here.

It seems to be an audio issue, but ffmpeg, vlc and mplayer work fine on aac files.

@klusark
Copy link
Member

klusark commented Aug 20, 2014

It doesn't make sense that it's crashing in AACDecoder as GRIM doesn't use AAC at all. Maybe a corrupt stack? Is that the main thread that it's crashing in, or the audio thread?

@arjunkc
Copy link
Author

arjunkc commented Aug 20, 2014

I think its the audio thread. How would I check that. I could try compiling without alsa support to see if that helps.

@klusark
Copy link
Member

klusark commented Aug 20, 2014

in gdb enter the command

thread apply all bt

and the paste the output.

@arjunkc
Copy link
Author

arjunkc commented Aug 20, 2014

Output:

Cannot access memory at address 0x3e8

Thread 3 (Thread 0x7593c450 (LWP 17106)):
#0  0x021897a0 in ?? ()
#1  0x0013516c in Audio::CopyRateConverter<true, true>::~CopyRateConverter (
    this=0x5622, __in_chrg=<optimized out>) at audio/rate_arm.cpp:389
Backtrace stopped: previous frame inner to this frame (corrupt stack?)

Thread 2 (Thread 0x764a9450 (LWP 17103)):
#0  0x76c1b034 in nanosleep () from /lib/arm-linux-gnueabihf/libc.so.6
#1  0x76f8d5b8 in SDL_Delay ()
   from /usr/lib/arm-linux-gnueabihf/libSDL-1.2.so.0
#2  0x76f8d5ee in ?? () from /usr/lib/arm-linux-gnueabihf/libSDL-1.2.so.0
#3  0x76f8d5ee in ?? () from /usr/lib/arm-linux-gnueabihf/libSDL-1.2.so.0
Backtrace stopped: previous frame identical to this frame (corrupt stack?)

Thread 1 (Thread 0x764ab220 (LWP 17100)):
#0  0x76c1b034 in nanosleep () from /lib/arm-linux-gnueabihf/libc.so.6
#1  0x76f8d5b8 in SDL_Delay ()
   from /usr/lib/arm-linux-gnueabihf/libSDL-1.2.so.0
#2  0x0000d112 in OSystem_SDL::delayMillis (this=0x1e2008, msecs=14)
    at backends/platform/sdl/sdl.cpp:430
#3  0x00020468 in Grim::GrimEngine::mainLoop (this=0x4ac150)
    at engines/grim/grim.cpp:705
#4  0x0001ecac in Grim::GrimEngine::run (this=0x4ac150)
    at engines/grim/grim.cpp:301
#5  0x0000e864 in runGame (plugin=0x1ebb60, system=..., edebuglevels=...)
    at base/main.cpp:219
#6  0x0000f31c in scummvm_main (argc=1, argv=0x7efff3f4) at base/main.cpp:446
#7  0x0000d78e in main (argc=1, argv=0x7efff3f4)
    at backends/platform/sdl/posix/posix-main.cpp:45
Cannot access memory at address 0x3e8

@somaen
Copy link
Member

somaen commented Aug 21, 2014

audio/rate_arm.cpp reminds me that there are a few places in the source code where ARM has specific assembly code for it in place.

@klusark
Copy link
Member

klusark commented Aug 21, 2014

I setup a Debian arm VM and I'm getting a very similar crash. I'll see if I can track it down.

@klusark
Copy link
Member

klusark commented Aug 21, 2014

Can you try a change to see if it's just the audio code?

Just remove
backends/mixer/sdl/sdl-mixer.cpp:150

It says

manager->callbackHandler(samples, len);

If that works there's just an issue in the audio code somewhere.

@arjunkc
Copy link
Author

arjunkc commented Aug 21, 2014

It works! it plays without the sound. I hope it's not ARM assembly code that's the issue. Does it run in your Debian VM?

@klusark
Copy link
Member

klusark commented Aug 21, 2014

Ya, it runs without that line. I'm running it over VNC without sound enabled, so I have not been able to test that at all.

The stack trace doesn't make sense here, so it must be some kind of corruption.

@arjunkc
Copy link
Author

arjunkc commented Aug 23, 2014

More issues. Should I open a new issue, or continue here? I think its related to the same sound issues from before. New segfault after Manny reads the message from his boss in the first scene. Here is the gdb backtrace

#0  0xfffffffe in ?? ()
#1  0x0007aa18 in Grim::Imuse::callback (this=0x6dc538)
    at engines/grim/imuse/imuse.cpp:280
#2  0x00079ef2 in Grim::Imuse::timerHandler (refCon=0x6dc538)
    at engines/grim/imuse/imuse.cpp:48
#3  0x0016b4f0 in DefaultTimerManager::handler (this=0x47ee98)
    at backends/timer/default/default-timer.cpp:105
#4  0x00169e9c in timer_handler (interval=10, param=0x47ee98)
    at backends/timer/sdl/sdl-timer.cpp:33
#5  0x76f5d6c0 in ?? () from /usr/lib/arm-linux-gnueabihf/libSDL-1.2.so.0
#6  0x76f5d6c0 in ?? () from /usr/lib/arm-linux-gnueabihf/libSDL-1.2.so.0
Backtrace stopped: previous frame identical to this frame (corrupt stack?)

Thread 2 (Thread 0x761de450 (LWP 3275)):
#0  0x76b14276 in ?? () from /lib/arm-linux-gnueabihf/libc.so.6
#1  0x76b85858 in poll () from /lib/arm-linux-gnueabihf/libc.so.6
#2  0x76e8833c in ?? () from /usr/lib/arm-linux-gnueabihf/libasound.so.2
#3  0x76e8833c in ?? () from /usr/lib/arm-linux-gnueabihf/libasound.so.2
Backtrace stopped: previous frame identical to this frame (corrupt stack?)

Thread 1 (Thread 0x764372a0 (LWP 3273)):
#0  0x76f6c50c in ?? () from /usr/lib/arm-linux-gnueabihf/libSDL-1.2.so.0
#1  0x76f60e20 in ?? () from /usr/lib/arm-linux-gnueabihf/libSDL-1.2.so.0
#2  0x76f60e20 in ?? () from /usr/lib/arm-linux-gnueabihf/libSDL-1.2.so.0
Backtrace stopped: previous frame identical to this frame (corrupt stack?)

@aquadran
Copy link
Member

in my case crash report in gdb point me to ADPCMStream, which actually not used

@aquadran aquadran changed the title Grim Fandango crashes on startup (ARM linux) GRIM: Game crashes on startup (ARM linux) Dec 27, 2014
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Development

No branches or pull requests

5 participants