Forum > General

Lazarus IDE 2.2.0 crashes on Tools>Options

(1/2) > >>

I was running Lazarus 2.0.12, everything worked just fine. It’s on a (work) computer on which I don’t have admin rights so I run the Lazarus setup as invoker (DOS-prompt, set __COMPAT_LAYER=RUNASINVOKER, run the setup). Worked just fine, also menu Tools > Options worked correctly.

Then I installed/updated to Lazarus 2.2.0 (with FPC 3.2.2) (win64) on the same work-computer (Windows 10 Enterprise 21H1 x64). During the installation I choose for ‘remove previous installation’ and ‘remove settings’. Installation just went fine. Then I installed the packages Anchordocking, Anchordockingdsgn and Dockedformeditor. I can compile the IDE and can compile my projects. All fine.

But now if I go to the menu Options > Tools, then the IDE crashes. No error message, the IDE just quits. This also happens when I go to [Tools > Desktops] and [Tools > Configure Build Lazarus].

What I’ve tried but without positive effect (still crashing IDE on Tools > Options):
-   Delete all settings in [c:\Users\myname\AppData\Local\lazarus].
-   Uninstalled the three dock-packages.
-   Completely removed Lazarus and settings and reinstalled Lazarus.

So I think there has to be an environment change that causes the crash, but I cannot find what it can be. I’ve even installed the previous Lazarus version 2.0.12 next to version 2.2.0 and now I get an Access Violation in 2.0.12 (not before) if I go to Options > Tools, but no IDE crash. So now, if I go further in the Options, I again get an Access Violation on ‘Form Editor’, ‘Object Inspector’, ‘Messages Window’ and some other options, but not all options. In 2.2.0 the IDE still crashes on Tools > Options.

I also have another computer (private; here I do have admin rights) on which Lazarus 2.2.0 runs just fine (very fine  :D). So I think it’s a combination of my work computer, no admin rights, some environment setting/protection, …).

Does anybody have any idea on how to get rid of this IDE crash? Or some logging tool to investigate the crash? Thanks!

Just as a profilactic move, I suggest you test the memory on your computer.  You can boot the computer using Memtest86.  Also, if you have a WinPE disk (or some other bootable utility) I would suggest you scan the hard drive for bad sectors.

I suggest you do the above because, it's uncommon to have a crash just because a user lacks some rights (usually you get an error message of some kind, not a crash) also, you are the only one experiencing that problem yet, it is unlikely that you're the only one using Lazarus without admin rights.

The conclusion is, it's definitely possible and somewhat likely that the problem is caused by something wrong in the hardware.  It would be good to eliminate that possibility first.

2 things you can try

In both cases, you may have to rebuild the IDE with debug settings first.
Tools > configure build Lazarus
Custom Options:  -gw -gl -gh -Criot

1) run lazarus as follows (specify a folder of your choice for the log)
lazarus.exe --debug-log=c:\lazlog.txt

See if the log has a stack trace (with filenames and lines).

2) if above does not get a stacktrace

from a command "cmd.exe" prompt (for 64 bit / diff path for 32)
cd c:\lazarus
mingw\x86_64-win64\bin\gdb.exe lazarus.exe

In gdb enter r then return.

Wait for the crash.
Enter bt  then return

Copy the output.

@440bx: Thanks for your answer but I cannot boot this work computer form usb. But I don’t think it is a hardware problem. I “never” have crashes in any software and it’s running rock solid; never had blue screens or something like that. I don’t think it’s a lack of admin rights either because the previous Lazarus version just ran fine until I installed version 2.2.0.

@Martin_fr: I cannot rebuild the IDE with special options because when I go to Tools > Configure build Lazarus, the IDE crashes/quits. About your other options:

1) Run lazarus.exe --debug-log=c:\lazlog.txt, this is the log:

