Recent

Author Topic: Access violation when opening Tools/Options  (Read 3238 times)

Чебурашка

  • Hero Member
  • *****
  • Posts: 579
  • СЛАВА УКРАЇНІ! / Slava Ukraïni!
Access violation when opening Tools/Options
« on: April 19, 2024, 12:27:34 pm »
Hello,
I noticed that with the lazarus shipped by debian 12 (lazarus 2.2.6) when I do Tools/Options I get an Access Violation, that seems related to the parsing of the jedi code formatter settings.

Once I encountered this issue, I tried to download from https://www.lazarus-ide.org/ the debian packages available there, in this case I tried with lazarus 3.2, but seems I get the same error.

Does anybody have the same problem?
« Last Edit: April 19, 2024, 02:09:06 pm by Чебурашка »
FPC 3.2.0/Lazarus 2.0.10+dfsg-4+b2 on Debian 11.5
FPC 3.2.2/Lazarus 2.2.0 on Windows 10 Pro 21H2

TRon

  • Hero Member
  • *****
  • Posts: 2658
Re: Access violation when opening Tools/Options
« Reply #1 on: April 20, 2024, 07:06:49 am »
Debian bookworm x86_64 with mate & gtk here and no problem as described when running Lazarus 2.2.4, 2.2.6, 2.3, 3.0 or 3.2

Have you tried running Lazarus from the commandline ? Usually it emits a couple of lines when things go wrong and those lines might be able to tell more (so please copy-paste those lines to a message in this forum in case it emitted something useful).

It is possible to even obtain more (debug) information by providing commandline options to Lazarus. Type ./lazarus --help for detailed information for the argument --debug-enable and the options that it accepts.
« Last Edit: April 20, 2024, 07:19:15 am by TRon »

JuhaManninen

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 4479
  • I like bugs.
Re: Access violation when opening Tools/Options
« Reply #2 on: April 20, 2024, 10:29:38 am »
... when I do Tools/Options I get an Access Violation, that seems related to the parsing of the jedi code formatter settings.
Nobody else seems to have the problem, thus it must be wrong/corrupt data in your local configuration.
Delete or rename your local configuration directory, by default ~/.lazarus
It will be recreated with default data when you start Lazarus again. Do you still get the error?
Mostly Lazarus trunk and FPC 3.2 on Manjaro Linux 64-bit.

Чебурашка

  • Hero Member
  • *****
  • Posts: 579
  • СЛАВА УКРАЇНІ! / Slava Ukraïni!
Re: Access violation when opening Tools/Options
« Reply #3 on: April 20, 2024, 11:07:19 am »
Thanks,
I came across this error with 2.2.6, then I downloaded and installed 3.2 as said and I got same error, and the latter seems a fresh install, so I guess .lazarus folrd was in kinda default state. To find out was was causing I did enable the extra logging and ran lazarus from bash, so I was ale to tell that it was due to jcf settings.

Monday I will try again once I get to work, but is good that nobody else gets same error at least.
FPC 3.2.0/Lazarus 2.0.10+dfsg-4+b2 on Debian 11.5
FPC 3.2.2/Lazarus 2.2.0 on Windows 10 Pro 21H2

Martin_fr

  • Administrator
  • Hero Member
  • *
  • Posts: 9983
  • Debugger - SynEdit - and more
    • wiki
Re: Access violation when opening Tools/Options
« Reply #4 on: April 20, 2024, 11:21:28 am »
First backup all of your config files.

Then when you find the config file that causes the crash, and it has no personal data in it, please upload it. Then we can have a look to make sure such broken config give a proper error prompt, rather than a crash.

TRon

  • Hero Member
  • *****
  • Posts: 2658
Re: Access violation when opening Tools/Options
« Reply #5 on: April 20, 2024, 11:24:35 am »
To find out was was causing I did enable the extra logging and ran lazarus from bash, so I was ale to tell that it was due to jcf settings.
Glad to hear that you got that figured out.

Quote
Monday I will try again once I get to work, but is good that nobody else gets same error at least.
It does make me wonder if the IDE should (be allowed to) crash when something is perhaps configured incorrectly or has become incompatible (*).

fwiw: by default the Lazarus configuration directory is installed 'globally' (usually in your user directory) and removing the package alone will not take care of these user configurations. That should be done manually. It is reason for a lot of people to use the pcp option to point the user configuration to a directory of your choice where it is possible to have multiple configuration directories for different versions of Lazarus (even when multiple versions of Lazarus are installed at the same time)

