View Issue Details

IDProjectCategoryView StatusLast Update
0002393Spring engineGeneralpublic2011-05-31 23:47
Reporterabma Assigned Toabma  
PrioritynormalSeveritycrashReproducibilityalways
Status resolvedResolutionfixed 
Product Version0.82.3+git 
Summary0002393: (master) crash with "Red Build/Order Menu" and >300 Units when pressing CTRL+A (Out of Memory)
Descriptioni didn't test a long time, so this crashes maybe have nothing to do with assimp

crashes sometimes with the

/cheat
/give all
/give all 1

"test"
Additional Informationhttp://pastebin.com/sfQKiMMM

git describe
0.82.3-1685-gda562a5
TagsNo tags attached.
Attached Files
git.diff (Attachment missing)
Checked infolog.txt for Errors

Relationships

related to 0002430 resolvedKloot (master) crash in zero-k 0.8.7 when using gestures-menu 

Activities

abma

2011-04-01 00:27

administrator   ~0006521

Last edited: 2011-04-01 01:10

an other one:

http://pastebin.com/1149jyvz

abma

2011-04-01 01:09

administrator   ~0006522

Last edited: 2011-04-01 01:11

damn, memory corruption?

http://pastebin.com/Li1AhhSC

abma

2011-04-01 02:21

administrator   ~0006523

Last edited: 2011-04-01 02:21

a diff-file which lists changes between master and assimp branch before merge, created with this command:

$ git diff 5ac4738e8b0a886925e5e49a72cdf9803932f68a dcc943946a693b138dc85a8a391f6b1259c15798 -- rts/Game rts/Rendering rts/Sim rts/system

maybe it helps others

abma

2011-04-01 11:53

administrator   ~0006524

an other one: (pulseaudio/efx related?)

http://pastebin.com/qnKEQstg

abma

2011-04-09 16:56

administrator   ~0006547

Last edited: 2011-04-09 17:12

git bisect log
git bisect start
# bad: [078f69eef2811695044aaac271a4b1e3b7d7f461] fix gl.PushAttrib(GL.ALL_ATTRIB_BITS)
git bisect bad 078f69eef2811695044aaac271a4b1e3b7d7f461
# good: [66de8f60e863befa61e5addaea539877dd78d064] modularized Watchdog & added Linux implementation * it can now handle any number of threads * it gives threads names - currently "main" (:= render-thread in spring-mt) & "sim" (only in spring-mt) * syntax of the Lua function changed too: Spring.ClearWatchDogTimer() --clears current thread's timer Spring.ClearWatchDogTimer("sim") --clears the timer of the "sim" thread
git bisect good d4bc8acf371156afd2255286ae6328a00e7dd203
# good: [d4bc8acf371156afd2255286ae6328a00e7dd203] buildbot: ...and fix the path here too
git bisect good d4bc8acf371156afd2255286ae6328a00e7dd203
# bad: [3e60285d073d39a39fa01b7dd3770f166e47f6c5] Fix compile error
git bisect bad 3e60285d073d39a39fa01b7dd3770f166e47f6c5
# bad: [49413d80c5b92796b60dc51eff5381c1a7a1c841] Update VCproj
git bisect bad 49413d80c5b92796b60dc51eff5381c1a7a1c841
# good: [31800c902f961270e9440efadef8b7b3a9d85ae1] add php frontend for stacktrace_translator
git bisect good 31800c902f961270e9440efadef8b7b3a9d85ae1
# bad: [cc7a70b1134f024544d58b1b9a955f61f70f650c] compile
git bisect bad cc7a70b1134f024544d58b1b9a955f61f70f650c
# good: [04584519dd2257780def04a76bc4e486fa89ae9f] Audio: readd stats of dropped sounds
git bisect good 04584519dd2257780def04a76bc4e486fa89ae9f


so, the error seems to be there:
https://github.com/spring/spring/compare/04584519dd2257780def04a76bc4e486fa89ae9f...cc7a70b1134f024544d58b1b9a955f61f70f650c

abma

2011-04-11 15:30

administrator   ~0006551

tried a few times again, 04584519dd2257780def04a76bc4e486fa89ae9f seems to be the last version without this bug.

abma

2011-04-11 18:55

administrator   ~0006552

Last edited: 2011-04-11 19:29

i tried on the same computer but with windows, crashes too:

http://pastebin.com/HtTvHsGN

translated:

http://pastebin.com/xdP1LHR3

in linux i didn't get "LuaUI::RunCallIn: error = 4, GameFrame, not enough memory"

seems to happen only sometimes
i've 4GB mem...

