View Issue Details

IDProjectCategoryView StatusLast Update
0023013LazarusPatchpublic2012-09-28 16:33
ReporterBenito van der ZanderAssigned ToVincent Snijders 
PrioritynormalSeveritytweakReproducibilityalways
Status resolvedResolutionfixed 
Platformamd64OSDebianOS Versionwheezy
Product Version1.1 (SVN)Product BuildLaz 1.1 r38276 FPC 2.6.0 x86_64- 
Target VersionFixed in Version1.1 (SVN) 
Summary0023013: valgrind error with headercontrol
Descriptionwhen a header control section is resized and the mouse leaves the header control, there are valgrind errors like:

==20454== Conditional jump or move depends on uninitialised value(s)
==20454== at 0x716262: COMCTRLS_TCUSTOMHEADERCONTROL_$__UPDATESTATE (headercontrol.inc:323)
==20454== by 0x7155BF: COMCTRLS_TCUSTOMHEADERCONTROL_$__MOUSELEAVE (headercontrol.inc:198)
==20454== by 0x6892D1: CONTROLS_TCONTROL_$__CMMOUSELEAVE$TLMESSAGE (control.inc:1090)
==20454== by 0x44F518: SYSTEM_TOBJECT_$__DISPATCH$formal (in /tmp/lib/x86_64-linux/project1)
==20454== by 0x676C40: CONTROLS_TWINCONTROL_$__WNDPROC$TLMESSAGE (wincontrol.inc:5322)
==20454== by 0x68A649: CONTROLS_TCONTROL_$__PERFORM$LONGWORD$WPARAM$LPARAM$$LRESULT (control.inc:1459)
==20454== by 0x47D8BC: FORMS_TAPPLICATION_$__UPDATEMOUSECONTROL$TCONTROL (application.inc:617)
==20454== by 0x4832FB: FORMS_TAPPLICATION_$__DOBEFOREMOUSEMESSAGE$TCONTROL (application.inc:2044)
==20454== by 0x689B21: CONTROLS_TCONTROL_$__DOBEFOREMOUSEMESSAGE (control.inc:1277)
==20454== by 0x6769CA: CONTROLS_TWINCONTROL_$__WNDPROC$TLMESSAGE (wincontrol.inc:5286)
==20454== by 0x7AA9D4: LCLMESSAGEGLUE_DELIVERMESSAGE$TOBJECT$formal$$INT64 (lclmessageglue.pas:117)
==20454== by 0x74DCC3: GTK2PROC_DELIVERMESSAGE$POINTER$formal$$INT64 (gtk2proc.inc:3591)
==20454== Uninitialised value was created by a stack allocation
==20454== at 0x716140: COMCTRLS_TCUSTOMHEADERCONTROL_$__UPDATESTATE (headercontrol.inc:308)
==20454==
==20454== Conditional jump or move depends on uninitialised value(s)
==20454== at 0x716262: COMCTRLS_TCUSTOMHEADERCONTROL_$__UPDATESTATE (headercontrol.inc:323)
==20454== by 0x715E61: COMCTRLS_TCUSTOMHEADERCONTROL_$__MOUSEMOVE$TSHIFTSTATE$LONGINT$LONGINT (headercontrol.inc:277)
==20454== by 0x695DC4: CONTROLS_TCONTROL_$__WMMOUSEMOVE$TLMMOUSE (control.inc:4161)
==20454== by 0x44F518: SYSTEM_TOBJECT_$__DISPATCH$formal (in /tmp/lib/x86_64-linux/project1)
==20454== by 0x676C40: CONTROLS_TWINCONTROL_$__WNDPROC$TLMESSAGE (wincontrol.inc:5322)
==20454== by 0x7AA9D4: LCLMESSAGEGLUE_DELIVERMESSAGE$TOBJECT$formal$$INT64 (lclmessageglue.pas:117)
==20454== by 0x74DCC3: GTK2PROC_DELIVERMESSAGE$POINTER$formal$$INT64 (gtk2proc.inc:3591)
==20454== by 0x75FF12: GTK2PROC_DELIVERMOUSEMOVEMESSAGE$PGTKWIDGET$PGDKEVENTMOTION$TWINCONTROL (gtk2callback.inc:1336)
==20454== by 0x7604B5: GTK2PROC_GTKMOTIONNOTIFY$PGTKWIDGET$PGDKEVENTMOTION$POINTER$$BOOLEAN32 (gtk2callback.inc:1485)
==20454== by 0x56E8098: ??? (in /usr/lib/x86_64-linux-gnu/libgtk-x11-2.0.so.0.2400.10)
==20454== by 0x5EAC723: g_closure_invoke (in /usr/lib/x86_64-linux-gnu/libgobject-2.0.so.0.3200.3)
==20454== by 0x5EBD7AF: ??? (in /usr/lib/x86_64-linux-gnu/libgobject-2.0.so.0.3200.3)
==20454== Uninitialised value was created by a stack allocation
==20454== at 0x716140: COMCTRLS_TCUSTOMHEADERCONTROL_$__UPDATESTATE (headercontrol.inc:308)
==20454==



This patch fixes that:


benito@hostname:~$ svn diff /opt/lazarus/lcl/include/headercontrol.inc
Index: /opt/lazarus/lcl/include/headercontrol.inc
===================================================================
--- /opt/lazarus/lcl/include/headercontrol.inc (revision 38639)
+++ /opt/lazarus/lcl/include/headercontrol.inc (working copy)
@@ -307,11 +307,11 @@
   P: TPoint;
 begin
   MaxState := hsNormal;
+ Index := FSelectedSection;
   if Enabled then
     if FDown then
     begin
       MaxState := hsPressed;
- Index := FSelectedSection;
     end else if FMouseInControl then
     begin
       MaxState := hsHot;
TagsNo tags attached.
Fixed in Revision38886
LazTarget-
WidgetsetGTK 2
Attached Files

Activities

Vincent Snijders

2012-09-28 16:33

manager   ~0062711

I had not seen the patch and solved it differently.

Issue History

Date Modified Username Field Change
2012-09-28 16:08 Benito van der Zander New Issue
2012-09-28 16:08 Benito van der Zander Widgetset => GTK 2
2012-09-28 16:33 Vincent Snijders Fixed in Revision => 38886
2012-09-28 16:33 Vincent Snijders LazTarget => -
2012-09-28 16:33 Vincent Snijders Status new => resolved
2012-09-28 16:33 Vincent Snijders Fixed in Version => 1.1 (SVN)
2012-09-28 16:33 Vincent Snijders Resolution open => fixed
2012-09-28 16:33 Vincent Snijders Assigned To => Vincent Snijders
2012-09-28 16:33 Vincent Snijders Note Added: 0062711