06.10.2020 16:23, Martin Frb via lazarus пишет:
On 06/10/2020 15:09, Maxim Ganetsky via lazarus wrote:

----
Can you try to catch it in the debugger, and see what params are given
to NewTextOut
in
#2  0x00ab95f6 in DRAWHILIGHTMARKUPTOKEN (ATOKENINFO=...,
parentfp=0x13abf6e8)
     at lazsyntextarea.pp:1741

  fTextDrawer.NewTextOut(TxtLeft, rcToken.Top, TxtFlags, tok,
ATokenInfo.Tk.TokenStart, ATokenInfo.Tk.TokenLength, FEtoBuf);
Can you add some debugln in a format convenient to you? This will
simplify things, I think.

This is in the paint handler, and it is called for each token. So potentially very slow with debugln.

But since it is in startup, hopefully you wont have to many.

Apply this patch please


With this patch applied Lazarus seems to crash on debugln in lazsyntextarea.pp. Just in case, I tried to remove this particular debugln, then it printed 'BEFORE' and nothing more.

i:\FPC\lazarus>lazarus --debug-output=.\dbgoutput.txt
Hint: (lazarus) [TMainIDE.ParseCmdLineOptions] PrimaryConfigPath="C:\Users\Maxim
\AppData\Local\lazarus"
Hint: (lazarus) [TMainIDE.ParseCmdLineOptions] SecondaryConfigPath="i:\FPC\lazar
us"
Hint: (lazarus) [TMainIDE.LoadGlobalOptions]
Hint: (lazarus) LastCalled="I:\FPC\lazarus\lazarus.old.working.exe"
Hint: (lazarus) CurPrgName="i:\FPC\lazarus\lazarus.exe"
Hint: (lazarus) AltPrgName="C:\Users\Maxim\AppData\Local\lazarus\bin\lazarus.exe
"
Hint: (lazarus) [TBuildManager.SetBuildTarget] Old=i386-win32-win32 New=i386-win
32-win32 Changed: OS/CPU=True LCL=False
TApplication.HandleException: EAccessViolation
Access violation
  Stack trace:
  $00C12B2D  DRAWHILIGHTMARKUPTOKEN,  line 1740 of lazsyntextarea.pp
  $00C11C76  PAINTLINES,  line 1799 of lazsyntextarea.pp
  $00C11847  PAINTTEXTLINES,  line 1871 of lazsyntextarea.pp
  $00C113D8  DOPAINT,  line 1489 of lazsyntextarea.pp
  $00C07EA0  PAINT,  line 1308 of syneditmiscclasses.pp
  $00C0FDD2  DOPAINT,  line 1134 of lazsyntextarea.pp
  $00C07EA0  PAINT,  line 1308 of syneditmiscclasses.pp
  $00D9A022  DOPAINT,  line 1353 of sourcesyneditor.pas
  $00C07EA0  PAINT,  line 1308 of syneditmiscclasses.pp
  $0079ECCB  PAINT,  line 4221 of synedit.pp
  $005B3471  PAINTWINDOW,  line 123 of include/customcontrol.inc
  $0059BB7B  PAINTHANDLER,  line 4857 of include/wincontrol.inc
  $005A00A4  WMPAINT,  line 6851 of include/wincontrol.inc
  $005B3330  WMPAINT,  line 103 of include/customcontrol.inc
  $004103A1
  $0059D0A7  WNDPROC,  line 5429 of include/wincontrol.inc
  $007A6B0F  WNDPROC,  line 6399 of synedit.pp
FreeFormEditor: FormEditor1=TFormEditor
Hint: (lazarus) [TMainIDE.Destroy] B  -> inherited Destroy... TMainIDE
Hint: (lazarus) [TMainIDE.Destroy] END
Heap dump by heaptrc unit of i:\FPC\lazarus\lazarus.exe
6222427 memory blocks allocated : 556846869/572547168
6211889 memory blocks freed     : 555436555/571105040
10538 unfreed memory blocks : 1410314
True heap size : 28114944 (128 used in System startup)
True free heap : 25543392
Should be : 25661040
Call trace for block $1CEE6DD0 size 64
  $00418EBF
  $770034A1
  $77003473
  $76FB0133
  $00C11C76  PAINTLINES,  line 1799 of lazsyntextarea.pp
  $00C11847  PAINTTEXTLINES,  line 1871 of lazsyntextarea.pp
  $00C113D8  DOPAINT,  line 1489 of lazsyntextarea.pp
  $00C07EA0  PAINT,  line 1308 of syneditmiscclasses.pp
  $00C0FDD2  DOPAINT,  line 1134 of lazsyntextarea.pp
  $00C07EA0  PAINT,  line 1308 of syneditmiscclasses.pp
  $00D9A022  DOPAINT,  line 1353 of sourcesyneditor.pas
  $00C07EA0  PAINT,  line 1308 of syneditmiscclasses.pp
  $0079ECCB  PAINT,  line 4221 of synedit.pp
  $005B3471  PAINTWINDOW,  line 123 of include/customcontrol.inc
  $0059BB7B  PAINTHANDLER,  line 4857 of include/wincontrol.inc
  $005A00A4  WMPAINT,  line 6851 of include/wincontrol.inc
Call trace for block $1C6FECD0 size 92

--
Best regards,
 Maxim Ganetsky                  mailto:gan...@narod.ru
--
_______________________________________________
lazarus mailing list
lazarus@lists.lazarus-ide.org
https://lists.lazarus-ide.org/listinfo/lazarus

Reply via email to