abma

2011-04-11 21:47

administrator   ~0006553

Last edited: 2011-04-11 21:48

an other one: (this time with zk chickens)
http://pastebin.com/KYq2emDe

translated:
http://pastebin.com/vUGQTDGJ

abma

2011-04-13 20:38

administrator   ~0006555

ok, it looks like its only an out of memory. To reproduce it faster, this works for me as well:

/cheat
/give 300 armflea

CTRL+A -> crash

Tested in BA, "Red Build/Order Menu" has to be enabled

jK

2011-04-16 12:34

developer   ~0006558

Last edited: 2011-04-16 12:34

k, a short expertise:

Lua uses a GarbageCollector, so it allocates more memory than needed.
Additionally, Lua has a few quirks. So it does _not_ save a counter for references, to detect unused objects it needs to check the whole environment.
Second, it doesn't have a "emergency GC", so Lua won't call the GC when running out of memory even when the environment is full unused/dead objects (will change with next Lua release)!
And now the only thing we can control: the way Lua creates tables. There are two ways to create tables in C: lua_newtable & lua_createtable.
Both behave similar to std::vectors. The first one just creates a vector/table and the second creates it + calls a .reserve() -> it allocs enough mem to hold all objects w/o the need to resize it.
But there is one important difference to c++ std::vectors, Lua uses a GC! So when a table is to small to hold all objects and needs to be resized IT WILL LIKELY CREATE A COMPLETE NEW ONE and LEAVES THE OLD ONE IN THE RAM UNTIL THE GC CATCHES IT! This can create _thousand_ of unused tables in the ram when using lua_newtable & filling the table with ~ 1000 entries (esp. when the GC gets called each ~3sec). - Note: it seems this is only the case for the array part of tables, for the hash one it doesn't need continuous region, so it will just alloc single blocks for those. That's why it gets influenced by rawseti/ settable.

jK

2011-05-07 14:46

developer   ~0006612

works now?

abma

2011-05-07 21:55

administrator   ~0006619

no... now it crashes after selecting commander.
gdb output:
http://pastebin.com/GieCGV3M

console output:
[f=0003296] Segmentation fault (SIGSEGV) in spring 0.82+.4.0 (Debug)
[f=0003296] Stacktrace:
[f=0003296] <0> /lib/x86_64-linux-gnu/libc.so.6(+0x33d80) [0x7ffff4831d80]
[f=0003296] <1> /var/tmp/local/spring/master/bin/spring() [0xa37b4e]
[f=0003296] <2> /var/tmp/local/spring/master/bin/spring() [0xa74341]
[f=0003296] <3> /var/tmp/local/spring/master/bin/spring() [0xa75785]
[f=0003296] <4> /usr/include/c++/4.6/bits/vector.tcc:310
[f=0003296] <5> /usr/include/c++/4.6/bits/vector.tcc:363
[f=0003296] <6> /home/abma/dev/spring/master/rts/Lua/LuaUnitRendering.cpp:442
[f=0003296] <7> /home/abma/dev/spring/master/rts/Lua/LuaUnitRendering.cpp:472
[f=0003296] <8> /home/abma/dev/spring/master/rts/Lua/LuaUnitRendering.cpp:478
[f=0003296] <9> /lib/x86_64-linux-gnu/libc.so.6(__libc_start_main+0xff) [0x7ffff481ceff]
[New Thread 0x7fffd9323700 (LWP 4382)]
[f=0003296] WARNING: failed to shutdown normally, exit forced
[f=0003296] Spring crashed Spring has crashed:
Segmentation fault (SIGSEGV).

A stacktrace has been written to:
  /home/abma/.spring/infolog.txt
[Thread 0x7fffda425700 (LWP 4363) exited]
[Thread 0x7fffdac26700 (LWP 4362) exited]
AL lib: ALc.c:1818: alcCloseDevice(): deleting 247 Buffer(s)
[Thread 0x7fffdbc62700 (LWP 4361) exited]

Program received signal SIGSEGV, Segmentation fault.
0x00007ffff50e5663 in __dynamic_cast ()
   from /usr/lib/x86_64-linux-gnu/libstdc++.so.6
(gdb) quit
A debugging session is active.

    Inferior 1 [process 4357] will be killed.


with current master and "Red Build/Order Menu" is enabled, no menu is displayed, it also sometimes crashes already when selecting the com.

infolog.txt of a non-crash start: http://pastebin.com/ZJshK3Vi


when "Red Build/Order Menu" is disabled it seems to always work.

jK

2011-05-09 13:25

