Bug #1003

[Hexen] SEGV during 3D weapon use

Added by vvv1 over 10 years ago. Updated almost 10 years ago.

Target version:
Start date:
% Done:



Using 3D weapon near walls causes segmentation fault.

How to reproduce:

1. Copy Axe 3D model from to data/jhexen/auto directory.
The model is extracted from XCCP 1.2.
2. Unpack files from attached to runtime/hexndata/hexen directory.
3. Start Hexen.
4. Load the game named "Segmentation fault".
5. Use the weapon (press Ctrl or left mouse button).

Labels: jHexen


#1 Updated by skyjake over 10 years ago

The crash was caused by null pointer access. Some of the particles created by the "lightning" hit effect didn't have a current sector set, presumably because they were being spawned outside the map.

#2 Updated by vvv1 over 10 years ago

The patch from git does not fixes SEGV. The bug can be reproduced as described in the fitst message.

#3 Updated by skyjake over 10 years ago

Some offline comments:
- - - - - - - - - - - -

This assert fails in P_NewParticle():

pt->sector = R_PointInSubsector(FIX2FLT, FIX2FLT)->sector;

danij: Hmm, the would indeed suggest a degenerate nodebuild case. I'll test this once I've merged the map-cache changes (I've addressed the two causes of degenerates known to me).

#5 Updated by danij over 10 years ago

The underlying issue (that of a degenerate subsector) has been fixed for Monday's build451.

#6 Updated by danij over 10 years ago

Reopening this issue as this failure case has returned some time after build 451.

I currently suspect this is caused by a bool to boolean conversion somewhere in the BSP node builder as this problem only resurfaced when the boolean type definition changed.

#7 Updated by skyjake about 10 years ago

Checked it out in a debugger: a particle with a NULL sector is being processed in linkGeneratorParticles().

There is now an assert() to catch this in Generators_LinkToList().

#8 Updated by danij about 10 years ago

I think the best we can hope to achieve with this issue at present is to quietly kill any particle which ends up in a degenerate BSP leaf (i.e., sector == NULL as per the assert() in Generators_LinkToList() ).

This particular instance can be resolved but there are many others. The Hexen IWAD is (unfortunately) so riddled with mapping bugs that solving all the degenerate cases is a very tall order indeed.

#9 Updated by skyjake about 10 years ago

Pushed a fix that omits all particles in a NULL sector from rendering.

Also available in: Atom PDF