Bug 691987 - Valgrind reports use of uninitialised variables
Valgrind reports use of uninitialised variables
Status: RESOLVED FIXED
Product: GhostPCL
Classification: Unclassified
Component: PCL interpreter
master
PC Linux
: P4 normal
Assigned To: Henry Stiles
Bug traffic
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2011-02-20 17:30 UTC by Robin Watts
Modified: 2011-02-22 15:19 UTC (History)
0 users

See Also:
Customer:
Word Size: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Robin Watts 2011-02-20 17:30:02 UTC
valgrind --track-origins=yes main/obj/pcl6 -r75 -o /dev/null -sDEVICE=pbmraw ../ghostpcl/tets_private/customer_tests/simple.pcl

shows that pcl_set_cap_x and pcl_set_cap_y can be called with pcs->cap.x and pcs->cap.y undefined and yet their values are used.
Comment 1 Henry Stiles 2011-02-20 19:19:59 UTC
Technically this is a don't care UMR - the cap is set to 0 in pcursor.c:pcursort_reaset() which must be run before the cap is accessed in a useful manner.  But it is now fixed in 12176.  I'll leave the bug open, I don't know if valgrind error is the only issue or was suspected to be a symptom of something wrong.
Comment 2 Robin Watts 2011-02-21 11:19:50 UTC
Revision 12176 does NOT stop the UMR, at least on my 32bit linux VMware image.
Comment 3 Robin Watts 2011-02-21 11:36:42 UTC
The valgrind error given now, is actually different than before - control appears to arrive in pcl_set_cap_y with pcs->vmi_cp being undefined.

Setting pcs->vmi_cp = 0; at the end of pcl_init_state appears to satisfy valgrind, but I have no idea if this is actually appropriate or not.
Comment 4 Henry Stiles 2011-02-21 22:14:21 UTC
(In reply to comment #3)
> The valgrind error given now, is actually different than before - control
> appears to arrive in pcl_set_cap_y with pcs->vmi_cp being undefined.
> 
> Setting pcs->vmi_cp = 0; at the end of pcl_init_state appears to satisfy
> valgrind, but I have no idea if this is actually appropriate or not.

That I cannot reproduce, just to verify you mean:

        coord   vmi_cp = pcs->vmi_cp;

pcursor.c:258.  Right?
Comment 5 Robin Watts 2011-02-22 15:19:58 UTC
Fixed in revision 12181. Thanks.