View Issue Details

IDProjectCategoryView StatusLast Update
0027581LazarusLCLpublic2015-03-04 21:37
ReporterC Western Assigned ToZeljan Rikalo  
PrioritynormalSeverityminorReproducibilityalways
Status closedResolutionfixed 
Platformi386OSMacOSX 
Product Version1.5 (SVN) 
Summary0027581: Crash in IDE if range check on
DescriptionShowing the stack window triggers a range check error if the IDE and LCL are compiled with range checks on. The crash is triggered in SetColumnWidth(-60) which fails because the OS routine takes an unsigned int. The attached patch forces the column width to zero if the supplied width is negative, which hides the error in this case. It may reflect an error in the autosizing code (see stack trace), but the stack window seems to work OK.
Additional Information#0 0x00024ff0 in fpc_raiseexception ()
0000001 0x00054d17 in SYSUTILS_$$_RUNERRORTOEXCEPT$LONGINT$POINTER$POINTER ()
0000002 0x002e17f5 in TCARBONLISTCOLUMN__SETHEADERWIDTH (AWIDTH=-97, this=0x15c5c640) at ./carbon/carbonlistviews.pp:431
0000003 0x002e1f2d in TCARBONLISTCOLUMN__SETWIDTH (AWIDTH=-97, this=0x15c5c640) at ./carbon/carbonlistviews.pp:593
0000004 0x002e4c88 in TCARBONDATABROWSER__AUTOSIZECOLUMNS (this=0x15c5c580) at ./carbon/carbonlistviews.pp:1513
0000005 0x0032a769 in TCARBONWSCUSTOMLISTVIEW__COLUMNSETWIDTH (ALV=0x15b05eb0, AINDEX=4, ACOLUMN=0x15c6db60, AWIDTH=643, pvmt=0x15afdef0) at ./carbon/carbonwscomctrls.pp:563
0000006 0x002f73e9 in TLISTCOLUMN__SETWIDTH (AVALUE=643, this=0x15c6db60) at ./include/listcolumn.inc:186
0000007 0x00b1a8c7 in TCALLSTACKDLG__COLSIZESETTER (ACOLID=5, ASIZE=643, this=0x15b8a090) at /Users/ctcmw/fpc/lazarus.w/debugger/callstackdlg.pp:244
0000008 0x00b1a1ad in CALLSTACKDLGCOLSIZESETTER (AFORM=0x15b8a090, ACOLID=5, ASIZE=643) at /Users/ctcmw/fpc/lazarus.w/debugger/callstackdlg.pp:178
0000009 0x0042fc7a in TSIMPLEWINDOWLAYOUT__APPLYDIVIDER (AFORCE=false, this=0x11d60250) at idewindowintf.pas:1403
0000010 0x0042fb26 in TSIMPLEWINDOWLAYOUT__APPLY (this=0x11d60250) at idewindowintf.pas:1382
0000011 0x004305d2 in TSIMPLEWINDOWLAYOUTLIST__APPLYANDSHOW (SENDER=0xbd5c260, AFORM=0x15b8a090, BRINGTOFRONT=false, AMOVETOVISBLEMODE=VMALWAYSMOVETOVISIBLE, this=0xbd6a0a0)
    at idewindowintf.pas:1575
0000012 0x004325c3 in TIDEWINDOWCREATORLIST__SHOWFORM (AFORM=0x15b8a090, BRINGTOFRONT=false, AMOVETOVISBLEMODE=VMALWAYSMOVETOVISIBLE, this=0xbd5c260) at idewindowintf.pas:2064
0000013 0x004327da in TIDEWINDOWCREATORLIST__RESTORESIMPLELAYOUT (this=0xbd5c260) at idewindowintf.pas:2100
0000014 0x0008714e in TMAINIDE__RESTOREIDEWINDOWS (this=0x13d8c290) at main.pp:2459
0000015 0x000818af in TMAINIDE__STARTIDE (this=0x13d8c290) at main.pp:1557
0000016 0x000117e7 in PASCALMAIN () at lazarus.pp:121
TagsNo tags attached.
Fixed in Revision48093
LazTarget-
WidgetsetCarbon
Attached Files

Activities

C Western

2015-03-01 18:49

reporter  

list.patch (722 bytes)   
diff -uwNr --exclude=.svn --exclude=Makefile --exclude=Makefile.fpc --exclude=Makefile.compiled --exclude='*.rsj' --exclude='*.bak' --exclude='*.po' lazarus/lcl/interfaces/carbon/carbonlistviews.pp lazarus.w/lcl/interfaces/carbon/carbonlistviews.pp
--- lazarus/lcl/interfaces/carbon/carbonlistviews.pp	2013-11-16 13:39:10.000000000 +0000
+++ lazarus.w/lcl/interfaces/carbon/carbonlistviews.pp	2015-03-01 16:32:39.000000000 +0000
@@ -428,6 +428,8 @@
 
 procedure TCarbonListColumn.SetHeaderWidth(AWidth: Integer);
 begin
+  if AWidth < 0 then
+    AWidth := 0;
   OSError(SetDataBrowserTableViewNamedColumnWidth(FOwner.Widget, PropertyID, AWidth),
     Self, 'SetHeaderWidth', 'SetDataBrowserTableViewNamedColumnWidth');
 
list.patch (722 bytes)   

Zeljan Rikalo

2015-03-02 13:39

developer   ~0081555

Please test and close if ok. Thanks for the patch.

Zeljan Rikalo

2015-03-02 13:41

developer   ~0081556

Added to the merge list for 1.4RC3

Issue History

Date Modified Username Field Change
2015-03-01 18:49 C Western New Issue
2015-03-01 18:49 C Western File Added: list.patch
2015-03-02 13:39 Zeljan Rikalo Fixed in Revision => 48093
2015-03-02 13:39 Zeljan Rikalo LazTarget => -
2015-03-02 13:39 Zeljan Rikalo Note Added: 0081555
2015-03-02 13:39 Zeljan Rikalo Status new => resolved
2015-03-02 13:39 Zeljan Rikalo Resolution open => fixed
2015-03-02 13:39 Zeljan Rikalo Assigned To => Zeljan Rikalo
2015-03-02 13:41 Zeljan Rikalo Note Added: 0081556
2015-03-04 21:37 C Western Status resolved => closed