View Issue Details

IDProjectCategoryView StatusLast Update
0027100LazarusLazReportpublic2014-11-28 23:39
ReporterTony WhymanAssigned ToJesus Reyes 
PrioritynormalSeverityminorReproducibilitysometimes
Status resolvedResolutionfixed 
Product Version1.2.6Product Build 
Target Version1.4Fixed in Version1.3 (SVN) 
Summary0027100: Stack Overflow when using Column Footer
DescriptionThis is not an easy one to reproduce, but it is possible to cause a stack overflow when a column footer is present and the detail row is just the right size. If you catch the problem in the IDE, the call stack is definitive and shows a recursion in lr_class.pas from

CheckPageBreak
NewColumn
ShowBand
TfrBand.Draw
DoDraw

There is probably a mis-calculation somewhere that starts this off, but there should also be something in CheckPageBreak that stops NewColumn being called when the Band is a column Footer. The attached patch adds such a check and seems to result in a correct report being produced.
TagsNo tags attached.
Fixed in Revision47024
LazTarget1.4
WidgetsetGTK 2
Attached Files
  • lazfooter.diff (745 bytes)
    diff -rupN lazarus/components/lazreport/source/lr_class.pas /home/tony/lazarus/1.2.6/components/lazreport/source/lr_class.pas
    --- lazarus/components/lazreport/source/lr_class.pas	2014-05-03 20:53:15.000000000 +0100
    +++ /home/tony/lazarus/1.2.6/components/lazreport/source/lr_class.pas	2014-11-25 14:21:00.000000000 +0000
    @@ -5708,7 +5713,8 @@ begin
         DebugLn('ay+ColFoot.dy+ady=%d CurBottomY=%d',[ay+Bands[btColumnFooter].dy+ady,CurBottomY]);
         {$ENDIF}
         if not RowsLayout then begin
    -      if ay + Bands[btColumnFooter].dy + ady > CurBottomY then
    +      if (Parent.Bands[btColumnFooter] <> self) and
    +        (ay + Bands[btColumnFooter].dy + ady > CurBottomY) then
           begin
             if not PBreak then
               NewColumn(Self);
    
    lazfooter.diff (745 bytes)

Activities

Tony Whyman

2014-11-27 14:26

reporter  

lazfooter.diff (745 bytes)
diff -rupN lazarus/components/lazreport/source/lr_class.pas /home/tony/lazarus/1.2.6/components/lazreport/source/lr_class.pas
--- lazarus/components/lazreport/source/lr_class.pas	2014-05-03 20:53:15.000000000 +0100
+++ /home/tony/lazarus/1.2.6/components/lazreport/source/lr_class.pas	2014-11-25 14:21:00.000000000 +0000
@@ -5708,7 +5713,8 @@ begin
     DebugLn('ay+ColFoot.dy+ady=%d CurBottomY=%d',[ay+Bands[btColumnFooter].dy+ady,CurBottomY]);
     {$ENDIF}
     if not RowsLayout then begin
-      if ay + Bands[btColumnFooter].dy + ady > CurBottomY then
+      if (Parent.Bands[btColumnFooter] <> self) and
+        (ay + Bands[btColumnFooter].dy + ady > CurBottomY) then
       begin
         if not PBreak then
           NewColumn(Self);
lazfooter.diff (745 bytes)

Jesus Reyes

2014-11-28 23:39

developer   ~0079463

Applied, thank you.

Issue History

Date Modified Username Field Change
2014-11-27 14:26 Tony Whyman New Issue
2014-11-27 14:26 Tony Whyman File Added: lazfooter.diff
2014-11-27 15:25 Jesus Reyes Assigned To => Jesus Reyes
2014-11-27 15:25 Jesus Reyes Status new => assigned
2014-11-28 23:39 Jesus Reyes Fixed in Revision => 47024
2014-11-28 23:39 Jesus Reyes LazTarget => 1.4
2014-11-28 23:39 Jesus Reyes Note Added: 0079463
2014-11-28 23:39 Jesus Reyes Status assigned => resolved
2014-11-28 23:39 Jesus Reyes Fixed in Version => 1.3 (SVN)
2014-11-28 23:39 Jesus Reyes Resolution open => fixed
2014-11-28 23:39 Jesus Reyes Target Version => 1.4