- Home /
Which kind of error can cause a silent crash?
Hello everybody! I'm using unity for a couple of years now, and my problem is that every time i got an error in my code usually, i have found some useful informations in the logs, complex or simple, like: "line X in the method Y: the error Z occurred [...]".
But right now i'm facing an error causing a crash. It occurs randomly and i can't see anything in the output logs. I have tried to use multiple debuggers and the problem seems to be hidden, it just tells me "ntdll failed somewhere because that [...] I don't know to be honest [...]".
Anyway, my main question is: it is possible that unity can't handle all the errors? it is possible that something can break a program without any exception thrown? And, if what i said is possible (I think that the behaviours leading to a silent crash aren't that common) are some known behaviour that always causes this kind of uncaught error?
EDIT
Here are the informations I found with the debugger:
I know that the crash occurs on the server when a player disconnects. Also, windows informs me about a SIGABRT sometimes when the crash happens, the problem is occurring when running the server on my own PC (Win 7), on a linux server and on a windows server 2012 R2. So the hardware corruption isn't possible on 3 different machines.
I think if the error is within Unity there will be an entry in the log. It could be that the issue occurs outside of Unity and the OS is killing the App.
Try and find the whole ntdll failed error and post it.
The NTDLL is a kind of high level API for kernel routines in windows. It's usually used by device drivers and other close to the hardware programs and routines. If a crash happened there you have almost no way to debug here since device drivers run in kernel mode (highest protected mode runlevel). As a user level program you don't have any access there.
Crashes related to the NTDLL are usually caused by the device driver of your graphics card. There are endless possible reasons. Device drivers usually should be very robust (because of their high privilege level). However if there's some sort of incompatibility with (a) certain hardware component(s) when a certain situation ocurrs, a crash can happen. You can't even tell who's the one responsible. It might be a bug in the graphics device driver or the incorrect usage of it by a consumer software (in our case: Unity). Of course a hardware failure is also always a possible reason.
Did you recently update your device driver of your graphics card? If not, try updating it :).
You described your crash as "silent crash" but it seems you got an exception (not a C# exception of course but a kernel one). There are so many different situations we simply call "crash" but the differ a lot. A silent crash usually just closes the application without any message at all (Crash to desktop). A "normal" crash usually is a controlled crash by the OS due to security violation of some sort. Even a lot people count infinite loops as "crash" it's actually not. The application still runs stable but is caught in that loop from which it usually can't recover. So the application is basically "dead" but did not crash. That's called "hanging".
So if your application actually crashes and you get an error message, it would be great to see the actual message the OS is telling you. There might even be a crash dump created by the OS. That won't help us much, but if you file a bugreport in Unity you might want to include such a crash dump so they can look into it.
Thank you @Bunny83, you made the things a lot clearer for me! However, when the program is running on a server, there is no graphic card, right? And the program is executed in "-batchmode". But i know that the "GPU skinning" is enabled so, maybe, when the animator of a client object is destroyed server side when a player just left the server something happens.. but i seriously doubt about that. i also use SQLite, but when a player disconnects, the database isn't used.. never crashed during a database use.
You never even mention that you run your application on a server. "-batchmode" is not enough for a server without a graphics card. You should also add "-nographics". (See commandline arguments) However it doesn't look like it's related to to graphics card. It just looks like there's some sort of memory leak. By looking at the callstack it might be related to Unity's old networking system (RakNet). However it looks like you use other third party native dlls (like s$$anonymous$$m api).
You said it also happens on a linux server? As a linux build or with an emulated windows (wine)?
Since you seem to use the old network engine, may i ask what Unity version do you use?