Bug 5573 - Game crashes with AL error
Status: RESOLVED DUPLICATE of bug 5683
Alias: None
Product: Psychonauts
Classification: Unclassified
Component: everything
Version: unspecified
Hardware: PC Linux
: P3 major
Assignee: Ryan C. Gordon
QA Contact: Ryan C. Gordon
URL:
Depends on:
Blocks:
 
Reported: 2012-06-03 15:08 EDT by simon
Modified: 2012-06-21 15:01:23 EDT
5 users (show)

See Also:



Description simon 2012-06-03 15:08:44 EDT
System Ubuntu 12.04 ati graphics catalyst driver.

The game seems to crash randomly with with the following error:

"
Anim: anims\dartnew\ladderup.jan: loaded (1 frames latency)
Anim: anims\dartnew\ladderstop.jan: loaded (1 frames latency)
Anim: anims\dartnew\ladderdismount.jan: loaded (1 frames latency)
Anim: anims\emotional baggage\dufflebagtag_default.jan: loaded (1 frames latency)
Game: Engine SET SECONDARY TARGET Turret
Game: Engine SET SECONDARY TARGET nil
Game: Engine SET SECONDARY TARGET Turret
Game: Engine SET SECONDARY TARGET nil
Game: Engine SET SECONDARY TARGET Turret
Game: Engine SET SECONDARY TARGET nil
Game: Engine SET SECONDARY TARGET Turret
Anim: anims\dartnew\damagelf.jan: loaded (1 frames latency)
Game: Engine SET SECONDARY TARGET nil
Game: Engine SET SECONDARY TARGET Turret
ERROR: CSource::AttachBuffer alSourcei(m_uiSource, AL_BUFFER, pBuffer->GetBuffer()) reports AL_INVALID_VALUE error.
*** glibc detected *** ./Psychonauts: corrupted double-linked list: 0xeb80b348 ***
"

This happens around every ten minuets playing.

I have tried the 3/6/12 patch suggested on some of the other patches. This doesn't help.
Comment 1 David Gow 2012-06-04 11:05:01 EDT
I've stumbled across this (with the new test binary) as well. I was bouncing around by the lake.

Log:
----
Game: Engine BoatHouse domain turned on via triggervolume.
Game: Engine BoatHouse domain turned off via triggervolume.
Game: Engine ProjectedLight domain turned on via triggervolume.
Game: Engine Warning: Animator requires you to define self.animBasePath to function correctly.
Anim: anims\dartnew\polejangle.jan: loaded (1 frames latency)
Anim: anims\dartnew\poleclimb.jan: loaded (1 frames latency)
Anim: anims\dartnew\poleslide.jan: loaded (1 frames latency)
Anim: anims\dartnew\polehang.jan: loaded (1 frames latency)
Anim: anims\seagull\land.jan: loaded (1 frames latency)
STUBBED: not implemented at SetHLSLPSConstant (/home/icculus/projects/psychonauts/Source/CommonLibs/DFGraphics/OpenGLGraphics.cpp:2334)
Anim: anims\dartnew\landsoft.jan: loaded (1 frames latency)
Anim: anims\dartnew\balloonmount.jan: loaded (1 frames latency)
Anim: anims\thought_bubble\ballmount.jan: loaded (1 frames latency)
Anim: anims\dartnew\balloonidlefb.jan: loaded (1 frames latency)
Anim: anims\dartnew\bubblejump.jan: loaded (1 frames latency)
ERROR: CBuffer::~CBuffer->alDeleteBuffers reports AL_INVALID_NAME error.
*** glibc detected *** ./Psychonauts: double free or corruption (!prev): 0x13b07638 ***
======= Backtrace: =========
/usr/lib32/libc.so.6(+0x734d2)[0xf740d4d2]
/usr/lib32/libstdc++.so.6(_ZdlPv+0x1f)[0xf75cf8bf]
./Psychonauts(_ZN7CSource8SetStateEib+0xe2)[0x820061a]
./Psychonauts(_ZN9CAudioDrv10StopTracksEPll+0xa1)[0x81faacd]
./Psychonauts(_ZN20ISACTVoiceController9StopVoiceEPv+0x111)[0x823cb27]
./Psychonauts(_ZN7CPlayer10StopPlayerEv+0x126)[0x8219e2a]
./Psychonauts(_Z18apiStopAudioPlayerPv+0x24)[0x824465f]
./Psychonauts(_ZN17ISACTWinInterface15StopAudioPlayerEPv+0x11)[0x824617b]
./Psychonauts(_ZN8EChannel4StopEb+0x64)[0x81c8fac]
./Psychonauts(_ZN18EISACTSoundManager12stopAllByCueEjb+0x9c)[0x81c830a]
./Psychonauts(_ZN18EISACTSoundManager12StopSoundCueEjjj+0xf5)[0x81c5beb]
./Psychonauts(_ZN19EBallControlHandler10DeactivateEv+0x258)[0x8288c20]
./Psychonauts(_ZN7GameApp17SetControlHandlerE20CONTROL_HANDLER_TYPEPv+0x55)[0x82dbbdb]
./Psychonauts(_ZN15EControlHandler13TryAttachPoleEv+0x90)[0x82baa4a]
./Psychonauts(_ZN19EBallControlHandler23HandleControls_InternalER5Input+0x9cd)[0x828ab53]
./Psychonauts(_ZN15EControlHandler14HandleControlsER5Input+0x272)[0x82b7e5e]
./Psychonauts(_ZN7GameApp9InitFrameEv+0x9e2)[0x82d651e]
./Psychonauts(_ZN9PCGameApp9InitFrameEv+0x11)[0x83161af]
./Psychonauts(main+0x298)[0x8522ac2]
/usr/lib32/libc.so.6(__libc_start_main+0xf5)[0xf73b33d5]
./Psychonauts[0x810fd41]
======= Memory map: ========
08048000-08685000 r-xp 00000000 08:11 267206                             /run/media/david/e299948f-cdd9-4655-aa1f-ef5f74d5a321/david/Games/psychonauts/Psychonauts
08685000-08686000 r-xp 0063c000 08:11 267206                             /run/media/david/e299948f-cdd9-4655-aa1f-ef5f74d5a321/david/Games/psychonauts/Psychonauts
08686000-0869a000 rwxp 0063d000 08:11 267206                             /run/media/david/e299948f-cdd9-4655-aa1f-ef5f74d5a321/david/Games/psychonauts/Psychonauts
0869a000-086ba000 rwxp 00000000 00:00 0 
09cd0000-13b59000 rwxp 00000000 00:00 0                                  [heap]
... <more memory map>
zsh: abort (core dumped)  ./Psychonauts
----