See also here about primary configuration path and here about multiple Lazarus (take special note of the lazarus.cfg file options).

(*) edit: ah I see I crossed Martin_fr's reaction where he suggest to upload the offending configuration files, most probably in an attempt to try prevent such crashes (?)
« Last Edit: April 20, 2024, 11:31:15 am by TRon »

JuhaManninen

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 4479
  • I like bugs.
Re: Access violation when opening Tools/Options
« Reply #6 on: April 20, 2024, 12:31:34 pm »
@Чебурашка did not even try my suggestion which was to delete the local config dir.  :(

It does make me wonder if the IDE should (be allowed to) crash when something is perhaps configured incorrectly or has become incompatible (*).
It shouldn't crash. A debugger stacktrace would also help to find where it crashes. The whole IDE must then be compiled with debug info and run under a debugger.
Mostly Lazarus trunk and FPC 3.2 on Manjaro Linux 64-bit.

TRon

  • Hero Member
  • *****
  • Posts: 2658
Re: Access violation when opening Tools/Options
« Reply #7 on: April 21, 2024, 02:42:38 am »
It shouldn't crash. A debugger stacktrace would also help to find where it crashes. The whole IDE must then be compiled with debug info and run under a debugger.
Thank you for the detailed in/con-formation JuhaManninen.

An upload of the offending configuration file(s) would be beneficial then as well as testing with a clean configuration directory with feedback whether that fixed the issue or not.

dbannon

  • Hero Member
  • *****
  • Posts: 2847
    • tomboy-ng, a rewrite of the classic Tomboy
Re: Access violation when opening Tools/Options
« Reply #8 on: April 21, 2024, 03:28:54 am »
Hmm, I have to say that, as a committed "build lazarus from source" sort of guy, I find the idea of a default (and therefor reusable) configure directory part of the problem.

I really wonder if we should force a new config directory on a new install/build by default. Let the die hards over ride if they must. For most users, the few minutes it takes setup a new install is a small price to pay to avoid the advice "blow way your config" that is needed so often. I never reuse an old config.

Davo
Lazarus 3, Linux (and reluctantly Win10/11, OSX Monterey)
My Project - https://github.com/tomboy-notes/tomboy-ng and my github - https://github.com/davidbannon

TRon

  • Hero Member
  • *****
  • Posts: 2658
Re: Access violation when opening Tools/Options
« Reply #9 on: April 21, 2024, 03:54:59 am »
That is an interesting idea dbannon and made me think of something else.

Would it be a good idea to have a configuration directory that at least has the version number included (whether in separated sub-directories or something else). That way it would be possible to make it optional to 'import' an existing configuration while still being able to have them separated (by default).

On the other hand I wonder how many of us do have multiple installations of different versions installed. I often see people mention that they have installed multiple Lazarus' but of the same version (in which case my suggestion wouldn't stick and your idea would be better suited ?)

Чебурашка

  • Hero Member
  • *****
  • Posts: 579
  • СЛАВА УКРАЇНІ! / Slava Ukraïni!
