Ticket #577 (closed defect: fixed)

Opened 3 years ago

Last modified 2 years ago

[PATCH] Crash when moving large masses of soldiers

Reported by: sireus Owned by:
Priority: Must Have Milestone: Alpha 5
Component: Core engine Keywords: crash sound-manager
Cc: jan

Description

The following happens ocasionally after 20 minutes or so of playing, with lots of soldiers (30-40) and few other units.

Now, if I select as many soldiers as I can (selection limit) and then try move them to another location, the game crashes. Remember, this does not happen every time (I'd say every tenth attempt, but that's just guessing) and is quite hard to reconstruct exactly. It just happens.

Judging from the crashlog, I'd say it's a bug in the sound manager, but I don't have any experience with the code, so don't listen to me :)

As far as I an tell, it doesn't matter on which map I'm playing, and I haven't yet found any other patterns.

Attachments

crashlog.txt (45.3 KB) - added by sireus 3 years ago.
crashlog
crashlog.2.txt (45.3 KB) - added by sireus 3 years ago.
crashlog
debugger.txt (2.8 KB) - added by sireus 3 years ago.
Debugging output
logs.tar.gz (5.5 KB) - added by ImG 3 years ago.
all my logs
0adoutput.txt (3.5 KB) - added by ImG 3 years ago.
0ad > 0adoutput.txt
debug_output_1.txt (10.8 KB) - added by passerby 2 years ago.
crashlog.3.txt (5.9 KB) - added by comp3820 2 years ago.
crashlog.dmp (66.2 KB) - added by comp3820 2 years ago.
diff-bug-snd_mgr-20-03-2011.patch (1.3 KB) - added by Badmadblacksad 2 years ago.
alt 1
diff-bug-snd_mgr-20-03-2011-alt.patch (1023 bytes) - added by Badmadblacksad 2 years ago.
alt 2

Change History

Changed 3 years ago by sireus

crashlog

Changed 3 years ago by sireus

crashlog

comment:1 Changed 3 years ago by Philip

  • Cc jan added

comment:2 Changed 3 years ago by anonymous

  • Milestone Unclassified deleted

Milestone Unclassified deleted

comment:3 Changed 3 years ago by wacko

  • Milestone set to OS Alpha 2

Changed 3 years ago by sireus

Debugging output

comment:4 follow-up: ↓ 6 Changed 3 years ago by jan

Bummer, that's not good. I've not been able to repro this on Windows (despite moving lots of troops around on the combat-demo-huge map).

Is there any chance you could add printfs to srcs_insert and srcs_remove to see if there's anything out of the ordinary? Knowing whether insert/remove are mismatched, or if random corruption is occurring would help a lot.

comment:5 Changed 3 years ago by k776

  • Milestone changed from OS Alpha 2 to OS Alpha 3

comment:6 in reply to: ↑ 4 Changed 3 years ago by sireus

First of all, sorry for the late reply. Unfortunately I just changed OS (now using Arch instead of Ubuntu), so even I can't reproduce it any more. Until now everything works.

comment:7 Changed 3 years ago by ImG

  • Priority changed from major to critical

combat-demo-huge map crashed every time I start it.

Changed 3 years ago by ImG

all my logs

Changed 3 years ago by ImG

0ad > 0adoutput.txt

comment:8 Changed 3 years ago by k776

  • Milestone changed from Alpha 3 to Alpha 4

comment:9 Changed 3 years ago by k776

  • Status changed from new to closed
  • Summary changed from Crash when moving large masses of soldiers to [NEEDS INFO] Crash when moving large masses of soldiers
  • Resolution set to worksforme
  • Milestone changed from Alpha 4 to Alpha 3

Closing this as 'works for me' until you can reproduce it again. The path finding was altered a fair bit in Alpha 3, so this (hopefully) is no longer an issue.

comment:10 Changed 3 years ago by ImG

1)open combat demo (hudge) 2)atack 3)wait 7-15 seconds

it crash every time i try to do this. xmessage says: Assetrtion failed: "0" Location: snd_mgr.cpp:492 (srcs_remove)

Call stack:

(0x8285d72) /usr/games/pyrogenesis() [0x8285d72] (0x82570b8) /usr/games/pyrogenesis() [0x82570b8] (0x8257f93) /usr/games/pyrogenesis() [0x8257f93] (0x8258155) /usr/games/pyrogenesis() [0x8258155] (0x827a684) /usr/games/pyrogenesis() [0x827a684] (0x827ae4c) /usr/games/pyrogenesis() [0x827ae4c] (0x827018e) /usr/games/pyrogenesis() [0x827018e] (0x827a797) /usr/games/pyrogenesis() [0x827a797] (0x827b6ba) /usr/games/pyrogenesis() [0x827b6ba] (0x827baf4) /usr/games/pyrogenesis() [0x827baf4] (0x8055dd4) /usr/games/pyrogenesis() [0x8055dd4] (0x8056d4d) /usr/games/pyrogenesis() [0x8056d4d] (0xa3dce7) /lib/libc.so.6(libc_start_main+0xe7) [0xa3dce7] (0x80550d1) /usr/games/pyrogenesis() [0x80550d1]

