Segmentation fault when having a wrong alsa-out-device setting in openalrc

Intended behaviour or bugs in other software.
Locked
Haudrauf
Greenhorn
Posts: 6
Joined: 27 Aug 2006, 15:31

Segmentation fault when having a wrong alsa-out-device setting in openalrc

Post by Haudrauf »

Warzone2100 Version
2.0.4 (own-compiled and your binary affected)

Operating System
Linux goten 2.6.16-gentoo-r3 #1 PREEMPT Fri Aug 18 18:14:43 CEST 2006 i686 AMD Athlon(tm) Processor GNU/Linux

Hardware Information
AMD Athlon Thunderbird 1200mhz, NVidia Geforce2 GTS, 384mb ram

Warzone2100 Configuration
Hm? Standard, I guess. Using

Code: Select all

warzone2100 --viewport 800x600 --savegame hehe1.gam --fullscreen
to start it.

Bug Description
I load my savegame. As soon as I see the game screen with my moving tanks, it takes 5 seconds then it segfaults. Savegame is attached to this post.
Attachments
hehe1.zip
(241.3 KiB) Downloaded 1088 times
Last edited by DevUrandom on 04 Sep 2006, 19:00, edited 1 time in total.
User avatar
DevUrandom
Regular
Regular
Posts: 1690
Joined: 31 Jul 2006, 23:14

Re: A segmentation fault from somewhere

Post by DevUrandom »

Hi!

Thanks for the report!

I just tried the savegame on my box using the current svn version and it did not crash. So either this is allready fixed or it is some Warzone-weirdness going on. ;)

Could you attach a backtrace so I can have a look?

That would help a lot, thanks,
Dennis
Haudrauf
Greenhorn
Posts: 6
Joined: 27 Aug 2006, 15:31

Re: A segmentation fault from somewhere

Post by Haudrauf »

Hi random device,

this topic here got me suspicious.. http://wz.rootzilla.de/forum/index.php?topic=53.0

..so I tried to manually install the latest OpenAL and recompile warzone 2.0.4.
Warzone had no sound then.. :) But the crash did NOT happen - I saved again and then installed the old OpenAL I had before, recompiled Warzone (just in case) and could go on playing.

My OpenAL version was 0.0.8
See http://www.gentoo-portage.com/media-libs/openal (latest that gentoo offers)

-------

Code: Select all

(gdb) run
Starting program: /usr/local/bin/warzone2100 1024x768 --savegame hehe1.gam --fullscreen
[Thread debugging using libthread_db enabled]
[New Thread -1224173872 (LWP 30707)]
ALSA lib confmisc.c:670:(snd_func_card_driver) cannot find card '1'
ALSA lib conf.c:3479:(_snd_config_evaluate) function snd_func_card_driver returned error: No such device
ALSA lib confmisc.c:391:(snd_func_concat) error evaluating strings
ALSA lib conf.c:3479:(_snd_config_evaluate) function snd_func_concat returned error: No such device
ALSA lib confmisc.c:1070:(snd_func_refer) error evaluating name
ALSA lib conf.c:3479:(_snd_config_evaluate) function snd_func_refer returned error: No such device
ALSA lib conf.c:3947:(snd_config_expand) Evaluate error: No such device
ALSA lib pcm.c:2146:(snd_pcm_open_noupdate) Unknown PCM surround51:1,0
[New Thread -1269642320 (LWP 30710)]

Program received signal SIGSEGV, Segmentation fault.
[Switching to Thread -1269642320 (LWP 30710)]
0xb7d0073a in alDistanceModel () from /usr/lib/libopenal.so.0
(gdb) Fatal signal: Segmentation Fault (SDL Parachute Deployed)
Terminated
Couldn't start backtracing.. Screen hang and I needed to kill gdb.
Last edited by Haudrauf on 03 Sep 2006, 03:43, edited 1 time in total.
User avatar
DevUrandom
Regular
Regular
Posts: 1690
Joined: 31 Jul 2006, 23:14

Re: A segmentation fault from somewhere

Post by DevUrandom »

You could start in --window mode. ;)
You always seem to get the segfault in alDistanceModel(), I don't think that was the function where the other reported segfault happened. So a full backtrace might be really useful.
It would be nice if you could do a debug compile and then fetch a "bt full" with gdb. (If you don't want to compile again a normal "bt" would be ok, too.)
Haudrauf
Greenhorn
Posts: 6
Joined: 27 Aug 2006, 15:31

Re: A segmentation fault from somewhere

Post by Haudrauf »

!!  :D

I found something (no idea where it was) that pointed me to /etc/openalrc.
I had some surround device as output device:

Code: Select all

# Use ALSA (also valid: sdl, native)
(define devices '(alsa))

# Four speaker surround with ALSA
(define speaker-num 2)
(define alsa-out-device "surround51:1,0")

# For ALSA-in support (ie. voice chat)
(define alsa-in-device "hw:1,0")
Notice "surround51:1,0" which was my faulty setting. I changed it to "hw:0,0" and now I can load the savegame and it does NOT crash after 5 seconds.

Small backtrace (no debug build): -- How do I actually build the debug version? (manually, not with the gentoo package)  :'(

Code: Select all

(gdb) run
Starting program: /usr/local/bin/warzone2100 --savegame hehe1.gam --window
[Thread debugging using libthread_db enabled]
[New Thread -1224210736 (LWP 10723)]
ALSA lib confmisc.c:670:(snd_func_card_driver) cannot find card '1'
ALSA lib conf.c:3479:(_snd_config_evaluate) function snd_func_card_driver returned error: No such device
ALSA lib confmisc.c:391:(snd_func_concat) error evaluating strings
ALSA lib conf.c:3479:(_snd_config_evaluate) function snd_func_concat returned error: No such device
ALSA lib confmisc.c:1070:(snd_func_refer) error evaluating name
ALSA lib conf.c:3479:(_snd_config_evaluate) function snd_func_refer returned error: No such device
ALSA lib conf.c:3947:(snd_config_expand) Evaluate error: No such device
ALSA lib pcm.c:2146:(snd_pcm_open_noupdate) Unknown PCM surround51:1,0
[New Thread -1266242640 (LWP 10726)]

Program received signal SIGSEGV, Segmentation fault.
[Switching to Thread -1266242640 (LWP 10726)]
0xb7cf7751 in alDistanceModel () from /usr/lib/libopenal.so.0
(gdb) bt
#0  0xb7cf7751 in alDistanceModel () from /usr/lib/libopenal.so.0
#1  0x00000000 in ?? ()

Last edited by Haudrauf on 03 Sep 2006, 23:42, edited 1 time in total.
User avatar
DevUrandom
Regular
Regular
Posts: 1690
Joined: 31 Jul 2006, 23:14

Re: A segmentation fault from somewhere

Post by DevUrandom »

So this was a bug in OpenAL, segfaulting with wrong openalrc settings. (You might want to report this to Gentoo/OpenAL?)

The backtrace was ... very small. ;) But as the problem is not in Warzone this is normal.
You can compile Warzone in debug mode with ./configure --enable-debug, an alternative to asking would have been to look into the ebuild. ;)
But for this bug you don't need another backtrace. At least not for us. (Perhaps OpenAL wants one, but then you need a debug build of OpenAL...)
Locked