Author Topic: Crash on startup after 1/5/2015 update: "fatal error in gc: too many threads"  (Read 7820 times)

Offline pxld1

  • Newbie
  • *
  • Posts: 7
Hello Arcen!

I attempted to fire up your AWESOME!!! game this afternoon and I'm getting an error. It crashes with the message "Fatal error in gc" and the window reads "too many threads". If it helps, this is the first time I've ever encountered a crash of any kind.

I have the option enabled to load all items on startup. Each time it shows the error on load item 200, 201, or 202. On the plus side, the load time is much much faster than it was before so that's great!

Let me know if there's any other information you need, any screenshots you'd like me to upload, etc.  Thanks again for such a great game and for continuing to support it so well!

Opsys: Win 7 x64
Processor: Intel Q9400
Ram: 8 gigs
Video: Nvidia Geforce GTX 760
Sound: Asus Xonar Essense STX
Comodo antivirus, though it still crashes with the AV program completely closed out

Offline x4000

  • Chris McElligott Park, Arcen Founder and Lead Dev
  • Arcen Staff
  • Zenith Council Member Mark III
  • *****
  • Posts: 31,651
Thanks for all your kind words!  Regarding the error, I am able to duplicate that, it turns out -- but only when I set some internal values to different numbers than what are in the release build.  I think that might be related to hard disk timings for whatever reason.  Clearly it means I have a problem to fix, but that's why I didn't see it prior to launch.  If I set it to try 25 or 100 threads at once I get that error (and before launch I already knew it would do it with 100), but with 50 (which is what I launched this with) it doesn't do it.

The workaround for now is to edit your game settings file to turn off the preload of all the images, because that's what is triggering it.  I don't think you're likely to run into the issue if that's off, but I suppose it's possible it might happen at some inopportune time during gameplay.

On my end it's very late and I was just about to sign off for the night.  I've looked at things and don't see an obvious fix, but I do have several ideas on how to handle this.  It looks like the process is reporting the wrong number of threads for itself, so I'm going to have to do a better job of self-pooling those rather than relying on the process to tell me how many threads it has (it always returns 0, go figure).

Anyway, I imagine that I should be able to get a fix in for this tomorrow.  Thanks for bringing it to my attention!
Have ideas or bug reports for one of our games?  Mantis for Suggestions and Bug Reports. Thanks for helping to make our games better!

Offline Vinco

  • Jr. Member Mark II
  • **
  • Posts: 80
Same issue on my side.  I don't see a crash log, but here's the info from the Windows error dialog.  The workaround to disable preload seems to do the trick.

For what it's worth, I have AI War running off a 500 GB Samsung 840 SSD.

Problem signature:
  Problem Event Name:   APPCRASH
  Application Name:   AIWar.exe
  Application Version:   4.2.1.11687
  Application Timestamp:   521c6950
  Fault Module Name:   ntdll.dll
  Fault Module Version:   6.1.7601.18247
  Fault Module Timestamp:   521ea8e7
  Exception Code:   c0000005
  Exception Offset:   000222d2
  OS Version:   6.1.7601.2.1.0.256.48
  Locale ID:   1033
  Additional Information 1:   1fed
  Additional Information 2:   1fed7b29e3918e9bddfd32723f02489f
  Additional Information 3:   dfd3
  Additional Information 4:   dfd3b080105678051437dc7c9a383a1e

Offline pxld1

  • Newbie
  • *
  • Posts: 7
Thank you Chris!  8)

Offline x4000

  • Chris McElligott Park, Arcen Founder and Lead Dev
  • Arcen Staff
  • Zenith Council Member Mark III
  • *****
  • Posts: 31,651
No problem, guys -- and I am working on a fix as we speak.
Have ideas or bug reports for one of our games?  Mantis for Suggestions and Bug Reports. Thanks for helping to make our games better!

Offline x4000

  • Chris McElligott Park, Arcen Founder and Lead Dev
  • Arcen Staff
  • Zenith Council Member Mark III
  • *****
  • Posts: 31,651
The fix is out!  You can restart your steam client to force a quicker update.  Thanks for your patience. :)

* Our recently-added ArcenAsyncFile was causing some crashes in cases of extreme numbers of threads being used over a short period of time.
** It appears that the version of Mono included in Unity 3D does not handle thread disposal quite like normal .NET does -- and peculiarly, always reports the number of threads as 0 rather than whatever the real count is.  So that was... problematic to say the least, when we wanted to instantiate a lot of threads and then destroy them.  Instantiating them and then reusing them was what we had tried to begin with, but there were some unexpected hangups there as well.
** What we're now using, which seems to work great, is the ThreadPool class, which is part of Mono/.NET that is specifically aimed at doing this sort of thread reuse in the first place.  It seems to work exactly as advertised, fingers crossed. ;)
Have ideas or bug reports for one of our games?  Mantis for Suggestions and Bug Reports. Thanks for helping to make our games better!

Offline pxld1

  • Newbie
  • *
  • Posts: 7
Beautiful, it works like a charm! Thank you so much for the lightning fast turnaround Chris!  And I'll be sure to use your handy bug tracker next time, my apologies!

Offline x4000

  • Chris McElligott Park, Arcen Founder and Lead Dev
  • Arcen Staff
  • Zenith Council Member Mark III
  • *****
  • Posts: 31,651
My pleasure!  And no worries on the post. :)
Have ideas or bug reports for one of our games?  Mantis for Suggestions and Bug Reports. Thanks for helping to make our games better!