Discussion:
[hlcoders] Crash in fx_impact.cpp - at least most likely
Jan Hartung
2015-04-16 13:45:06 UTC
Permalink
Hi list,



There is a crash in our game that's bugging me for months now. It all comes
down to the function "Impact" in game\client\fx_impact.cpp. When I leave it
unaltered, sooner or later the game will crash but without a usable stack
trace. Even with debug DLLs and VS hooked up to the game, the stack trace
just shows ntdll.dll and neither our game code or Valve SDK code. However,
when I just exit the function via "return false" directly, there is no crash
at all - but also no wall impact decals, and that's just weird.

Does anyone have any idea what could be causing this? If not, the only thing
I can do is move that "return false" down line by line, test the heck out of
it and see where it actually crashes. Kinda tedious, but I'm out of ideas
here.



Jan
Tom Clay
2015-04-16 14:51:17 UTC
Permalink
ntdll is used for windows api calls, so there must be something calling a winapi function and crashing it.
Post by Jan Hartung
Hi list,
There is a crash in our game that’s bugging me for months now. It all comes down to the function "Impact" in game\client\fx_impact.cpp. When I leave it unaltered, sooner or later the game will crash but without a usable stack trace. Even with debug DLLs and VS hooked up to the game, the stack trace just shows ntdll.dll and neither our game code or Valve SDK code. However, when I just exit the function via "return false" directly, there is no crash at all – but also no wall impact decals, and that’s just weird.
Does anyone have any idea what could be causing this? If not, the only thing I can do is move that "return false" down line by line, test the heck out of it and see where it actually crashes. Kinda tedious, but I’m out of ideas here.
Jan
_______________________________________________
https://list.valvesoftware.com/cgi-bin/mailman/listinfo/hlcoders
Asher Baker
2015-04-17 08:48:04 UTC
Permalink
Make sure you load the ntdll symbols from the Microsoft symbol server, else it may not be able to walk past it in the stack.

Sent from my iPhone
Post by Jan Hartung
Hi list,
There is a crash in our game that’s bugging me for months now. It all comes down to the function "Impact" in game\client\fx_impact.cpp. When I leave it unaltered, sooner or later the game will crash but without a usable stack trace. Even with debug DLLs and VS hooked up to the game, the stack trace just shows ntdll.dll and neither our game code or Valve SDK code. However, when I just exit the function via "return false" directly, there is no crash at all – but also no wall impact decals, and that’s just weird.
Does anyone have any idea what could be causing this? If not, the only thing I can do is move that "return false" down line by line, test the heck out of it and see where it actually crashes. Kinda tedious, but I’m out of ideas here.
Jan
_______________________________________________
https://list.valvesoftware.com/cgi-bin/mailman/listinfo/hlcoders
Jan Hartung
2015-06-07 16:49:14 UTC
Permalink
Hey,



Loading the symbols from MS symbol server did not help, but I finally found out what was causing the crashes: shooting ragdolls. In game\client\fx_impact.cpp there is a function called FX_AffectRagdolls which is called from Impact in the same file. Inside FX_AffectRagdolls you can find this line:



partition->EnumerateElementsAlongRay( PARTITION_CLIENT_RESPONSIVE_EDICTS, shotRay, false, &ragdollEnum );



This causes an access violation (not a null pointer) when a ragdoll is shot. I couldn’t find a real reason why there’s an access violation, especially in various ntdll.dll functions, so I just immediately return with false from Impact when I see that a ragdoll was shot. This way all impact decals are shown, except the ones on ragdolls. That’s fine by me and the crash is finally gone.



Jan



Von: hlcoders-***@list.valvesoftware.com [mailto:hlcoders-***@list.valvesoftware.com] Im Auftrag von Asher Baker
Gesendet: Freitag, 17. April 2015 10:48
An: Discussion of Half-Life Programming
Betreff: Re: [hlcoders] Crash in fx_impact.cpp - at least most likely



Make sure you load the ntdll symbols from the Microsoft symbol server, else it may not be able to walk past it in the stack.

Sent from my iPhone


On 16 Apr 2015, at 14:45, Jan Hartung <***@gmx.de <mailto:***@gmx.de> > wrote:

Hi list,



There is a crash in our game that’s bugging me for months now. It all comes down to the function "Impact" in game\client\fx_impact.cpp. When I leave it unaltered, sooner or later the game will crash but without a usable stack trace. Even with debug DLLs and VS hooked up to the game, the stack trace just shows ntdll.dll and neither our game code or Valve SDK code. However, when I just exit the function via "return false" directly, there is no crash at all – but also no wall impact decals, and that’s just weird.

Does anyone have any idea what could be causing this? If not, the only thing I can do is move that "return false" down line by line, test the heck out of it and see where it actually crashes. Kinda tedious, but I’m out of ideas here.



Jan



_______________________________________________
To unsubscribe, edit your list preferences, or view the list archives, please visit:
https://list.valvesoftware.com/cgi-bin/mailman/listinfo/hlcoders

Loading...