[Fluxus] Reproducable segmentation fault on 'poly-convert-to-indexed' and 'recalc-normals' combo.

Karl Svec karlsvec at gmail.com
Wed Jun 30 10:57:24 PDT 2010


I can also reproduce the crash using the test code you provided, but  
I'm not having any problems with running fluxus in gdb.

<snip>
Seg fault (internal error) at 0x0

Program received signal EXC_BAD_ACCESS, Could not access memory.
Reason: KERN_PROTECTION_FAILURE at address: 0x00000000
Fluxus::PolyPrimitive::CalculateGeometricNormals (this=0x128a800) at  
libfluxus/src/PolyPrimitive.cpp:444
444						dVector a((*m_VertData)[m_IndexData[i]]-(*m_VertData) 
[m_IndexData[i+1]]);
(gdb) bt
#0  Fluxus::PolyPrimitive::CalculateGeometricNormals (this=0x128a800)  
at libfluxus/src/PolyPrimitive.cpp:444
#1  0x0260d044 in Fluxus::PolyPrimitive::RecalculateNormals  
(this=0x128a800, smooth=true) at libfluxus/src/PolyPrimitive.cpp:363
#2  0x025ee5ac in recalc_normals (argc=<value temporarily unavailable,  
due to optimizations>, argv=0x9d8fac) at modules/fluxus-engine/src/ 
PDataFunctions.cpp:759
#3  0x00502818 in scheme_do_eval (obj=0x28521b0, num_rands=1,  
rands=0x9d8fac, get_value=1) at eval.c:8951
#4  0x005041dc in scheme_do_eval (obj=0x253b248, num_rands=-1,  
rands=0x0, get_value=-1) at eval.c:9865
#5  0x00508b14 in eval_k () at eval.c:10089
#6  0x0051f8d0 in scheme_top_level_do_worker (k=0x5087ac <eval_k>,  
eb=1, new_thread=0, dyn_state=0x0) at fun.c:2235
#7  0x00508e90 in scheme_eval_multi (obj=<value temporarily  
unavailable, due to optimizations>, env=0xed4268) at eval.c:9984
#8  0x00509190 in do_eval_string_all (port=0x2527598, str=<value  
temporarily unavailable, due to optimizations>, env=0xed4268, cont=1,  
w_prompt=10325936) at eval.c:11067
#9  0x00008fc8 in Fluxus::PolyPrimitive::CalculateGeometricNormals ()  
at libfluxus/src/PolyPrimitive.cpp:444
#10 0x00008fc8 in Fluxus::PolyPrimitive::CalculateGeometricNormals ()  
at libfluxus/src/PolyPrimitive.cpp:444
#11 0x00008fc8 in fluxus::Interpreter::Interpret (str=<value  
temporarily unavailable, due to optimizations>, ret=0x0, abort=false)  
at src/Interpreter.cpp:444
#12 0x00014d18 in DisplayCallback () at src/main.cpp:225
#13 0x3e005650 in -[GLUTView drawRect:] ()
#14 0x3e008b00 in -[GLUTView handleWorkEvent:] ()
#15 0x3e022ddc in processWindowWorkList ()
#16 0x3e022e6c in __glutProcessWorkEvents ()
#17 0x3e00fa74 in -[GLUTApplication run] ()
#18 0x3e0227e4 in glutMainLoop ()
#19 0x00015808 in run (data=<value temporarily unavailable, due to  
optimizations>) at src/main.cpp:416
#20 0x004c4ea8 in scheme_main_stack_setup (no_auto_statics=1,  
_main=<value temporarily unavailable, due to optimizations>,  
data=0xbffff798) at salloc.c:195
#21 0x000131fc in main (argc=<value temporarily unavailable, due to  
optimizations>, argv=<value temporarily unavailable, due to  
optimizations>) at src/main.cpp:426
</snip>

I'm on Mac OS X 10.5.8 PPC (G4) running the latest fluxus git +  
Racket. I built both with Apple's GCC 4.0.1.


Karl

On Jun 30, 2010, at 12:35 PM, Hugo van Galen wrote:

> Hello again list :)
>
> I was playing around with the a simple shape. Wondering whether the  
> lighting would be better, I threw in the 'poly-convert-to-indexed'  
> call. I observed that, if that's called, it crashes on the next call  
> to 'recalc-normals'.
>
> The same behaviour on the 0.17-rc5 version (PLT 4.2.5) as the GIT  
> version I downloaded earlier and modified myself to compile against  
> Racket 5.0, which leads me to believe that this must be a bug in the  
> program...
>
> Now, for some reason I am unable to run 'gdb' on the fluxus binary,  
> it starts coughing up segmentation faults all over the place like  
> these right after 'run':
>
> Program received signal SIGSEGV, Segmentation fault.
> scheme_gmp_tls_unload (s=0x7ffff1076360, data=0x0) at ./gmp/gmp.c:5816
> 5816    ./gmp/gmp.c: No such file or directory.
>         in ./gmp/gmp.c
>
> Anyone know what's up with that, or is there an obscure compile  
> option to make that work?
>
> Anyway, here is the code that crashes the program:
>
> (clear)
> (colour (vector 1 1 1))
>
> (define mypoly (build-polygons 8 'triangle-strip))
> (with-primitive mypoly
>     (pdata-set! "p"  0 (vector 1 0 0))
>     (pdata-set! "p"  1 (vector 4 0 0))
>     (pdata-set! "p"  2 (vector 1 2 0))
>     (pdata-set! "p"  3 (vector 4 2 0))
>
>     (pdata-set! "p"  4 (vector 0 2 0))
>     (pdata-set! "p"  5 (vector 5 2 0))
>     (pdata-set! "p"  6 (vector 0 6 0))
>     (pdata-set! "p"  7 (vector 5 6 0))
>
>     (poly-convert-to-indexed)
>     (recalc-normals 1); crash here
> )
>
>
> Cheers,
> Hugo
>
>
>




More information about the Fluxus mailing list