View Issue Details

IDProjectCategoryView StatusLast Update
0037325LazarusPackagespublic2020-07-13 07:59
ReporterMartin Friebe Assigned ToPascal Riekenberg  
PrioritynormalSeverityminorReproducibilityalways
Status resolvedResolutionfixed 
Platform64bit IntelOSwin 10 
Product Version2.1 (SVN) 
Summary0037325: MarkupFoldColor: bad index, if source has exactly one line.
DescriptionCompile IDE with -dAssertSynMemIndex

- Open a new project (any type).
- Remove all, but one line (gutter only shows "1")
- Tools > Option > Editor > color: Change any one color.

Bad index exception, as in stack below.

Reason:
HIghilighter send lines changed from line 1 (first line) to line 1 (last line)

TSynEditMarkupFoldColors.DoTextChanged(pStartLine, pEndLine, pCountDiff: Integer);

pEndLine will be 1

line 1099
  if pEndLine < 0 then
    pEndLine := pStartLine
  else
    // pEndLine seems to be the first line after the change
    pEndLine := pEndLine - 1;

pEndLine becomes 0.

  lEndLine := pEndLine;
  FColumnCache[ToIdx(lEndLine)] := FirstCharacterColumn[ToIdx(lEndLine)];

ToIdx(lEndLine) is -1

FColumnCache starts at 0.

---
Not tested what happens with 0 lines (new files, never hit a single keystroke - internally 0 lines)
Steps To Reproduce#0 fpc_raiseexception(TOBJECT($000000007FFFFFFF), POINTER($000000004B249CF8), POINTER(nil)) at c:\FPC\fpc_3.0.4\source\rtl\win64\seh64.inc:288
0000001 SETCOLUMNDATA(TSYNEDITMARKUPFOLDCOLORSCOLUMNCACHE($0000000040AB1430), -1, 2147483647) at B:\lazarus_latest_svn_2\components\synedit\syneditmarkupfoldcoloring.pas:270
0000002 DOTEXTCHANGED(TSYNEDITMARKUPFOLDCOLORS($000000003EA50E70), 1, 0, 0) at B:\lazarus_latest_svn_2\components\synedit\syneditmarkupfoldcoloring.pas:1105
0000003 TEXTCHANGED(TSYNEDITMARKUP($000000003EA50E70), 1, 1, 0) at B:\lazarus_latest_svn_2\components\synedit\syneditmarkup.pp:483
0000004 TEXTCHANGED(TSYNEDITMARKUPMANAGER($000000004099B7F0), 1, 1, 0) at B:\lazarus_latest_svn_2\components\synedit\syneditmarkup.pp:677
0000005 HIGHLIGHTERATTRCHANGED(TCUSTOMSYNEDIT($0000000040AC3130), TOBJECT($000000003B74A2A0)) at B:\lazarus_latest_svn_2\components\synedit\synedit.pp:8725
0000006 CALLNOTIFYEVENTS(TMETHODLIST($000000003B6FAC10), TOBJECT($000000003B74A2A0)) at B:\lazarus_latest_svn_2\components\lazutils\lazmethodlist.pas:334
0000007 DEFHIGHLIGHTCHANGE(TSYNCUSTOMHIGHLIGHTER($000000003B74A2A0), TOBJECT($000000003B74A2A0)) at B:\lazarus_latest_svn_2\components\synedit\synedithighlighter.pp:1501
0000008 ENDUPDATE(TSYNCUSTOMHIGHLIGHTER($000000003B74A2A0)) at B:\lazarus_latest_svn_2\components\synedit\synedithighlighter.pp:1345
0000009 UPDATEHIGHLIGHTERS(TMAINIDEBASE($000000000750C830), True) at B:\lazarus_latest_svn_2\ide\mainbase.pas:1818
0000010 EDITOROPTIONSAFTERWRITE(TMAINIDE($000000000750C830), TOBJECT($0000000007400F50), False) at B:\lazarus_latest_svn_2\ide\main.pp:5191
0000011 DOAFTERWRITE(TABSTRACTIDEOPTIONS($0000000007400F50), False) at B:\lazarus_latest_svn_2\components\buildintf\ideoptionsintf.pas:403
0000012 DOAFTERWRITE(TEDITOROPTIONS($0000000007400F50), False) at B:\lazarus_latest_svn_2\ide\editoroptions.pp:5349
0000013 WRITEALL(TIDEOPTIONSDIALOG($00000000428589B0), False) at B:\lazarus_latest_svn_2\ide\ideoptionsdlg.pas:411
0000014 DOOPENIDEOPTIONS(TMAINIDE($000000000750C830), TABSTRACTIDEOPTIONSEDITORCLASS(nil), nil, nil, -1, []) at B:\lazarus_latest_svn_2\ide\main.pp:5043
0000015 DOOPENIDEOPTIONS(TLAZIDEINTERFACE($000000000750C830), TABSTRACTIDEOPTIONSEDITORCLASS(nil), nil) at B:\lazarus_latest_svn_2\components\ideintf\lazideintf.pas:784
0000016 MNUENVGENERALOPTIONSCLICKED(TMAINIDE($000000000750C830), TOBJECT($0000000024C52820)) at B:\lazarus_latest_svn_2\ide\main.pp:4966
0000017 MENUITEMCLICK(TIDEMENUITEM($0000000024C52820), TOBJECT($000000002162E440)) at B:\lazarus_latest_svn_2\components\ideintf\menuintf.pas:547
0000018 MENUITEMCLICK(TIDEMENUCOMMAND($0000000024C52820), TOBJECT($000000002162E440)) at B:\lazarus_latest_svn_2\components\ideintf\menuintf.pas:1699
0000019 CLICK(TMENUITEM($000000002162E440)) at B:\lazarus_latest_svn_2\lcl\include\menuitem.inc:83
0000020 DOCLICKED(TMENUITEM($000000002162E440), 0) at B:\lazarus_latest_svn_2\lcl\include\menuitem.inc:296
0000021 DISPATCH(TOBJECT($000000002162E440), 0) at c:\FPC\fpc_3.0.4\source\rtl\inc\objpas.inc:602
0000022 DOWINDOWPROC(TWINDOWPROCHELPER($00000000013FF6C8)) at B:\lazarus_latest_svn_2\lcl\interfaces\win32\win32callback.inc:2141
0000023 WINDOWPROC(42731090, 273, 243, 0) at B:\lazarus_latest_svn_2\lcl\interfaces\win32\win32callback.inc:2771
0000024 CUSTOMFORMWNDPROC(42731090, 273, 243, 0) at B:\lazarus_latest_svn_2\lcl\interfaces\win32\win32wsforms.pp:397
0000025 user32:CallWindowProcW+957 at :0
0000026 HANDLEMESSAGE(TAPPLICATION($00000000015B7D80)) at B:\lazarus_latest_svn_2\lcl\include\application.inc:1208
0000027 RUNLOOP(TAPPLICATION($00000000015B7D80)) at B:\lazarus_latest_svn_2\lcl\include\application.inc:1327
0000028 APPRUN(TWIDGETSET($00000000015B8260), TAPPLICATIONMAINLOOP($00000000013FFDE8)) at B:\lazarus_latest_svn_2\lcl\include\interfacebase.inc:54
0000029 RUN(TAPPLICATION($00000000015B7D80)) at B:\lazarus_latest_svn_2\lcl\include\application.inc:1315
0000030 main at B:\lazarus_latest_svn_2\ide\lazarus.pp:153
0000031 MAIN_WRAPPER(Internal error: Missing data location, Internal error: Missing data location) at c:\FPC\fpc_3.0.4\source\rtl\win64\system.pp:115
TagsNo tags attached.
Fixed in Revision63550
LazTarget2.2
Widgetset
Attached Files

Activities

Pascal Riekenberg

2020-07-13 07:59

developer   ~0123952

Fixed in r63550.

Issue History

Date Modified Username Field Change
2020-07-10 21:25 Martin Friebe New Issue
2020-07-10 21:25 Martin Friebe Status new => assigned
2020-07-10 21:25 Martin Friebe Assigned To => Pascal Riekenberg
2020-07-13 07:59 Pascal Riekenberg Status assigned => resolved
2020-07-13 07:59 Pascal Riekenberg Resolution open => fixed
2020-07-13 07:59 Pascal Riekenberg Fixed in Revision => 63550
2020-07-13 07:59 Pascal Riekenberg LazTarget => 2.2
2020-07-13 07:59 Pascal Riekenberg Note Added: 0123952