Recent

Author Topic: Lazarus IDE 2.2.0 crashes on Tools>Options  (Read 1672 times)

Erik@T

  • New member
  • *
  • Posts: 9
Lazarus IDE 2.2.0 crashes on Tools>Options
« on: January 11, 2022, 03:45:12 pm »
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!

440bx

  • Hero Member
  • *****
  • Posts: 2765
Re: Lazarus IDE 2.2.0 crashes on Tools>Options
« Reply #1 on: January 11, 2022, 03:56:19 pm »
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.
FPC v3.0.4 and Lazarus 1.8.2 on Windows 7 64bit.

Martin_fr

  • Administrator
  • Hero Member
  • *
  • Posts: 7885
  • Debugger - SynEdit - and more
    • wiki
Re: Lazarus IDE 2.2.0 crashes on Tools>Options
« Reply #2 on: January 11, 2022, 04:33:32 pm »
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.



Erik@T

  • New member
  • *
  • Posts: 9
Re: Lazarus IDE 2.2.0 crashes on Tools>Options
« Reply #3 on: January 11, 2022, 07:56:43 pm »
@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 <http://gnu.org/licenses/gpl.html>
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:
<http://www.gnu.org/software/gdb/bugs/>.
Find the GDB manual and other documentation resources online at:
    <http://www.gnu.org/software/gdb/documentation/>.

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/control.inc:2004
2004    include/control.inc: No such file or directory.
(gdb) bt
#0  0x00000001001b4eaf in ADDHANDLER (this=0x8767e170, HANDLERTYPE=CHTONBEFOREDESTRUCTION, AMETHOD=..., ASFIRST=false)
    at include/control.inc:2004
#1  0x00000001001bc6ad in ADDHANDLERONBEFOREDESTRUCTION (this=0x8767e170, ONBEFOREDESTRUCTIONEVENT=..., ASFIRST=false)
    at include/control.inc:5019
#2  0x0000000100183a28 in SETLWINCONTROL (this=..., AVALUE=0x8767e170) at win32callback.inc:539
#3  0x0000000100186caa in DOMSGMEASUREITEM (this=...) at win32callback.inc:1855
#4  0x0000000100188779 in DOWINDOWPROC (this=...) at win32callback.inc:2455
#5  0x00000001001895c8 in WINDOWPROC (WINDOW=3542748, MSG=44, WPARAM=2271732080, LPARAM=989507603368)
    at win32callback.inc:2771
#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\amd64_microsoft.windows.common-controls_6595b64144ccf1df_6.0.19041.1110_none_60b5254171f9507e\comctl32.dll
#11 0x00007ff8df57dc72 in TaskDialogIndirect ()
   from C:\WINDOWS\WinSxS\amd64_microsoft.windows.common-controls_6595b64144ccf1df_6.0.19041.1110_none_60b5254171f9507e\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)
    at win32callback.inc:124