gdb's stacktrace is a little more detailed:
----
#0  0xf777e430 in __kernel_vsyscall ()
#1  0xf73c855f in raise () from /usr/lib32/libc.so.6
#2  0xf73c9e63 in abort () from /usr/lib32/libc.so.6
#3  0xf7406d75 in __libc_message () from /usr/lib32/libc.so.6
#4  0xf740d4d2 in malloc_printerr () from /usr/lib32/libc.so.6
#5  0xf75cf8bf in operator delete(void*) () from /usr/lib32/libstdc++.so.6
#6  0x0820061a in CSource::SetState(int, bool) ()
#7  0x081faacd in CAudioDrv::StopTracks(long*, long) ()
#8  0x0823cb27 in ISACTVoiceController::StopVoice(void*) ()
#9  0x08219e2a in CPlayer::StopPlayer() ()
#10 0x0824465f in apiStopAudioPlayer(void*) ()
#11 0x0824617b in ISACTWinInterface::StopAudioPlayer(void*) ()
#12 0x081c8fac in EChannel::Stop(bool) ()
#13 0x081c830a in EISACTSoundManager::stopAllByCue(unsigned int, bool) ()
#14 0x081c5beb in EISACTSoundManager::StopSoundCue(unsigned int, unsigned int, unsigned int) ()
#15 0x08288c20 in EBallControlHandler::Deactivate() ()
#16 0x082dbbdb in GameApp::SetControlHandler(CONTROL_HANDLER_TYPE, void*) ()
#17 0x082baa4a in EControlHandler::TryAttachPole() ()
#18 0x0828ab53 in EBallControlHandler::HandleControls_Internal(Input&) ()
#19 0x082b7e5e in EControlHandler::HandleControls(Input&) ()
#20 0x082d651e in GameApp::InitFrame() ()
#21 0x083161af in PCGameApp::InitFrame() ()
#22 0x08522ac2 in main ()
----

I've also got a core dump, if it'll help.

Cheers,
-- David
Comment 2 dart 2012-06-04 21:15:04 EDT
Im using the patch, i get this when im at the the levitation badge area.

It happens prolly every 10 minutes or so. i cant figure out what exactly triggers it

http://pastebin.com/hZ3BrzgN
Comment 3 simon 2012-06-05 06:57:31 EDT
workaround for 12.04 (your mileage may vary). Make sure openAL is installed and do:

