[glu3-devel] endless loop in src/libnurbs/internals/monotonizer.cc:60

j. Scheurich mufti11 at web.de
Fri Sep 7 18:41:03 UTC 2018


Hi,

When devoping a renderer for NurbsTrimmedSurface in the 
VRML/X3D editor white_dune i run in the following endless loop:

(gdb) l
54	 */
55	int
56	Subdivider::decompose( Bin& bin, REAL geo_stepsize )
57	{
58	    Arc_ptr jarc;
59	    for( jarc=bin.firstarc(); jarc; jarc=bin.nextarc() ) {
60		if( ! jarc->isTessellated() ) {
61		    /* points have not been transformed, therefore they may be either
62		       homogeneous or inhomogeneous */
63		    tessellate( jarc, geo_stepsize );
(gdb) l
64		    if( jarc->isDisconnected() || jarc->next->isDisconnected() 
65			return 1;
66		}
67	    }
68	
69	    for( jarc=bin.firstarc(); jarc; jarc=bin.nextarc() ) {
70		monotonize( jarc, bin );
71	    }
72	
73	#ifndef NDEBUG
(gdb) b 60
Breakpoint 3 at 0xb7e61565: file src/libnurbs/internals/monotonizer.cc, line 60.
(gdb) command 3
Type commands for breakpoint(s) 3, one per line.
End with a line saying just "end".
>p jarc
>end
(gdb) c
Continuing.

Thread 1 "dune" hit Breakpoint 3, Subdivider::decompose (this=0x17717dc, 
    bin=..., geo_stepsize=0.03125) at src/libnurbs/internals/monotonizer.cc:60
60		if( ! jarc->isTessellated() ) {
$7 = (Arc_ptr) 0x1996544
(gdb) 
Continuing.

Thread 1 "dune" hit Breakpoint 3, Subdivider::decompose (this=0x17717dc, 
    bin=..., geo_stepsize=0.03125) at src/libnurbs/internals/monotonizer.cc:60
60		if( ! jarc->isTessellated() ) {
$8 = (Arc_ptr) 0x1996528
(gdb) 
Continuing.

Thread 1 "dune" hit Breakpoint 3, Subdivider::decompose (this=0x17717dc, 
    bin=..., geo_stepsize=0.03125) at src/libnurbs/internals/monotonizer.cc:60
60		if( ! jarc->isTessellated() ) {
$9 = (Arc_ptr) 0x1996544
(gdb) 
Continuing.

Thread 1 "dune" hit Breakpoint 3, Subdivider::decompose (this=0x17717dc, 
    bin=..., geo_stepsize=0.03125) at src/libnurbs/internals/monotonizer.cc:60
60		if( ! jarc->isTessellated() ) {
$10 = (Arc_ptr) 0x1996528
(gdb) 
Continuing.

Thread 1 "dune" hit Breakpoint 3, Subdivider::decompose (this=0x17717dc, 
    bin=..., geo_stepsize=0.03125) at src/libnurbs/internals/monotonizer.cc:60
60		if( ! jarc->isTessellated() ) {
$11 = (Arc_ptr) 0x1996544
(gdb) 

I am using the git of libGLU of yesterday:

$ git clone https://gitlab.freedesktop.org/mesa/glu.git

The following patch is sufficent:

int
Subdivider::decompose( Bin& bin, REAL geo_stepsize )
{
    Arc_ptr jarc;
    Arc_ptr jarcOld = NULL;
    Arc_ptr jarcVeryOld = NULL;
    for( jarc=bin.firstarc(); jarc; jarc=bin.nextarc() ) {
        if ((jarc == jarcOld) || (jarc == jarcVeryOld))
            break;
        jarcVeryOld = jarcOld;
        jarcOld = jarc;
        if( ! jarc->isTessellated() ) {
...
...
...

so long
MUFTI


More information about the GLU3-devel mailing list