errno = 0 (?) OS error = ?

OS Ubuntu 10.10, radeon hd2400(catalist 10.11) what can i do to give more information?

comment:11 Changed 3 years ago by k776

Is this using the just released Alpha 3 version? If not, please upgrade and try it on that.

Much has changed. I was not able to reproduce this problem.

comment:12 Changed 3 years ago by ImG

I use 8832 version.

comment:13 Changed 3 years ago by k776

  • Status changed from closed to reopened
  • Resolution worksforme deleted
  • Milestone changed from Alpha 3 to Alpha 4

Ok. Reopening for Alpha 4.

When you get this again, please post steps, and the crash logs.

comment:14 Changed 3 years ago by ImG

I can do this as many times as you need. It crashed every time I try to play this map and in some other maps.

I have already post steps and logs. What can I do to add more helpfull information?

comment:15 Changed 3 years ago by fabio

I can confirm this happening. My backtrace is the same of what already attached here.

comment:16 Changed 3 years ago by jan

ImG: thanks for offering :) To understand this, we need more than the backtrace, since something is apparently going wrong before the actual crash. This is what my prinf request above was aimed at. Do you have a bit of dev experience and would you be able to tackle that?

@everyone: we can work around this bug by starting with -quickstart to disable sound.

comment:17 Changed 2 years ago by Philip

#716 has a different way to reproduce this error.

Changed 2 years ago by passerby

comment:18 Changed 2 years ago by passerby

Ok now I see my first assumptions were all wrong.

I also encounter the bug on ubuntu btw.

After some debugging it is obvious that the bug appears when the application tries to play exactly same sound with interval like 0.001 secs. I have a backtrace on it (attached).

I added check in al_init if there is less than 1.0 second interval between last usage of the same sound (similarity is checked by equation of al_src). I can't reproduce the error anymore. I do realise that the fix is dirty and probably only curing symptoms, but now I can play with many units at least.

P.S. I'm new here and in open source projects overall, so don't be too angry at me if smth is wrong please :3

comment:19 Changed 2 years ago by comp3820

I just had this happen to me - at least it sounds just like it.

Attacking approximately 200 legionaries with about 100 mixed celts.

I tried the same situation again, but it did not crash.

Changed 2 years ago by comp3820

Changed 2 years ago by comp3820

comment:20 Changed 2 years ago by k776

  • Milestone changed from Alpha 4 to Alpha 5

comment:21 Changed 2 years ago by Badmadblacksad

  • Keywords sound-manager, review added; sound-manager removed
  • Summary changed from [NEEDS INFO] Crash when moving large masses of soldiers to [PATCH] Crash when moving large masses of soldiers

In snd_mgr.cpp the function snd_play() do "list_add(vs)" even if vsrc_grant() returns ERR::FAIL because it cannot allocate a source. Later al_src_free() try to free that source but can not find it in the al_srcs_used list, and the assert fail. I attached 2 patch, don't really know which one is the best.

Changed 2 years ago by Badmadblacksad

alt 1

Changed 2 years ago by Badmadblacksad

alt 2

comment:22 Changed 2 years ago by jan

Thanks for looking into this! I can't see why it would be a problem to add to the list even if vsrc_grant fails. The latter is just an attempt to reduce latency by starting the sound immediately instead of during the next update. Even if there is no source at hand, there should be no harm in inserting the VSrc into the list (there may be lots of VSrc in there that don't have a source - in fact that is the point of the VSrc abstraction layer). Wondering why the al_src would not be found, I came across http://opensource.creative.com/pipermail/openal/2006-May/009567.html And indeed, we were using 0 to indicate the source isn't valid. Instead, we now use a VS_HAS_AL_SRC flag. Does that fix the problem?

comment:23 Changed 2 years ago by Badmadblacksad

  • Status changed from reopened to closed
  • Resolution set to fixed

Yes, problem fixed. well done.

comment:24 Changed 2 years ago by jan

  • Keywords sound-manager added; sound-manager, review removed

Glad to hear it; thanks for the confirmation!

(Man, what an odyssey this ticket has been ;) It's hard to debug stuff that always works on the development machine. Unfortunately, OpenAL implementations differ significantly.)

Note: See TracTickets for help on using tickets.