Hint: (lazarus) [TMainIDE.ParseCmdLineOptions] PrimaryConfigPath="C:\Users\name\AppData\Local\lazarus"
Hint: (lazarus) [TMainIDE.ParseCmdLineOptions] SecondaryConfigPath="C:\Users\ name\local\Software\Lazarus"
TMainIDE.DoOpenProjectFile A "C:\Users\name\Data\Lazarus\TestDpiPerMonitor\TestDpiPerMonitor.lpi"
Hint: (lazarus) [TBuildManager.SetBuildTarget] Old=x86_64-win64-win32 New=x86_64-win64-win32 Changed: OS/CPU=True LCL=False
TCustomFormEditor.JITListFindAncestors Class=TGroupBox
TCustomFormEditor.JITListFindAncestors Class=TRadioButton
TCustomFormEditor.JITListFindAncestors Class=TRadioButton
TCustomFormEditor.JITListFindAncestors Class=TButton
TCustomFormEditor.JITListFindAncestors Class=TSpeedButton
TCustomFormEditor.JITListFindAncestors Class=TSpeedButton
TCustomFormEditor.JITListFindAncestors Class=TStatusBar
TCustomFormEditor.JITListFindAncestors Class=TButton
TCustomFormEditor.JITListFindAncestors Class=TCheckBox
TCustomFormEditor.JITListFindAncestors Class=TCheckBox
TCustomFormEditor.JITListFindAncestors Class=TButton
TCustomFormEditor.JITListFindAncestors Class=TPanel
TCustomFormEditor.JITListFindAncestors Class=TToolBar
TCustomFormEditor.JITListFindAncestors Class=TToolButton
TCustomFormEditor.JITListFindAncestors Class=TToolButton
TCustomFormEditor.JITListFindAncestors Class=TToolButton
TCustomFormEditor.JITListFindAncestors Class=TStatusBar
TCustomFormEditor.JITListFindAncestors Class=TCheckBox
TCustomFormEditor.JITListFindAncestors Class=

So the log is not complete when the IDE crashes. I’ve tried different times and waited long, but it quits here.

2) Stacktrace:

Microsoft Windows [Version 10.0.19043.1415]
GNU gdb unicode (GDB) 9.2
Copyright (C) 2020 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
Type "show copying" and "show warranty" for details.
This GDB was configured as "x86_64-w64-mingw32".
Type "show configuration" for configuration details.
For bug reporting instructions, please see:
Find the GDB manual and other documentation resources online at:

For help, type "help".
Type "apropos word" to search for commands related to "word"...
Reading symbols from lazarus.exe...
(gdb) r
Starting program: c:\temp\lazarus.exe
[New Thread 11168.0x1a54]
[New Thread 11168.0x2d8c]
[New Thread 11168.0x3408]

Thread 1 received signal SIGSEGV, Segmentation fault.
0x00000001001b4eaf in ADDHANDLER (this=0x8767e170, HANDLERTYPE=CHTONBEFOREDESTRUCTION, AMETHOD=..., ASFIRST=false)
    at include/
2004    include/ No such file or directory.
(gdb) bt
#0  0x00000001001b4eaf in ADDHANDLER (this=0x8767e170, HANDLERTYPE=CHTONBEFOREDESTRUCTION, AMETHOD=..., ASFIRST=false)
    at include/
    at include/
#2  0x0000000100183a28 in SETLWINCONTROL (this=..., AVALUE=0x8767e170) at
#3  0x0000000100186caa in DOMSGMEASUREITEM (this=...) at
#4  0x0000000100188779 in DOWINDOWPROC (this=...) at
#5  0x00000001001895c8 in WINDOWPROC (WINDOW=3542748, MSG=44, WPARAM=2271732080, LPARAM=989507603368)
#6  0x00000001002f58a8 in CUSTOMFORMWNDPROC (WINDOW=3542748, MSG=44, WPARAM=2271732080, LPARAM=989507603368)
    at win32wsforms.pp:397
#7  0x00007ff8f736e7e8 in USER32!CallWindowProcW () from C:\WINDOWS\System32\user32.dll
#8  0x00007ff8f736ddab in USER32!SendMessageW () from C:\WINDOWS\System32\user32.dll
#9  0x00007ff8f736d61a in USER32!SendMessageW () from C:\WINDOWS\System32\user32.dll
#10 0x00007ff8df57d469 in TaskDialogIndirect ()
   from C:\WINDOWS\WinSxS\\comctl32.dll
#11 0x00007ff8df57dc72 in TaskDialogIndirect ()
   from C:\WINDOWS\WinSxS\\comctl32.dll
#12 0x00007ff8f736e7e8 in USER32!CallWindowProcW () from C:\WINDOWS\System32\user32.dll
#13 0x00007ff8f736e47e in USER32!CallWindowProcW () from C:\WINDOWS\System32\user32.dll
#14 0x0000000100182d0a in CALLDEFAULTWINDOWPROC (WINDOW=6030624, MSG=1, WPARAM=0, LPARAM=989507606368)
#15 0x00000001001889ff in DOWINDOWPROC (this=...) at
#16 0x00000001001895c8 in WINDOWPROC (WINDOW=6030624, MSG=1, WPARAM=0, LPARAM=989507606368) at
#17 0x000000010028cba8 in LISTBOXWINDOWPROC (WINDOW=6030624, MSG=1, WPARAM=0, LPARAM=989507606368)
    at win32wsstdctrls.pp:771
#18 0x00000001002eb868 in CHECKLISTBOXWNDPROC (WINDOW=6030624, MSG=1, WPARAM=0, LPARAM=989507606368)
--Type <RET> for more, q to quit, c to continue without paging--c
    at win32wschecklst.pp:138
#19 0x00007ff8f736e7e8 in USER32!CallWindowProcW () from C:\WINDOWS\System32\user32.dll
#20 0x00007ff8f736e36c in USER32!DispatchMessageW () from C:\WINDOWS\System32\user32.dll
#21 0x00007ff8f7382fc7 in USER32!InitDManipHook () from C:\WINDOWS\System32\user32.dll
#22 0x00007ff8f8bb0ba4 in ntdll!KiUserCallbackDispatcher () from C:\WINDOWS\SYSTEM32\ntdll.dll
#23 0x00007ff8f6361ec4 in win32u!NtUserCreateWindowEx () from C:\WINDOWS\System32\win32u.dll
#24 0x00007ff8f7367d1b in USER32!CreateWindowExW () from C:\WINDOWS\System32\user32.dll
#25 0x00007ff8f73678e8 in USER32!CreateWindowExW () from C:\WINDOWS\System32\user32.dll
#26 0x00007ff8f7367732 in USER32!CreateWindowExW () from C:\WINDOWS\System32\user32.dll
#27 0x0000000100282f51 in FINISHCREATEWINDOW (AWINCONTROL=0x25b8767e170, PARAMS=..., ALTERNATECREATEWINDOW=false, SUBCLASS=true) at win32wscontrols.pp:212
#28 0x00000001002ebb33 in CREATEHANDLE (self=0x25b8766db70, AWINCONTROL=0x25b8767e170, APARAMS=...) at win32wschecklst.pp:164
#29 0x00000001001ad755 in CREATEWND (this=0x25b8767e170) at include/
#30 0x00000001001ace40 in CREATEHANDLE (this=0x25b8767e170) at include/
#31 0x00000001001ae50d in HANDLENEEDED (this=0x25b8767e170) at include/
#32 0x00000001001ad9bf in CREATEWND (this=0x25b876576b0) at include/
#33 0x000000010003b5d3 in CREATEWND (this=0x25b876576b0) at include/
#34 0x00000001000445dd in CREATEWND (this=0x25b876576b0) at include/
#35 0x0000000100045935 in CREATEWND (this=0x25b876576b0) at include/
#36 0x00000001001ace40 in CREATEHANDLE (this=0x25b876576b0) at include/
#37 0x00000001001ae50d in HANDLENEEDED (this=0x25b876576b0) at include/
#38 0x00000001001ae4e9 in HANDLENEEDED (this=0x25b8767e170) at include/
#39 0x000000010019bc8b in CREATEHANDLE (this=0x25b864b6350) at include/
#40 0x000000010012e2de in REQUIREDSTATE (this=0x25b864b6350, REQSTATE=...) at include/
#41 0x000000010012e5ca in TEXTEXTENT (this=0x25b864b6350, TEXT=0x101195d98 'Match action pos of mouse down') at include/
#42 0x000000010012e71a in TEXTWIDTH (this=0x25b864b6350, TEXT=0x101195d98 'Match action pos of mouse down') at include/
#43 0x0000000100ad8d0a in FILLLISTBOX (this=0x25b876576b0) at mouseactiondialog.pas:131
#44 0x0000000100ad8e97 in FORMCREATE (this=0x25b876576b0, SENDER=0x25b876576b0) at mouseactiondialog.pas:157
#45 0x000000010003f9e3 in DOCREATE (this=0x25b876576b0) at include/
#46 0x000000010003d79e in AFTERCONSTRUCTION (this=0x25b876576b0) at include/
#47 0x0000000100045a1f in CREATE (this=0x25b876576b0, vmt=0x1, THEOWNER=0x25b87655f70) at include/
#48 0x000000010060bb5c in CREATE (this=0x25b87655f70, vmt=0x1, AOWNER=0x25b88767650) at frames/editor_mouseaction_options_advanced.pas:601
#49 0x000000010065fa42 in CREATEEDITORS (this=0x25b88767650) at ideoptionsdlg.pas:509
#50 0x000000010065f191 in TRAVERSESETTINGS (this=0x25b88767650, AOPTIONS=0x25b8272ac20, ANACTION=IODAREAD) at ideoptionsdlg.pas:332
#51 0x000000010065f45b in READALL (this=0x25b88767650) at ideoptionsdlg.pas:369
#52 0x000000010006cd8b in DOOPENIDEOPTIONS (this=0x25b8272a960, AEDITOR=0x0, ACAPTION=0x0, AOPTIONSFILTER=..., highAOPTIONSFILTER=-1, ASETTINGS=...) at main.pp:4991
#53 0x0000000100424850 in DOOPENIDEOPTIONS (this=0x25b8272a960, AEDITOR=0x0, ACAPTION=0x0) at lazideintf.pas:796
#54 0x000000010006c89b in MNUENVGENERALOPTIONSCLICKED (this=0x25b8272a960, SENDER=0x25b8577aa10) at main.pp:4916
#55 0x000000010041fcef in MENUITEMCLICK (this=0x25b8577aa10, SENDER=0x25b857323d0) at menuintf.pas:547
#56 0x00000001004231e0 in MENUITEMCLICK (this=0x25b8577aa10, SENDER=0x25b857323d0) at menuintf.pas:1699
#57 0x00000001001ea085 in CLICK (this=0x25b857323d0) at include/
#58 0x00000001001ea99a in DOCLICKED (this=0x25b857323d0, MSG=) at include/
#59 0x00000001000112f1 in SYSTEM$_$TOBJECT_$__$$_DISPATCH$formal ()
#60 0x0000000000000000 in ?? ()
Backtrace stopped: previous frame inner to this frame (corrupt stack?)

