PDA

View Full Version : Linux server crash on legends_p05 after door to Creo opens



nico
25-05-2016, 09:32 AM
Segmentation fault (core dumped)
507 ../engine/r_studio.c: No such file or directory.

Does that indicate a model problem?

Solokiller
25-05-2016, 09:37 AM
It means that the crash occurred in studiomodel related code. The full backtrace should show what it was trying to do.

nico
25-05-2016, 10:39 AM
#0 0xf630c6f2 in R_StudioCalcBoneQuaterion (frame=<optimized out>, frame@entry=14, s=<optimized out>, s@entry=0.399778843,
pbone=<optimized out>, pbone@entry=0xd893e004, panim=<optimized out>, panim@entry=0xb0e4, adj=<optimized out>, adj@entry=0xffcce690,
q=<optimized out>) at ../engine/r_studio.c:507

The model is this one (http://korea-dpr.org/offending_model.7z).

Solokiller
25-05-2016, 11:12 AM
I've seen this kind of backtrace before. What's happening here is that an animation stored in a sequence group is being referenced. Since the model references the original model's sequence groups (scientist01.mdl, etc), and since those no longer exist (merged at some time in the past; only the main model exists, no sequence groups or texture file), it now fails to load the group. When it tries to render the model while it's using that animation, it accesses invalid data. This is easy to notice because the panim variable has a rather low address. Since the pbone entry has a normal looking address, and since both are part of the same chunk of memory, this is very obvious.

To fix it in this particular case, recompile the model with the right group names.

A global solution already exists, but was not applied to the engine. I actually made note of this just a few days ago: http://forums.svencoop.com/showthread.php/13261-Fixing-multi-part-replacement-models?p=520086&viewfull=1#post520086

The team should port my solution to the engine so it fails less often, and add checks to prevent it from accessing garbage sequence groups. If the sequence group in which the animation resides is null, do not use it. Fall back to the first animation if necessary, or ignore bone setup entirely (set bone matrices to identity if it looks better that way).

If you want to check whether a model is using the wrong sequence group names, use HLMV's Dump Model Info feature and check the file for "Sequence Group <index> Name" entries. The first one should be "default", but since it's embedded in the main model, it shouldn't affect anything.

I'll add a feature to HLMV to automatically correct the names. It will require user input, but it's easy enough to do, provided the relative path starting in svencoop/ isn't too long. Issue here: https://github.com/SamVanheer/HL_Tools/issues/27

nico
25-05-2016, 11:19 AM
Thanks! On a side note: It does not crash a windows listenserver.

Solokiller
25-05-2016, 11:26 AM
That's probably because the Windows server is running the OpenGL version; r_studio.c is the Software renderer version of the studiomodel code. gl_studio.c is the OpenGL version. The Software renderer has been removed, so the problem might disappear altogether. (the Linux DS was updated to use the OpenGL implementation as well). Valve really liked to copy paste that code all over the place.