[Bf-committers] a segfault with CSGs

Laurence Bourn bf-committers@blender.org
Mon, 19 May 2003 10:45:07 +0200


Thanks for the bug report. 

1) Firstly it's not entirely a seg fault - these are assertions which should
not only be fired in a DEBUG build of the code. In release build these
should throw an exception and politely refuse to perform the operation but
not crash the program!

2) The real reason behind this stuff is the way BSP trees work. The program
asserts when it gets to a point where it could not split a polygon in two
(the fundamental operation of BSP and CSG operations). In this case because
the polygon halves were badly formed. This is a direct consequence of using
thick BSP planes - and I'll be buggered if I know how to make this piece of
code 100% robust (thus the exception scheme).

So as a preliminary solution - make sure you are not compiling the program
in DEBUG mode.
Ask someone from the active coders to have a look at this stuff/try and find
GPL'd CSG code somewhere and ditch this 'orrible BSP implementation. I would
love to revisit this code again and sort it out but I just don't have time
:-( I'll have to wait for my next bankrupcy to fix it.

Cheers,
Laurence.


> -----Original Message-----
> From: DarkGanja [mailto:darkganja@club-internet.fr]
> Sent: 17 May 2003 17:40
> To: bf-committers@blender.org
> Subject: Re: [Bf-committers] a segfault with CSGs
> 
> 
> > I've tried with 2.26, 2.27, and cvs (today's version), and 
> it happens in
> > 2.26 and cvs, but in 2.27 i get the following assert() failure:
> > 
> > blender: intern/BSP_CSGMeshSplitter.cpp:438: void
> > BSP_CSGMeshSplitter::SplitPolygon(BSP_CSGMesh&, CTR_TaggedIndex<24,
> > 16777215>, BSP_FaceInd&, BSP_FaceInd&): Assertion 
> `m_in_loop.size() >=3
> > && m_out_loop.size() >=3 && m_on_loop.size() == 2' failed.
> > Abandon
> actually it also happens in the cvs version, i must have forgot some
> flags.
> it outputs exactly the same error
> 
> _______________________________________________
> Bf-committers mailing list
> Bf-committers@blender.org
> http://www.blender.org/mailman/listinfo/bf-committers
>