For both logs, the result after starting the IDE and then going to Tools > Options. Nothing more.
Thanks again.

Well the stacktrace looks good (as good as it gets....)
Not my area of expertise, but I have seen something similar recently....

Try the following patch:

--- Code: Diff  [+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i < x.length; i++) { x[i].style.maxHeight='none'; x[i].style.height = Math.min(x[i].clientHeight+15,306)+'px'; x[i].style.resize = "vertical";}};} ---diff --git a/lcl/interfaces/win32/ b/lcl/interfaces/win32/win32callback.incindex 68fedbfb47..08b09fb360 100644--- a/lcl/interfaces/win32/ b/lcl/interfaces/win32/ -1851,9 +1851,9 @@ procedure TWindowProcHelper.DoMsgMeasureItem;     else     if WParam <> 0 then     begin-      lWinControl := TWinControl(WParam);+//      lWinControl := TWinControl(WParam);       //if Assigned(lWinControl) then   <- already tested-      SetLMessageAndParams(LM_MEASUREITEM, True);+//      SetLMessageAndParams(LM_MEASUREITEM, True);     end;   end; end; 
It should stop the crash. But I do not know if it has side effects.

Hope the line numbers are correct. This was done on the main branch....
The surrounding function is "procedure TWindowProcHelper.DoMsgMeasureItem;"

This code is to measure the size of items in combobox, listbox or listview.
So if with the above patch you see any strange effects with them, report them.

I haven't got any other info on this yet, sorry.
I am also not sure why it seems to affect only very few selected systems. (you are the 2nd, so far)


[0] Message Index

[#] Next page

Go to full version