Closed hazelnot closed 3 years ago
Can't repro this by blowing up the barrels immediately after starting the map. Does your game crash in Soviet 1 as well when you blow up the barrels in the map?
Nope, barrels seem to be fine in every mission other than this one, and like I said, I suspect it might have to do with the oil derrick's explosion, or a smudge that it's supposed to create after the explosion.
Hmm, looking at smudge.cpp, the section that causes the crash is used for removing building bibs after they've been destroyed, and that makes sense since in Soviets 1 none of the enemy buildings on the map have bibs. I'll continue to investigate.
Edit: YUP, I get a crash whenever a building with a bib is removed, even selling causes it.
I actually reproduced this by selling the radar.
Here's a backtrace of the crash with a backtrace of the previous free (that sets IsActive = false):
Thread 1 "vanillara" hit Breakpoint 1, SmudgeClass::operator delete (ptr=0xcc7d028d72d26800) at /home/hifi/work/Vanilla-Conquer/redalert/smudge.cpp:87
87 {
#0 SmudgeClass::operator delete (ptr=0xcc7d028d72d26800) at /home/hifi/work/Vanilla-Conquer/redalert/smudge.cpp:87
#1 0x000055555567749e in SmudgeClass::~SmudgeClass (this=0x555557022020, __in_chrg=<optimized out>) at /home/hifi/work/Vanilla-Conquer/redalert/smudge.h:77
#2 0x00005555556779de in SmudgeClass::Mark (this=0x555557022020, mark=MARK_DOWN) at /home/hifi/work/Vanilla-Conquer/redalert/smudge.cpp:223
#3 0x0000555555642ebc in ObjectClass::Unlimbo (this=0x555557022020, coord=4294967295) at /home/hifi/work/Vanilla-Conquer/redalert/object.cpp:1480
#4 0x0000555555677603 in SmudgeClass::SmudgeClass (this=0x555557022020, type=SMUDGE_BIB3, pos=4294967295, house=HOUSE_NONE) at /home/hifi/work/Vanilla-Conquer/redalert/smudge.cpp:120
#5 0x000055555559de7b in BuildingClass::Mark (this=0x555557cad5e0, mark=MARK_UP) at /home/hifi/work/Vanilla-Conquer/redalert/building.cpp:759
#6 0x0000555555642ca2 in ObjectClass::Limbo (this=0x555557cad5e0) at /home/hifi/work/Vanilla-Conquer/redalert/object.cpp:1429
#7 0x00005555556554ef in RadioClass::Limbo (this=0x555557cad5e0) at /home/hifi/work/Vanilla-Conquer/redalert/radio.cpp:260
#8 0x00005555555a2ed2 in BuildingClass::Limbo (this=0x555557cad5e0) at /home/hifi/work/Vanilla-Conquer/redalert/building.cpp:2506
#9 0x000055555559e748 in BuildingClass::AI (this=0x555557cad5e0) at /home/hifi/work/Vanilla-Conquer/redalert/building.cpp:966
#10 0x0000555555630549 in LogicClass::AI (this=0x5555557a1420 <Logic>) at /home/hifi/work/Vanilla-Conquer/redalert/logic.cpp:350
#11 0x00005555555c81f2 in Main_Loop () at /home/hifi/work/Vanilla-Conquer/redalert/conquer.cpp:1958
#12 0x00005555555c4e07 in Main_Game (argc=2, argv=0x7fffffffddf8) at /home/hifi/work/Vanilla-Conquer/redalert/conquer.cpp:323
#13 0x000055555567a007 in main (argc=2, argv=0x7fffffffddf8) at /home/hifi/work/Vanilla-Conquer/redalert/startup.cpp:578
assert 'IsActive' failed at line 249 in module /home/hifi/work/Vanilla-Conquer/redalert/smudge.cpp.
Prog_End()assert 'IsActive' failed at line 249 in module /home/hifi/work/Vanilla-Conquer/redalert/smudge.cpp.
[Thread 0x7ffff5cfb640 (LWP 303732) exited]
[Thread 0x7ffff5efc640 (LWP 303731) exited]
[Thread 0x7ffff66fd640 (LWP 303730) exited]
Thread 1 "vanillara" received signal SIGSEGV, Segmentation fault.
SmudgeClass::Disown (this=0x555557022020, cell=7485) at /home/hifi/work/Vanilla-Conquer/redalert/smudge.cpp:251
251 if (Class->IsBib) {
(gdb) bt
#0 SmudgeClass::Disown (this=0x555557022020, cell=7485) at /home/hifi/work/Vanilla-Conquer/redalert/smudge.cpp:251
#1 0x000055555559de9f in BuildingClass::Mark (this=0x555557cad5e0, mark=MARK_UP) at /home/hifi/work/Vanilla-Conquer/redalert/building.cpp:761
#2 0x0000555555642ca2 in ObjectClass::Limbo (this=0x555557cad5e0) at /home/hifi/work/Vanilla-Conquer/redalert/object.cpp:1429
#3 0x00005555556554ef in RadioClass::Limbo (this=0x555557cad5e0) at /home/hifi/work/Vanilla-Conquer/redalert/radio.cpp:260
#4 0x00005555555a2ed2 in BuildingClass::Limbo (this=0x555557cad5e0) at /home/hifi/work/Vanilla-Conquer/redalert/building.cpp:2506
#5 0x000055555559e748 in BuildingClass::AI (this=0x555557cad5e0) at /home/hifi/work/Vanilla-Conquer/redalert/building.cpp:966
#6 0x0000555555630549 in LogicClass::AI (this=0x5555557a1420 <Logic>) at /home/hifi/work/Vanilla-Conquer/redalert/logic.cpp:350
#7 0x00005555555c81f2 in Main_Loop () at /home/hifi/work/Vanilla-Conquer/redalert/conquer.cpp:1958
#8 0x00005555555c4e07 in Main_Game (argc=2, argv=0x7fffffffddf8) at /home/hifi/work/Vanilla-Conquer/redalert/conquer.cpp:323
#9 0x000055555567a007 in main (argc=2, argv=0x7fffffffddf8) at /home/hifi/work/Vanilla-Conquer/redalert/startup.cpp:578
EDIT: Updated backtraces from a recent vanilla branch build so the line numbers line up.
I'm betting is due to line 118 in smudge.cpp. It compares an unsigned 64bit long (on linux) against -1, but the ctor default value is actually 0xFFFFFFFF which is a 32bit -1. Both the default value and the comparison need to be against the same value to prevent it deleting itself before the bib code has a chance to fire.
PR #229 should fix this crash though it needs confirming as I coded it blind on windows.
I think the explosion of the oil derrick might be causing it, cause that's about when the crash happens, but I can't get in there to properly test it without getting zapped by the Tesla Coils or getting a grenade thrown by an enemy onto the barrels.
This is the gdb log: