Search Unity

Fatal error in gc "GetThreadContext failed"

Discussion in 'Editor & General Support' started by Scorpion, Apr 3, 2010.

  1. Scorpion

    Scorpion

    Joined:
    Apr 3, 2010
    Posts:
    5
    Hey guys,

    I need your help..

    I am creating a lan fps style game.
    Its a simpel setup using unity's own networking and without a master server, you can just choose if you want to host a server or connnect to a server and if you connect you need to feed it the hostname of the server.

    It all works fine but sometimes it randomly gives 2 or 3 of this errors and freezes. It hapens like 1 out of 10 times and it appears to be random. It hapens in the editor and in the builded player, and on the server and on the client.

    I have no idea why this is hapening, tried it on 3 pc's (win 7, vista, xp) and it hapens on all.

    I hope you guys can help me.
    Thanks in advance.

    ps. sorry for bad english, i am not a native english speaker.
     

    Attached Files:

  2. Scorpion

    Scorpion

    Joined:
    Apr 3, 2010
    Posts:
    5
    No one knows?

    Doesn't anybody atleast know what the error means?
     
  3. Quietus2

    Quietus2

    Joined:
    Mar 28, 2008
    Posts:
    2,058
    There are a myriad of really nasty threading bugs that exist in the version of mono that Unity uses. It crops up randomly in various places such as asynch loading, but most notably in Unity's networking.

    You'll likely have to wait until sometime in the summer for Unity 3.0, then cross your fingers and pray it's resolved.

    See the following thread for more information.

    Unity Networking is Dysfunctional
     
  4. Scorpion

    Scorpion

    Joined:
    Apr 3, 2010
    Posts:
    5
    thnx for your responds.

    thats too bad.. waiting for unity 3.0 then :D
     
  5. Quietus2

    Quietus2

    Joined:
    Mar 28, 2008
    Posts:
    2,058
    Don't let the bad news stop you from filing a bug report and sample project if you can.

    A failure rate of 10% is higher than anything I've seen mentioned. Something that high is approaching the realm of repeatability and could be valuable to the Unity devs.

    p.s. your English is fine!
     
  6. Scorpion

    Scorpion

    Joined:
    Apr 3, 2010
    Posts:
    5
    where and how would i file a report?

    sorry im kinda new here.
     
  7. Scorpion

    Scorpion

    Joined:
    Apr 3, 2010
    Posts:
    5
    I did a bit more testing, and it appears it hapens much more often when you have a slow network, for example when trying it over hamachi (wich is very slow), it crashes almost always, but over my home network it crashes much less often.

    Maybe i am sending too much data for the network too handle or something?
     
  8. Quietus2

    Quietus2

    Joined:
    Mar 28, 2008
    Posts:
    2,058
    See the following thread for more a more in-depth discussion about bug reporting. But the short answer is you file them through the Unity app itself. Help->Report A Problem. Give as much detail as you can. Reference this thread, attach a small sample project, etc.

    http://answers.unity3d.com/questions/1794/how-do-i-report-a-bug-in-unity

    It's hard to say what's going on. The error you receive is somewhat vague. GC is possibly the garbage collector, which is really part of Mono and not Unity itself.
     
  9. sagron6015

    sagron6015

    Joined:
    Apr 19, 2010
    Posts:
    32
    Make sure you aren't using print statements in the standalone - I found I was getting one of those errors every time I did so, which makes sense since in the standalone it has no place to print to.

    Edit: They came back :oops:, but I can definitely cause it to happen if I click on a button a few times in a row quickly (and I'm using a ghetto version of locking since yield isn't working right in mono)
     
  10. magwo

    magwo

    Joined:
    May 20, 2009
    Posts:
    402
    I'm getting these errors a lot in Unity3 beta 4, and not even doing anything fancys. Getting them on startup and while changing project.

    I have Unity 2.6 installed also on the same machine. Could this be causing problems?
     
  11. magwo

    magwo

    Joined:
    May 20, 2009
    Posts:
    402
    Ah! Interesting discovery.. these problems seem to go away when I run it in Compatibility mode Windows XP SP2.

    A little more info: Win7 64, 8 GB mem, quad core.
     
  12. CreativeChris

    CreativeChris

    Unity Technologies

    Joined:
    Jun 7, 2010
    Posts:
    457
    Hello guys!

    I have been investigating this issue here in the unity office and I have managed to reproduce it locally.

    Out of interest what anti-virus software is everyone got installed?

    I have only managed to reproduce with having Karpersky anti-virus software installed.

    Un-installing this or not having it installed has lead me to never reproduce.

    If this is the case for everyone disabling or un-installing this anti-virus software is a temporary workaround.

    Known anti-virus software where this issues isn't seen with is AVG or Avira so far.

    Please rest assure this issue is currently in an area where a developer is investigating and implement a fix.

    Thanks!
     
  13. Metal Head

    Metal Head

    Joined:
    Aug 14, 2010
    Posts:
    411
    Hey! Sorry for necroposting, but I have this problem right now and yes, I'm have Kaspersky installed on my PC. I'm with Unity 3
    Win 7 Ultimate 64

    Hope that helps!
     
  14. adamdc

    adamdc

    Joined:
    Sep 28, 2010
    Posts:
    1
    I had tried that, though I am still getting the same error message. On the brighter side, I had paid attention to my cpu usage, and when unity loads, it maxes out 1 of my 4 cores (I have a Q6600 intel core 2 quad at 2.34ghz).

    From what i am getting (understanding) it is having an issue with the 64bit systems, since it is a 32bit program. See 64bit differs from 32 for the fact that processes get split between the memory and the processor (32= proc. 32= ram), which is another reason why you have the capability to upgrade your ram to a higher capacity then a where a 32bit (majority of OSes) tops off at 4/3gb ram. that is why they tell you "some" programs might not work if it does not meet your OS's ratio.

    Regardless try to install "Oracle's VM VirtualBox" or "VMware's ESXI" (since they are both open source), and just look for your old winxp or vista product key, and just install a VM (Virtual Machine), just make sure also you are installing a 32bit OS (Operating System).
     
  15. oblivionfeet

    oblivionfeet

    Joined:
    Jul 24, 2010
    Posts:
    481
    Only badly coded 32bit programs have problems with 64bit operating systems. Besides, it works just fine for me. The problem seems to be Windows 7 and Kaspersky.

    Also the Virtualbox suggestion wont work on account of the fact U3 requires the following:

    Code (csharp):
    1. Unity Editor requires a graphics card with at least 4 texture units.
    2. All graphics cards manufactured since 2002 should be ok.
    3.  
    4. Your graphics card is: NVIDIA RIVA TNT
    5. and it has 1 texture units
    which is the error given if it's run in Virtualbox, which doesn't currently emulate 3D 100% and instead reverts to emulating something pretty low powered. I dunno about VMware tho, might have a better chance. Course if you run Snow Leopard in Virtualbox on a Windows host (not supposed to but you can), ironically you can get U3 to work on it, just incredibly slowly due to lack of any kind of real acceleration.
     
  16. Artus

    Artus

    Joined:
    Nov 8, 2010
    Posts:
    1
    Hi.
    Im using win 7 64bit, and i have kaspersky instaled.
    When Kaspersky was on then i recived that error, but after shouting down i didnt recived thta error.
    Hope that will help.

    Regards
    Artus
     
  17. Dreamora

    Dreamora

    Joined:
    Apr 5, 2008
    Posts:
    26,601
    not really cause that would be no acceptable reason to fail with thread context errors, being unable to run reasonably on a system newer than Win98
     
  18. Barry Holroyd

    Barry Holroyd

    Joined:
    Mar 21, 2009
    Posts:
    17
    Hi All,

    I've been having this problem off and on for many months now. I, too, am running Windows 7 with Kaspersky. Seems like too strong a coincidence for that combination to be reported so often -- my guess is that it's related, possibly causal in some sense. (Also, I'm running 64 bit Windows 7.)

    Interestingly, after loading up a new project and un-checking the "Welcome" screen, when I clicked on the 'X' to close the Welcome screen I got this error (just now). Every time I clicked on the 'X' I got a new pop up indicating the error (I'd never been able to reproduce it like that before, albeit in the same Unity session).

    Barry
     
  19. Barry Holroyd

    Barry Holroyd

    Joined:
    Mar 21, 2009
    Posts:
    17
    Hello again,

    Yesterday I tried using MonoDevelop for the first time (with Unity 3.1). When I clicked on the "Debug" button it tried to bring up Unity, but I got the GetThreadContext error again -- this time with 100% repeatability.

    I tried putting Unity on the Kaspersky Trusted Applications list (as suggested on another thread), but that didn't help. I then tried turning off Kaspersky altogether -- still no dice. I then tried telling it not to restart an reboot and rebooted -- no luck. Finally, I uninstalled Kaspersky altogether -- Voila! The error disappeared.

    I then went to the Kaspersky support site to contact Support -- it immediately suggested that I upgrade to the very latest version of Kasperksy, so I did: Internet Security 2011, Version 11.0.1.400 (a).

    NOW THE ERROR IS COMPLETELY GONE. I have even removed Unity from Kaspersky's Trusted Applications list and I no longer get the error.

    Unfortunately, MonoDevelop crashes on me a lot, but that's another problem :)....

    Barry
     
  20. Spinex

    Spinex

    Joined:
    Jul 7, 2009
    Posts:
    23
    I have Unity 3.1 I found this error occuring on start-up. My fix was to disable the Spybot S+D Teatimer.exe
     
  21. Jes

    Jes

    Joined:
    Mar 30, 2011
    Posts:
    1
    Yeah, I've experienced the same thing pretty consistently. It's getting more than annoying.

    When I try to start Unity, it'll hang and I'll get the GetThreadContext failed message. Then it'll start sucking 13% of my CPU until I kill the process.

    I'm running Windows 7 64bit Pro with ESET.
     
  22. Dreamora

    Dreamora

    Joined:
    Apr 5, 2008
    Posts:
    26,601
    I was using ESET before too. You need to modify the scanner to not do realtime checking on processes from what I've been told (I've since switched to kaspersky, no prob at all anymore)
     
  23. virbas

    virbas

    Joined:
    Jul 20, 2011
    Posts:
    1
    win7 64bit Eset Smart Security 4.2.71.2 had the same issue. Disabling the firewall completely in Eset settings->personal firewall "fixed" the problem
     
  24. Android324

    Android324

    Joined:
    Jun 20, 2012
    Posts:
    6
    Hi guys,

    Had the "GetThreadContext failed" problem too(using ESET 5 and disabling it completely didn't work for me) ; reading your posts and some other posts i realized that disabling your network card and enabling it only after you start unity does the trick ; tried this trick on 4 PCs multiple times ; success rate 100% ; let me know if it also worked for you;)
     
    Last edited: Sep 17, 2012
  25. aleroy

    aleroy

    Joined:
    Nov 1, 2012
    Posts:
    1
    Resolved! (cheers Barry)

    I HAD: Kaspersky PURE (9.1.0.124a) / Win7.64 / Unity 3.5

    Got the error while running the "Networking" sample project (notably with the Castles scene).

    UPGRADED TO: Kaspersky PURE 2.0 (12.0.2.733)

    ... haven't seen the error since. Hooray!
     
  26. Zerial

    Zerial

    Joined:
    Feb 1, 2013
    Posts:
    1
    I have avast, win 7 64 and unity 4.1.2 and getting this bug recently.

    Any ideas?
     
  27. sithka

    sithka

    Joined:
    Apr 18, 2013
    Posts:
    1
    I'm in the same boat as Zerial, help would be much appreciated.
     
  28. syrka

    syrka

    Joined:
    May 20, 2009
    Posts:
    14
    any news here? this bug is really anoying.
     
  29. PolyMad

    PolyMad

    Joined:
    Mar 19, 2009
    Posts:
    2,350
    Get back to Avast 7.
     
  30. BrUnO-XaVIeR

    BrUnO-XaVIeR

    Joined:
    Dec 6, 2010
    Posts:
    1,687
    I just happen to see this error under Win64 now. Annoying...

    Edit: I can say this is UnityGUI related. Proly GUIContent() related.
    I left a build running for half an our without calling anything related to GUIContent... I open a panel with some GUIContent functions and the game crashes in less than a minute. Need a fix for this cause on previous Unity 4 release this wasnt happening.
     
    Last edited: May 21, 2013