[gl2ps] valgrind and gl2ps

Christophe Geuzaine geuzaine at acm.caltech.edu
Wed Apr 6 17:52:12 CEST 2005


Olivier Couet wrote:
> On Tue, 5 Apr 2005, Christophe Geuzaine wrote:
> 
> 
>>Olivier Couet wrote:
>>
>>>Hi,
>>>
>>> I ran valgrind on our program using gl2ps. I got the follwoing:
>>>
>>>.....
>>>
>>>==19505== Conditional jump or move depends on uninitialised value(s)
>>>==19505==    at 0x4E359D50: gl2psAddInBspImageTree (gl/src/gl2ps.c:1670)
>>>==19505==    by 0x4E359E80: gl2psAddInBspImageTree (gl/src/gl2ps.c:1688)
>>>==19505==    by 0x4E359E33: gl2psAddInBspImageTree (gl/src/gl2ps.c:1684)
>>>==19505==    by 0x4E359E80: gl2psAddInBspImageTree (gl/src/gl2ps.c:1688)
>>
>>Hi Olivier - Which version of gl2ps are you using? (I don't have access to a
>>machine with valgrind at the moment, but I'd like to check what the offending
>>lines correspond to.)
>>
>>Thanks,
>>
>>Christophe
>>
> 
> 
>  Hello Christophe - In gl2ps.h I see:
> 
> /* Version number */
> 
> #define GL2PS_MAJOR_VERSION 1
> #define GL2PS_MINOR_VERSION 2
> #define GL2PS_PATCH_VERSION 3
> 
> I think it is the latest. 
> 

After looking at the code, I don't understand why Valgrind complains... 
Could you add something like

if(!prim){ printf("ERROR!!!\n"); return 1; }

at the beginning of gl2psAddInBspImageTree() (line 1667) and tell me if 
it makes a difference?

Thanks,

Christophe

-- 
Christophe Geuzaine
Applied and Computational Mathematics, Caltech
geuzaine at acm.caltech.edu - http://geuz.org