#15 0x00000001001889ff in DOWINDOWPROC (this=...) at win32callback.inc:2514
#16 0x00000001001895c8 in WINDOWPROC (WINDOW=6030624, MSG=1, WPARAM=0, LPARAM=989507606368) at win32callback.inc:2771
#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/wincontrol.inc:7545
#30 0x00000001001ace40 in CREATEHANDLE (this=0x25b8767e170) at include/wincontrol.inc:7455
#31 0x00000001001ae50d in HANDLENEEDED (this=0x25b8767e170) at include/wincontrol.inc:7908
#32 0x00000001001ad9bf in CREATEWND (this=0x25b876576b0) at include/wincontrol.inc:7590
#33 0x000000010003b5d3 in CREATEWND (this=0x25b876576b0) at include/scrollingwincontrol.inc:31
#34 0x00000001000445dd in CREATEWND (this=0x25b876576b0) at include/customform.inc:2693
#35 0x0000000100045935 in CREATEWND (this=0x25b876576b0) at include/customform.inc:3157
#36 0x00000001001ace40 in CREATEHANDLE (this=0x25b876576b0) at include/wincontrol.inc:7455
#37 0x00000001001ae50d in HANDLENEEDED (this=0x25b876576b0) at include/wincontrol.inc:7908
#38 0x00000001001ae4e9 in HANDLENEEDED (this=0x25b8767e170) at include/wincontrol.inc:7902
#39 0x000000010019bc8b in CREATEHANDLE (this=0x25b864b6350) at include/controlcanvas.inc:96
#40 0x000000010012e2de in REQUIREDSTATE (this=0x25b864b6350, REQSTATE=...) at include/canvas.inc:1706
#41 0x000000010012e5ca in TEXTEXTENT (this=0x25b864b6350, TEXT=0x101195d98 'Match action pos of mouse down') at include/canvas.inc:1792
#42 0x000000010012e71a in TEXTWIDTH (this=0x25b864b6350, TEXT=0x101195d98 'Match action pos of mouse down') at include/canvas.inc:1816
#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/customform.inc:921
#46 0x000000010003d79e in AFTERCONSTRUCTION (this=0x25b876576b0) at include/customform.inc:77
#47 0x0000000100045a1f in CREATE (this=0x25b876576b0, vmt=0x1, THEOWNER=0x25b87655f70) at include/customform.inc:3170
#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/menuitem.inc:83
#58 0x00000001001ea99a in DOCLICKED (this=0x25b857323d0, MSG=) at include/menuitem.inc:296
#59 0x00000001000112f1 in SYSTEM$_$TOBJECT_$__$$_DISPATCH$formal ()
#60 0x0000000000000000 in ?? ()
Backtrace stopped: previous frame inner to this frame (corrupt stack?)
(gdb)
===

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

Martin_fr

  • Administrator
  • Hero Member
  • *
  • Posts: 7885
  • Debugger - SynEdit - and more
    • wiki
Re: Lazarus IDE 2.2.0 crashes on Tools>Options
« Reply #4 on: January 11, 2022, 09:19:17 pm »
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  [Select][+][-]
  1. diff --git a/lcl/interfaces/win32/win32callback.inc b/lcl/interfaces/win32/win32callback.inc
  2. index 68fedbfb47..08b09fb360 100644
  3. --- a/lcl/interfaces/win32/win32callback.inc
  4. +++ b/lcl/interfaces/win32/win32callback.inc
  5. @@ -1851,9 +1851,9 @@ procedure TWindowProcHelper.DoMsgMeasureItem;
  6.      else
  7.      if WParam <> 0 then
  8.      begin
  9. -      lWinControl := TWinControl(WParam);
  10. +//      lWinControl := TWinControl(WParam);
  11.        //if Assigned(lWinControl) then   <- already tested
  12. -      SetLMessageAndParams(LM_MEASUREITEM, True);
  13. +//      SetLMessageAndParams(LM_MEASUREITEM, True);
  14.      end;
  15.    end;
  16.  end;
  17.  

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)

Martin_fr

  • Administrator
  • Hero Member
  • *
  • Posts: 7885
  • Debugger - SynEdit - and more
    • wiki

Erik@T

  • New member
  • *
  • Posts: 9
Re: Lazarus IDE 2.2.0 crashes on Tools>Options
« Reply #6 on: January 13, 2022, 10:36:32 am »
Hi Martin_fr, thanks for the fix, it works in my case, no crashes anymore in menu Tools > Options.

I did some further investigation and the crash happens on the first line:
lWinControl := TWinControl(WParam);

Also tried a try..except but this does not help, still a crash without error-message. If I can test something else to "really" fix this issue then just let me know. For now I can use this version of Lazarus again. Thanks!

Erik@T

  • New member
  • *
  • Posts: 9
Re: Lazarus IDE 2.2.0 crashes on Tools>Options
« Reply #7 on: May 20, 2022, 01:45:18 pm »
In Lazarus 2.2.2 (Win64) the crash is still there like in 2.2.0.
I have to do the fix again in 'win32callback.inc'.

 

TinyPortal © 2005-2018