cd gamedir
mv libopenal.so.1 libopenal.so.1_old
ln --symbolic /usr/lib/i386-linux-gnu/libopenal.so.1 libopenal.so.1
Comment 4 Ryan C. Gordon 2012-06-05 08:54:18 EDT
(In reply to comment #3)
> workaround for 12.04 (your mileage may vary). Make sure openAL is installed and
> do:

This isn't a workaround; we're shipping the same OpenAL you would install on your system, more or less. You can do this (and we encourage you to if your audio hardware isn't working well with Psychonauts out of the box), but you'll probably still hit this bug.

(technical explanation follows...you can skip this if you don't care.)

The reason this appears to crash in the audio code is because the audio code does a lot of memory allocation and deallocation. This being an Xbox1 game originally, where memory is a very tight resource, Psychonauts takes a lot of effort to _not_ allocate memory on a frame-by-frame basis. The ISACT library (the PC-specific audio code that sits on top of OpenAL) has no such concern, though.

Since this is where most of the memory management is happening, when we overflow a buffer that will cause the next malloc() to fail like this, regardless of where that malloc() is in relation to the real bug, that malloc() is almost always in the ISACT library, so it tends to manifest as a crash in or near OpenAL.

--ryan.
Comment 5 simon 2012-06-05 08:58:52 EDT
Hi ryan

Thanks for the reply, I agree it's not ideal, but it does work around the problem. Since doing this I have only suffered one crash in 3 hour of play, compared to one every ten minutes with the shipped openAL.




(In reply to comment #4)
> (In reply to comment #3)
> > workaround for 12.04 (your mileage may vary). Make sure openAL is installed and
> > do:
> 
> This isn't a workaround; we're shipping the same OpenAL you would install on
> your system, more or less. You can do this (and we encourage you to if your
> audio hardware isn't working well with Psychonauts out of the box), but you'll
> probably still hit this bug.
> 
> (technical explanation follows...you can skip this if you don't care.)
> 
> The reason this appears to crash in the audio code is because the audio code
> does a lot of memory allocation and deallocation. This being an Xbox1 game
> originally, where memory is a very tight resource, Psychonauts takes a lot of
> effort to _not_ allocate memory on a frame-by-frame basis. The ISACT library
> (the PC-specific audio code that sits on top of OpenAL) has no such concern,
> though.
> 
> Since this is where most of the memory management is happening, when we
> overflow a buffer that will cause the next malloc() to fail like this,
> regardless of where that malloc() is in relation to the real bug, that malloc()
> is almost always in the ISACT library, so it tends to manifest as a crash in or
> near OpenAL.
> 
> --ryan.
Comment 6 dart 2012-06-05 20:53:10 EDT
perhaps as a [gentoo] x86_x64 user this solution doesn't bode well for me. 


I can only get it from here /usr/lib32/libopenal.so.1, and the 64bit wouldn't work to well.

That being said, When i tried replacing the file, I could no longer use any form of mouse input in the game.




(In reply to comment #5)
> Hi ryan
> 
> Thanks for the reply, I agree it's not ideal, but it does work around the
> problem. Since doing this I have only suffered one crash in 3 hour of play,
> compared to one every ten minutes with the shipped openAL.
Comment 7 simon 2012-06-06 07:43:41 EDT
Is it possible that your CFLAGS are a bit too cleaver and causing a problem? (or maybe your GCC version)

The openAL installed on my system is 1:1.13-4ubuntu3

Maybe try using one from:
http://packages.debian.org/squeeze/libopenal1
http://packages.debian.org/wheezy/libopenal1
 

 
(In reply to comment #6)
> perhaps as a [gentoo] x86_x64 user this solution doesn't bode well for me. 
> 
> 
> I can only get it from here /usr/lib32/libopenal.so.1, and the 64bit wouldn't
> work to well.
> 
> That being said, When i tried replacing the file, I could no longer use any
> form of mouse input in the game.
> 
> 
> 
> 
> (In reply to comment #5)
> > Hi ryan
> > 
> > Thanks for the reply, I agree it's not ideal, but it does work around the
> > problem. Since doing this I have only suffered one crash in 3 hour of play,
> > compared to one every ten minutes with the shipped openAL.
Comment 8 Ashley 2012-06-07 07:49:23 EDT
Ubuntu 12.04, 64-bit, nvidia GT220, on-board Intel Corporation 82801I (ICH9 Family) HD Audio Controller.  Using HIB5 build 2 (the version posted on 06/05/2012).

I have what I believe is the same problem.  I'm running around in the camp before during Basic Braining, and I get random crashes.  For instance, when sliding down the ladder beneath the iron grating next to one of the huts, I got a crash this morning as I reached the bottom of the ladder.

Sounds like the strack trace isn't useful, but here it is anyway:


#0  0xf77a9430 in __kernel_vsyscall ()
#1  0xf73fd1ef in raise () from /lib/i386-linux-gnu/libc.so.6
#2  0xf7400835 in abort () from /lib/i386-linux-gnu/libc.so.6
#3  0xf74382fa in ?? () from /lib/i386-linux-gnu/libc.so.6
#4  0xf7442e42 in ?? () from /lib/i386-linux-gnu/libc.so.6
#5  0xf766751f in operator delete(void*) () from /usr/lib/i386-linux-gnu/libstdc++.so.6
#6  0x0820061a in CSource::SetState(int, bool) ()
#7  0x081faacd in CAudioDrv::StopTracks(long*, long) ()
#8  0x0823cb27 in ISACTVoiceController::StopVoice(void*) ()
#9  0x08219e2a in CPlayer::StopPlayer() ()
#10 0x0824465f in apiStopAudioPlayer(void*) ()
#11 0x0824617b in ISACTWinInterface::StopAudioPlayer(void*) ()
#12 0x081c8fac in EChannel::Stop(bool) ()
#13 0x081c830a in EISACTSoundManager::stopAllByCue(unsigned int, bool) ()
#14 0x081c5beb in EISACTSoundManager::StopSoundCue(unsigned int, unsigned int, unsigned int) ()
#15 0x0850123f in ?? ()
#16 0x08501138 in ?? ()
#17 0x081e7431 in ?? ()
#18 0x081e7590 in luaD_call ()
#19 0x081f790c in luaV_execute ()
#20 0x081e75ae in luaD_call ()
#21 0x081f790c in luaV_execute ()
#22 0x081e75ae in luaD_call ()
#23 0x081e76c1 in ?? ()
#24 0x081e7c13 in luaD_runprotected ()
#25 0x081e7701 in lua_call ()
#26 0x0842463a in EMeshEntity::ExecuteAction(EActionPos&, bool) ()
#27 0x08424986 in EMeshEntity::RunActions(EActionPos&, bool) ()
#28 0x08423b80 in EMeshEntity::SetNewAction_internal(int, bool, char const*) ()
#29 0x08423737 in EMeshEntity::SetNewActionEx(int, char const*, bool, char const*) ()
#30 0x0830b19a in ELadderControlHandler::HandleControls_Internal(Input&) ()
#31 0x082b7e5e in EControlHandler::HandleControls(Input&) ()
#32 0x082d651e in GameApp::InitFrame() ()
#33 0x083161af in PCGameApp::InitFrame() ()
#34 0x08522ac2 in main ()
Comment 9 Jes Andersen 2012-06-18 11:15:26 EDT
I can confirm the bug on my system. Unlike most of the others this was on Linux Mint Debian Edition.

I run with the binary nvidia drivers.

My guess as programmer this is due to some limit on simultaneous sounds.

The bug appears really often in the levitate course (in fact so often I have not yet managed to complete it)

I assume this is due to the constant buzzing of the levitate ball, but not something I can confirm at all.
Comment 10 Ryan C. Gordon 2012-06-20 11:48:59 EDT
(I'm adding this comment to many bugs that this fix might apply to...sorry if you see it multiple times or it doesn't _actually_ fix your issue.)

Here is a new test build, please try it and report back. It's a 2.1 megabyte
download, so you don't have to redownload the whole game again.

This is meant to fix crash bugs mostly. We still have rendering issues, etc to sort out. If this didn't fix your issue, please report it on this bug. If there are still other unrelated issues, please file a new bug or add yourself to the CC list of one of the other bugs. Here's the open bug list if you want to check for others with the same problem:

    https://bugzilla.icculus.org/buglist.cgi?query_format=specific&bug_status=__open__&product=Psychonauts

Steam users: you'll get this through Steam shortly.

Linux users, download this...

  http://treefort.icculus.org/psychonauts/psychonauts-linux-0.3-patch.tar.bz2

...and unpack it. Overwrite Psychonauts and libSDL-1.2.so.0 with it. This works with either of the first two builds from HumbleBundle.com.

Mac users that aren't using Steam, download this...

  http://treefort.icculus.org/psychonauts/psychonauts-mac-0.3-patch.tar.bz2

...double click it, and run the patcher program it produces.

We'll do a more formal build once we get some feedback.

--ryan.
Comment 11 Jes Andersen 2012-06-20 14:38:07 EDT
I can confirm the fix works forme. Does causea minor side effect of having to wait long between speech sound (or just press a button in most places)

Good work ;)
Comment 12 Ryan C. Gordon 2012-06-20 23:54:06 EDT
(In reply to comment #11)
> I can confirm the fix works forme. Does causea minor side effect of having to
> wait long between speech sound (or just press a button in most places)

Yeah, we'll be tracking that issue on Bug #5680. Fix one thing, break another.  :)

--ryan.
Comment 13 Ryan C. Gordon 2012-06-21 15:01:23 EDT
Consolidating bugs...

--ryan.

*** This bug has been marked as a duplicate of bug 5683 ***