Re: Access violation when opening Tools/Options
« Reply #10 on: April 21, 2024, 07:05:07 am »
@Чебурашка did not even try my suggestion which was to delete the local config dir.  :(

I ll do this Monday when I ll be at work again
FPC 3.2.0/Lazarus 2.0.10+dfsg-4+b2 on Debian 11.5
FPC 3.2.2/Lazarus 2.2.0 on Windows 10 Pro 21H2

Чебурашка

  • Hero Member
  • *****
  • Posts: 579
  • СЛАВА УКРАЇНІ! / Slava Ukraïni!
Re: Access violation when opening Tools/Options
« Reply #11 on: April 22, 2024, 10:16:35 am »
Hello,
thanks for patience.

As suggested, I deleted the ~/.lazarus folder and ran lazarus-ide command from commandline:

Code: Bash  [Select][+][-]
  1. > rm -rf ~/.lazarus;
  2. > lazarus-ide --debug-log=lazarus-debug.log --debug-enable="SYNMOUSEEVENTS
  3. ,                      DBG_VERBOSE
  4. ,                      DBG_WARNINGS
  5. ,                      DBG_STATE
  6. ,                      DBG_EVENTS
  7. ,                      DBG_STATE_EVENT
  8. ,                      DBG_DATA_MONITORS
  9. ,                      DBG_DISASSEMBLER
  10. ,                      FPDBG_VERBOSE_MEM
  11. ,                      FPDBG_THREADS
  12. ,                      DBG_ERRORS
  13. ,                      FPDBG_FUNCCALL
  14. ,                      FPDBG_DWARF_VERBOSE
  15. ,                      FPDBG_DWARF_ERRORS
  16. ,                      FPDBG_DWARF_WARNINGS
  17. ,                      FPDBG_DWARF_SEARCH
  18. ,                      FPDBG_DWARF_DATA_WARNINGS
  19. ,                      DBG_BREAKPOINTS
  20. ,                      FPDBG_COMMANDS
  21. ,                      FPDBG_DWARF_CFI_WARNINGS
  22. ,                      FPDBG_DWARF_VERBOSE_LOAD
  23. ,                      FPDBG_LINUX
  24. ,                      FPDBG_QUEUE
  25. ,                      DBG_BREAKPOINT
  26. ,                      DBG_LOCATION_INFO
  27. ,                      SRCED_LOCK
  28. ,                      SRCED_OPEN
  29. ,                      SRCED_CLOSE
  30. ,                      SRCED_PAGES
  31. ,                      DBG_CMD_ECHO
  32. ,                      DBG_CMD_ECHO_FULL
  33. ,                      DBGMI_TYPE_INFO
  34. ,                      DBGMI_TIMEOUT_DEBUG
  35. ,                      DBG_THREAD_AND_FRAME
  36. ,                      DBGMI_QUEUE_DEBUG
  37. ,                      DBGMI_STRUCT_PARSER";
  38.  

Once started lazarus, the only operation I did is to try opening Tools/Options command in the top menu
Hereafter the contents of the log file:

Code: Text  [Select][+][-]
  1. Hint: (lazarus) [TMainIDE.ParseCmdLineOptions] PrimaryConfigPath="/home/mep/.lazarus"
  2. Hint: (lazarus) [TMainIDE.ParseCmdLineOptions] SecondaryConfigPath="/etc/lazarus"
  3. CopySecondaryConfigFile /etc/lazarus/environmentoptions.xml -> /home/mep/.lazarus/environmentoptions.xml
  4. AddDefaultRecentProjects: Adding default projects
  5. NOTE: editor options config file not found - using defaults
  6. Looking for code tools config file:  "/home/mep/.lazarus/codetoolsoptions.xml"
  7. NOTE: codetools config file not found - using defaults
  8. Hint: [TPCTargetConfigCache.NeedsUpdate] TargetOS="linux" TargetCPU="x86_64" Options="" compiler file changed "/usr/bin/fpc" FileAge=1625802185 StoredAge=0
  9. Hint: [TPCTargetConfigCache.NeedsUpdate] /usr/bin/fpc TargetOS=linux TargetCPU=x86_64 CompilerOptions= ExtraOptions=-Fr/usr/share/lazarus/3.2.0/components/codetools/fpc.errore.msg PATH=/usr/local/bin:/usr/bin:/bin:/usr/local/games:/usr/games
  10. Hint: (lazarus) [RunTool] "/usr/bin/fpc" "-iWTOTP" "-Px86_64" "-Tlinux" "-Fr/usr/share/lazarus/3.2.0/components/codetools/fpc.errore.msg"
  11. Hint: (lazarus) [RunTool] "/usr/bin/fpc" "-va" "compilertest.pas" "-Px86_64" "-Tlinux" "-Fr/usr/share/lazarus/3.2.0/components/codetools/fpc.errore.msg"
  12. Hint: [TPCTargetConfigCache.Update] has changed
  13. Hint: [TPCTargetConfigCache.NeedsUpdate] TargetOS="" TargetCPU="" Options="" compiler file changed "/usr/bin/fpc" FileAge=1625802185 StoredAge=0
  14. Hint: [TPCTargetConfigCache.NeedsUpdate] /usr/bin/fpc TargetOS= TargetCPU= CompilerOptions= ExtraOptions= PATH=/usr/local/bin:/usr/bin:/bin:/usr/local/games:/usr/games
  15. Hint: (lazarus) [RunTool] "/usr/bin/fpc" "-iWTOTP"
  16. Hint: (lazarus) [RunTool] "/usr/bin/fpc" "-va" "compilertest.pas" "-Fr/usr/share/lazarus/3.2.0/components/codetools/fpc.errore.msg"
  17. Hint: [TPCTargetConfigCache.Update] has changed
  18. NOTE: help options config file not found - using defaults
  19. Hint: [TPCTargetConfigCache.NeedsUpdate] TargetOS="" TargetCPU="" Options="-Fr/usr/share/lazarus/3.2.0/components/codetools/fpc.errore.msg" compiler file changed "/usr/bin/fpc" FileAge=1625802185 StoredAge=0
  20. Hint: [TPCTargetConfigCache.NeedsUpdate] /usr/bin/fpc TargetOS= TargetCPU= CompilerOptions=-Fr/usr/share/lazarus/3.2.0/components/codetools/fpc.errore.msg ExtraOptions=-Fr/usr/share/lazarus/3.2.0/components/codetools/fpc.errore.msg PATH=/usr/local/bin:/usr/bin:/bin:/usr/local/games:/usr/games
  21. Hint: (lazarus) [RunTool] "/usr/bin/fpc" "-iWTOTP" "-Fr/usr/share/lazarus/3.2.0/components/codetools/fpc.errore.msg" "-Fr/usr/share/lazarus/3.2.0/components/codetools/fpc.errore.msg"
  22. Hint: (lazarus) [RunTool] "/usr/bin/fpc" "-va" "compilertest.pas" "-Fr/usr/share/lazarus/3.2.0/components/codetools/fpc.errore.msg" "-Fr/usr/share/lazarus/3.2.0/components/codetools/fpc.errore.msg"
  23. Hint: [TPCTargetConfigCache.Update] has changed
  24. CopySecondaryConfigFile /etc/lazarus/pas2jsdsgnoptions.xml -> /home/mep/.lazarus/pas2jsdsgnoptions.xml
  25. Hint: (lazarus) [TBuildManager.SetBuildTarget] Old=x86_64-linux-gtk2 New=x86_64-linux-gtk2 Changed: OS/CPU=True LCL=False
  26. DebugDataMonitor: TIdeThreadsMonitor.Clear
  27. [TSourceNotebook.NewFile] A
  28. >> TSourceNotebook.SetPageIndex Cur-PgIdx=0 FPageIndex=-1 Value=0 FUpdateLock=0
  29.   >> TSourceNotebook.DoActiveEditorChanged
  30.   << TSourceNotebook.DoActiveEditorChanged
  31.   TSourceNotebook.ApplyPageIndex calling NotebookPageChanged
  32.   >> TSourceNotebook.NotebookPageChanged PageIndex=0 AutoFocusLock=0 Sender=nil
  33.     TSourceNotebook.NotebookPageChanged TempEdit=TSourceEditor Vis=True Hnd=True
  34.     >> TSourceNotebook.DoActiveEditorChanged
  35.     << TSourceNotebook.DoActiveEditorChanged
  36.   << TSourceNotebook.NotebookPageChanged
  37. << TSourceNotebook.SetPageIndex
  38. [TSourceNotebook.NewFile] B
  39. [TSourceNotebook.NewFile] D
  40. >> TSourceEditor.FocusEditor A unit1 SynEdit1
  41. << TSourceEditor.FocusEditor END unit1 SynEdit1
  42. [TSourceNotebook.NewFile] end
  43. TFPCSrcScan.Execute START /usr/share/fpcsrc/3.2.2/
  44. TSourceEditor.EditorEnter
  45. TFPCSrcScan.Execute found some files: True
  46. ApplyFPCSrcFiles /usr/share/fpcsrc/3.2.2/ FileCount=16266
  47. ApplyFPCSrcFiles SrcCache.Update ...
  48. Hint: [TFPCSourceCache.Update] /usr/share/fpcsrc/3.2.2 has changed.
  49. ApplyFPCSrcFiles BuildBoss.RescanCompilerDefines ...
  50. TFPCSrcScan.OnFilesGathered closing progress item ...
  51. TFPCSrcScan.OnFilesGathered END
  52. TApplication.HandleException: EAccessViolation
  53. Access violation
  54.   Stack trace:
  55.   $0000000000E8CE33
  56.   $0000000001477657
  57.   $0000000001462A62
  58.   $0000000001462831
  59.   $0000000001463678
  60.   $000000000144FF83
  61.   $000000000144FF14
  62.   $000000000144FFF8
  63.   $0000000001450052
  64.   $0000000000CD0A9F
  65.   $00000000004BD368
  66.   $0000000000A31D1F
  67.   $00000000004BCE8B
  68.   $0000000000A2C57F
  69.   $0000000000A303B0
  70.   $00000000005DB7F8
  71.   $00000000005DC1AA
  72. TSourceNotebook.IncUpdateLockInternal
  73. >> TSourceNotebook.CloseFile A  APageIndex=0 Cur-Page=0
  74.   TSourceNotebook.CloseFile TSourceEditor unit1.pas
  75.   TSourceEditor.Close ShareCount=1
  76.   TSourceEditor.Close
  77.   TSourceNotebook.NoteBookDeletePage 0
  78.   TSourceNotebook.NoteBookDeletePage
  79.   TSourceEditor.Destroy
  80.   TSourceEditor.Destroy
  81.   TSourceNotebook.DoClose SourceNotebook:TSourceNotebook
  82.   TSourceNotebook.DoClose
  83.   TSourceNotebook.CloseFile UnLock
  84. << TSourceNotebook.CloseFile
  85. TSourceNotebook.DoClose SourceNotebook___139909078717840:TSourceNotebook
  86. TSourceNotebook.DoClose
  87. LAZARUS END - cleaning up ...
  88. TSourceNotebook.Destroy
  89. TSourceNotebook.Destroy
  90. FreeFormEditor: FormEditor1=TFormEditor
  91. Hint: (lazarus) [TMainIDE.Destroy] B  -> inherited Destroy... TMainIDE
  92. Hint: (lazarus) [TMainIDE.Destroy] END
  93.  

The attachment contains the ~/lazarus folder autocreated by the program, after I removed the old one.
« Last Edit: April 22, 2024, 10:19:05 am by Чебурашка »
FPC 3.2.0/Lazarus 2.0.10+dfsg-4+b2 on Debian 11.5
FPC 3.2.2/Lazarus 2.2.0 on Windows 10 Pro 21H2

JuhaManninen

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 4479
  • I like bugs.
Re: Access violation when opening Tools/Options
« Reply #12 on: April 22, 2024, 12:09:18 pm »
Interesting. It was not a corrupt configuration file. You seem to run Lazarus 3.2. The release binaries don't have debug info, thus the stack trace is not useful.
AFAIK the 3.2 installation works for others.
Could you please try one more thing. Get Lazarus sources from GitLab and build either trunk (main branch) or fixes_3_2_0 branch with debug info. If you still get an access violation, the stack trace will be useful.
Mostly Lazarus trunk and FPC 3.2 on Manjaro Linux 64-bit.

TRon

  • Hero Member
  • *****
  • Posts: 2658
Re: Access violation when opening Tools/Options
« Reply #13 on: April 22, 2024, 01:38:44 pm »
thanks for patience.
Thank you following instructions and reporting back  :)

