Opened 13 years ago

Closed 13 years ago

#833 closed defect (fixed)

Consistent Assertion Failures with sound enabled when loading maps with large battles

Reported by: brian Owned by: Jan Wassenberg
Priority: Release Blocker Milestone: Alpha 5
Component: Core engine Keywords:
Cc: Patch:

Description

Ubuntu 11.04 (Classic Gnome Desktop - not unity), ATI 5770 with official proprietary drivers

r9403 (and possibly earlier) I get an error if I run the large_combat_demo or we_are_legion. They do not give the assertion failure immediately though. I even got it on the Latium RMS during a battle. It does not cause the error when using -quickstart.


Assertion failed: "cpu_CAS(&al_srcs_allocationStates[i], kInUse, kAvailable)" Location: snd_mgr.cpp:561 (al_src_free)

Call stack:

(0x8369c30) /home/brian/Desktop/Link to pyrogenesis() [0x8369c30] (0x83212a4) /home/brian/Desktop/Link to pyrogenesis() [0x83212a4] (0x83215a7) /home/brian/Desktop/Link to pyrogenesis() [0x83215a7] (0x8321a45) /home/brian/Desktop/Link to pyrogenesis() [0x8321a45] (0x833fd43) /home/brian/Desktop/Link to pyrogenesis() [0x833fd43] (0x833ffef) /home/brian/Desktop/Link to pyrogenesis() [0x833ffef] (0x8333ae9) /home/brian/Desktop/Link to pyrogenesis() [0x8333ae9] (0x833febf) /home/brian/Desktop/Link to pyrogenesis() [0x833febf] (0x833f048) /home/brian/Desktop/Link to pyrogenesis() [0x833f048] (0x8343c4e) /home/brian/Desktop/Link to pyrogenesis() [0x8343c4e] (0x8056198) /home/brian/Desktop/Link to pyrogenesis() [0x8056198] (0xb6e1ae37) /lib/i386-linux-gnu/libc.so.6(libc_start_main+0xe7) [0xb6e1ae37] (0x8054f01) /home/brian/Desktop/Link to pyrogenesis() [0x8054f01]

errno = 0 (?) OS error = ?


Change History (6)

comment:1 by brian, 13 years ago

Milestone: BacklogAlpha 5
Priority: Should HaveRelease Blocker

comment:2 by brian, 13 years ago

Owner: set to Jan Wassenberg

comment:3 by Philip Taylor, 13 years ago

Easier steps to reproduce: Open We are Legion. Select all the units. Press delete and OK.

snd_mgr.cpp(561): Assertion failed: "cpu_CAS(&al_srcs_allocationStates[i], kInUse, kAvailable)"
Assertion failed: "cpu_CAS(&al_srcs_allocationStates[i], kInUse, kAvailable)"
Location: snd_mgr.cpp:561 (al_src_free)

#1  0x0000000000ab6af0 in debug_break () at ../../../source/lib/sysdep/os/unix/udbg.cpp:43
#2  0x0000000000a6487a in al_src_free (al_src=33) at ../../../source/lib/res/sound/snd_mgr.cpp:561
#3  0x0000000000a66c45 in vsrc_reclaim (vs=0x485ecd0) at ../../../source/lib/res/sound/snd_mgr.cpp:1743
#4  0x0000000000a65c37 in VSrc_dtor (vs=0x485ecd0) at ../../../source/lib/res/sound/snd_mgr.cpp:1280
#5  0x0000000000a56542 in h_free_idx (idx=308, hd=0x485eca0) at ../../../source/lib/res/h_mgr.cpp:615
#6  0x0000000000a567ab in h_free (h=@0x485ecd0, type=0xf0e3e0) at ../../../source/lib/res/h_mgr.cpp:662
#7  0x0000000000a663c6 in snd_free (hvs=@0x485ecd0) at ../../../source/lib/res/sound/snd_mgr.cpp:1388
#8  0x0000000000a6761e in reclaim (vs=0x485ecd0) at ../../../source/lib/res/sound/snd_mgr.cpp:2021
#9  0x0000000000a6784b in list_foreach<void (*)(VSrc*)> (callback=0xa675df <reclaim(VSrc*)>, numToSkip=64, end_idx=0) at ../../../source/lib/res/sound/snd_mgr.cpp:1431
#10 0x0000000000a676a5 in vm_update () at ../../../source/lib/res/sound/snd_mgr.cpp:2042
#11 0x0000000000a67731 in snd_update (pos=0x14c27a0, dir=0x14c2790, up=0x7fffffffd750) at ../../../source/lib/res/sound/snd_mgr.cpp:2074
#12 0x000000000061e3e6 in Frame () at ../../../source/main.cpp:355
#13 0x000000000061edd9 in RunGameOrAtlas (argc=2, argv=0x7fffffffdac8) at ../../../source/main.cpp:492
#14 0x000000000061eeaa in main (argc=2, argv=0x7fffffffdac8) at ../../../source/main.cpp:511

comment:4 by Jan Wassenberg, 13 years ago

Works for me :/ I selected the full complement of 64 and deleted as requested. Quite a cacophony, but no crash (nor when deleting the second batch of 43) and a clean exit.

comment:5 by Jan Wassenberg, 13 years ago

Since I'm unable to reproduce and static analysis hasn't given more insight, could you please generate some more info?

1) Is that al_srcs_allocationState 'just' kAvailable (i.e. double-free) or something else entirely?

2) A debug_printf in each al_src_alloc/al_src_free indicating the index, al_src and allocationState would be helpful.

Hopefully I can see the problem then.

comment:6 by Jan Wassenberg, 13 years ago

Resolution: fixed
Status: newclosed

(In [9477]) avoid double-free when sounds are reclaimed and then freed. fixes #833

Note: See TracTickets for help on using tickets.