developer   ~0006626

build with DEBUG2 and you should get a clean stacktrace

abma

2011-05-11 01:33

administrator   ~0006638

http://pastebin.com/QYv5DwiG

SirMaverick

2011-05-11 17:57

reporter   ~0006648

Did you try ZK? It freezes for me in master, when I open the build menu (press b on constructor). Related or separate bug?

Kloot

2011-05-31 23:19

developer   ~0006681

Does this still happen after ea431c3d23?

abma

2011-05-31 23:30

administrator   ~0006682

Last edited: 2011-05-31 23:44

no, doesn't crash, this seems to be fixed, thx! :-)

but the zero-k buildmenu / "Red Build/Order Menu" isn't displayed, don't know whats wrong there....

when "Red Build/Order Menu" widget is loaded, the background box can be seen (without buttons) but it fades out and isn't shown again when a builder is selected.

gestures in zero-k work, and the default menu is shown!

abma

2011-05-31 23:47

administrator   ~0006683

i'll open a new report for that issue, the initial problem is solved, thx! :)

Issue History

Date Modified Username Field Change
2011-04-01 00:20 abma New Issue
2011-04-01 00:27 abma Note Added: 0006521
2011-04-01 01:09 abma Note Added: 0006522
2011-04-01 01:10 abma Additional Information Updated
2011-04-01 01:10 abma Note Edited: 0006521
2011-04-01 01:11 abma Note Edited: 0006522
2011-04-01 02:20 abma File Added: git.diff
2011-04-01 02:21 abma Note Added: 0006523
2011-04-01 02:21 abma Note Edited: 0006523
2011-04-01 03:42 abma Summary crash after assimp merge => crash because of assimp merge (?)
2011-04-01 03:43 abma Additional Information Updated
2011-04-01 11:53 abma Note Added: 0006524
2011-04-01 11:56 abma Description Updated
2011-04-09 16:56 abma Note Added: 0006547
2011-04-09 16:57 abma Note Edited: 0006547
2011-04-09 17:12 abma Note Edited: 0006547
2011-04-11 15:30 abma Note Added: 0006551
2011-04-11 15:30 abma Summary crash because of assimp merge (?) => crash/mem corruption(?) after commit 04584519dd2257780def04a76bc4e486fa89ae9f
2011-04-11 18:55 abma Note Added: 0006552
2011-04-11 18:57 abma Note Edited: 0006552
2011-04-11 19:29 abma Note Edited: 0006552
2011-04-11 21:47 abma Note Added: 0006553
2011-04-11 21:48 abma Note Edited: 0006553
2011-04-13 20:38 abma Note Added: 0006555
2011-04-13 20:39 abma Summary crash/mem corruption(?) after commit 04584519dd2257780def04a76bc4e486fa89ae9f => Crash in spring master with "Red Build/Order Menu" and >300 Units when pressing CTRL+A
2011-04-13 20:39 abma Summary Crash in spring master with "Red Build/Order Menu" and >300 Units when pressing CTRL+A => Crash in spring master with "Red Build/Order Menu" and >300 Units when pressing CTRL+A (Out of Memory)
2011-04-13 20:39 abma Reproducibility sometimes => always
2011-04-16 12:34 jK Note Added: 0006558
2011-04-16 12:34 jK Note Edited: 0006558
2011-05-07 14:46 jK Note Added: 0006612
2011-05-07 21:55 abma Note Added: 0006619
2011-05-09 13:25 jK Note Added: 0006626
2011-05-11 01:33 abma Note Added: 0006638
2011-05-11 17:57 SirMaverick Note Added: 0006648
2011-05-15 21:13 abma Relationship added related to 0002430
2011-05-31 15:16 abma Summary Crash in spring master with "Red Build/Order Menu" and >300 Units when pressing CTRL+A (Out of Memory) => (master) crash with "Red Build/Order Menu" and >300 Units when pressing CTRL+A (Out of Memory)
2011-05-31 23:19 Kloot Note Added: 0006681
2011-05-31 23:19 Kloot Status new => feedback
2011-05-31 23:30 abma Note Added: 0006682
2011-05-31 23:31 abma Note Edited: 0006682
2011-05-31 23:42 abma Note Edited: 0006682
2011-05-31 23:44 abma Note Edited: 0006682
2011-05-31 23:44 abma Note Edited: 0006682
2011-05-31 23:47 abma Note Added: 0006683
2011-05-31 23:47 abma Status feedback => resolved
2011-05-31 23:47 abma Resolution open => fixed
2011-05-31 23:47 abma Assigned To => abma