I agree with JuhaManninen that this seem to be an interesting case because indeed Lazarus 3.2 seem to work for others (me included).

Please try Juha's suggestion(s) as it will (hopefully) be able to pinpoint where things go wrong which would make it it possible to be addressed.


Чебурашка

  • Hero Member
  • *****
  • Posts: 579
  • СЛАВА УКРАЇНІ! / Slava Ukraïni!
Re: Access violation when opening Tools/Options
« Reply #14 on: April 22, 2024, 02:07:58 pm »
Interesting. It was not a corrupt configuration file. You seem to run Lazarus 3.2. The release binaries don't have debug info, thus the stack trace is not useful.
AFAIK the 3.2 installation works for others.
Could you please try one more thing. Get Lazarus sources from GitLab and build either trunk (main branch) or fixes_3_2_0 branch with debug info. If you still get an access violation, the stack trace will be useful.

I will!

Since you guys tell that it works there, I just add an extra bit, even if is unlikely to be the cause: I run everything as normal user, without sudos, only the dpkg --install I was root. I am pretty sure you also do the same.
« Last Edit: April 22, 2024, 02:10:37 pm by Чебурашка »
FPC 3.2.0/Lazarus 2.0.10+dfsg-4+b2 on Debian 11.5
FPC 3.2.2/Lazarus 2.2.0 on Windows 10 Pro 21H2

 

TinyPortal © 2005-2018