Recent

Author Topic: Error when opening a project after moving from 4.2 to 4.8  (Read 315 times)

Tomu

  • Jr. Member
  • **
  • Posts: 55
Error when opening a project after moving from 4.2 to 4.8
« on: July 15, 2026, 06:17:22 pm »
On Linux Mint I de-installed Larazus 4.2, and upgraded to 4.8.
When I start Lazarus and then try to open a project (new or existing project ) I get an Access violation error (see attached file).
I can choose 'OK' and then try to open a project and everything works.

But the next time I open Lazarus it's the same story.

Any ideas how to eliminate this?

Martin_fr

  • Administrator
  • Hero Member
  • *
  • Posts: 12641
  • Debugger - SynEdit - and more
    • wiki
Re: Error when opening a project after moving from 4.2 to 4.8
« Reply #1 on: July 15, 2026, 06:34:10 pm »
We need to find out what causes the error.

Could you open a terminal, and run lazarus from the terminal?
You need to
  cd /your/laz/dir
  ./lazarus

It should print out some stuff when the error happens. If we are lucky it will contain filenames and lines. If not, it needs some more work to find out.

Tomu

  • Jr. Member
  • **
  • Posts: 55
Re: Error when opening a project after moving from 4.2 to 4.8
« Reply #2 on: July 15, 2026, 06:45:33 pm »
It starts OK from the command line (./lazarus). The screen in the attached file comes up. Even clicking "Quit Lazarus" gets the error. If instead of "Quit" I choose new "New Project", there error is displayed. If I then select "OK" I get into the IDE with nothing open.

Tomu

  • Jr. Member
  • **
  • Posts: 55
Re: Error when opening a project after moving from 4.2 to 4.8
« Reply #3 on: July 15, 2026, 07:45:33 pm »
If I have a project open and then go to "File"/"Quit" (with closing the active project), then when I restart Lazarus the previous project opens without error.
However, if I close the open project and the choose "Quit Lazarus", the error comes back when I restart.

Martin_fr

  • Administrator
  • Hero Member
  • *
  • Posts: 12641
  • Debugger - SynEdit - and more
    • wiki
Re: Error when opening a project after moving from 4.2 to 4.8
« Reply #4 on: July 15, 2026, 08:03:45 pm »
When I open Lazarus from a console, then in that console I get output like this
Code: Text  [Select][+][-]
  1. Hint: (lazarus) Using config file: "B:\Lazarus_fx_2_2\lazarus.cfg"
  2. Hint: (lazarus) [TMainIDE.ParseCmdLineOptions] PrimaryConfigPath="B:\laz_configs\lazarus_fx_2_2"
  3. Hint: (lazarus) [TMainIDE.ParseCmdLineOptions] SecondaryConfigPath="B:\Lazarus_fx_2_2"
  4.  Verbose: (File browser) Start collecting files in directory "C:\Users\martin\AppData\Local\Temp\"
  5. Hint: (lazarus) [TMainIDE.DoOpenProjectFile] "B:\temp\ttt\project1.lpi"

(This is from Windows, but on Linux is very similar).

And when an "access violation" happens, in 99.9% of cases it prints  a list of hex addresses. Depending on setup they have filenames and line numbers. Or not.

If yours have, then that may tell what causes the error. 

The error message itself is meaningless it just saying fatal error. There could be thousands of reasons.



Otherwise... A couple of things you can try to narrow it. Sorry it is a bit of work. But as I said, from that error I can't tell anything (nor will anyone else be able).
(Independent of the answer, try all the steps below)


do you use Anchordocking / docked form editor?
If you disable each of them, and try using the IDE, does the error still happen?


When you create a "new project" is that an "application" (with TForm)?
Does the error also happen for a "simple program"?


Your IDE should have config files, usually they are in the hidden directory .lazarus in your home folder.
There are several xml files.
Try to remove each (one at a time) such xml file (move it outside the folder, so you can later move it back). See if the error still happens when you start the IDE without that file. The try to move the next file and so on...
When you remove "environmentoptions.xml" the IDE will want a complete setup.


Try to rebuild your IDE clean
(but make a backup of your "lazarus" executable file first ! )
Menu: tools > Configure build IDE
check "clean all"
build.

Tomu

  • Jr. Member
  • **
  • Posts: 55
Re: Error when opening a project after moving from 4.2 to 4.8
« Reply #5 on: July 15, 2026, 08:18:53 pm »
I missed the terminal output earlier.  Here it is below.

Code: Text  [Select][+][-]
  1.  ./lazarus
  2. Hint: (lazarus) [TMainIDE.ParseCmdLineOptions] PrimaryConfigPath="/home/tom/.lazarus"
  3. Hint: (lazarus) [TMainIDE.ParseCmdLineOptions] SecondaryConfigPath="/etc/lazarus"
  4. Hint: (lazarus) [TBuildManager.SetBuildTarget] Old=x86_64-linux--gtk2 New=x86_64-linux--gtk2 Changed: OS/CPU=True LCL=False
  5. ### TCodeToolManager.HandleException: [20170421194936] "no pascal code found (first token is )" in "unit1.pas"
  6. ----------------
  7.  

Also, right after I installed 4.8 everything seemed to work OK.
During the next hour or 2 I installed a couple of components, then uninstalled one.
Also recompiled some old projects.

Not sure where along the line I noticed the error - but I don't think it was there after the initial upgrade/install.

Tomu

  • Jr. Member
  • **
  • Posts: 55
Re: Error when opening a project after moving from 4.2 to 4.8
« Reply #6 on: July 15, 2026, 08:28:04 pm »
I tried de-installing the "cody" package, but still get the error.
But this time the terminal output is more verbose:

Code: Text  [Select][+][-]
  1.  ./lazarus
  2. Hint: (lazarus) [TMainIDE.ParseCmdLineOptions] PrimaryConfigPath="/home/tom/.lazarus"
  3. Hint: (lazarus) [TMainIDE.ParseCmdLineOptions] SecondaryConfigPath="/etc/lazarus"
  4. ----------------
  5. Hint: [TGtk2WidgetSet.AppRemoveStayOnTopFlags] ignoring active window: x=1 y=29835 -2063749904x0
  6. TApplication.HandleException: EAccessViolation
  7. Access violation
  8.   Stack trace:
  9.   $00000000006476D6  GTK_CLASS_GET_TYPE,  line 132 of gtk2proc.inc
  10.   $00000000006480E7  GTKWIDGETISA,  line 376 of gtk2proc.inc
  11.   $000000000050C38D  ISWINDOW,  line 6549 of gtk2winapi.inc
  12.   $0000000000565150  ISWINDOW,  line 646 of include/winapi.inc
  13.   $0000000000489CF9  SHOWMODAL,  line 3084 of include/customform.inc
  14.   $0000000000E6ED2E  SHOWPROJECTWIZARDDLG,  line 119 of projectwizarddlg.pas
  15.   $00000000004C11C4  DONOPROJECTWIZARD,  line 6525 of main.pp
  16.   $00000000004ADD54  SETUPSTARTPROJECT,  line 2480 of main.pp
  17.   $00000000004AA66F  STARTIDE,  line 1712 of main.pp
  18.   $00000000004217E4  main,  line 149 of lazarus.pp
  19. Hint: (lazarus) [TMainIDE.DoOpenProjectFile] "/home/tom/Public/laz/Play/DrawGrid/project1.lpi"
  20. Hint: (lazarus) [TBuildManager.SetBuildTarget] Old=x86_64-linux--gtk2 New=x86_64-linux--gtk2 Changed: OS/CPU=True LCL=False
  21. LoadLFM Creating designer for hidden component of /home/tom/Public/laz/Play/DrawGrid/unit1.pas
  22. InitOpenedProjectFile select form in designer: Form1:TForm1 TDesigner
  23. ******** Highlighter.NeedScan ************
  24. LAZARUS END - cleaning up ...
  25. FreeFormEditor: FormEditor1=TFormEditor
  26. Hint: (lazarus) [TMainIDE.Destroy] B  -> inherited Destroy... TMainIDE
  27. Hint: (lazarus) [TMainIDE.Destroy] END
  28. tom@penguin-laptop:~/.lazarus/bin$ ^C
  29. tom@penguin-laptop:~/.lazarus/bin$
  30.  
  31.  
  32.  

Tomu

  • Jr. Member
  • **
  • Posts: 55
Re: Error when opening a project after moving from 4.2 to 4.8
« Reply #7 on: July 15, 2026, 09:36:13 pm »
I just uninstalled, then re-installed. Everything seems OK.

Tomu

  • Jr. Member
  • **
  • Posts: 55
Re: Error when opening a project after moving from 4.2 to 4.8
« Reply #8 on: July 16, 2026, 09:11:54 pm »
After re-installing the error is still there.
I see a Window's user reported a possibly similar issue.

Based on what you asked the  Window's user, below is what is on my Linux system (see attached .zip from Primary config directory=/home/tom/.lazarus)

Code: Text  [Select][+][-]
  1. Lazarus version: 4.8
  2. Lazarus revision: Unknown
  3. Lazarus build date: 2026/07/16 14:01:18
  4. Lazarus was compiled for x86_64-linux
  5. Lazarus was compiled with FPC 3.2.2
  6.  
  7. Global IDE options:
  8. Primary config directory=/home/tom/.lazarus
  9. Secondary config directory=/etc/lazarus
  10. LazarusDirectory=/usr/share/lazarus/4.8.0/
  11. Real LazarusDirectory=/usr/share/lazarus/4.8.0/
  12. Default CompilerFilename=/usr/bin/fpc
  13. Real Default CompilerFilename=/usr/bin/fpc
  14. Project CompilerFilename=$(CompPath)
  15. Real Project CompilerFilename=/usr/bin/fpc
  16. CompilerMessagesFilename=
  17. Real CompilerMessagesFilename=/usr/share/fpcsrc/3.2.2/compiler/msg/errore.msg
  18. FPC source directory=/usr/share/fpcsrc/$(FPCVER)
  19. Real FPC source directory=/usr/share/fpcsrc/3.2.2/
  20. Test directory=~/tmp/
  21. Real Test directory=/home/tom/tmp/
  22.  
  23. Working directory=/home/tom
  24. Application.ExeName=/home/tom/.lazarus/bin/lazarus
  25. 2026/07/16 14:01:23
  26.  
  27. Parameters:
  28. /home/tom/.lazarus/bin/lazarus
  29.  
  30. System preferred language:
  31. Language ID: 'en_US'
  32. Language code: 'en'
  33. Country code: 'US'
  34.  
  35. Environment variables:
  36. CLUTTER_IM_MODULE=ibus
  37. DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/1001/bus
  38. DESKTOP_SESSION=cinnamon
  39. DISPLAY=:0
  40. GDMSESSION=cinnamon
  41. GDM_LANG=en_US
  42. GIO_LAUNCHED_DESKTOP_FILE=/usr/share/applications/lazarus.desktop
  43. GIO_LAUNCHED_DESKTOP_FILE_PID=716267
  44. GJS_DEBUG_OUTPUT=stderr
  45. GJS_DEBUG_TOPICS=JS ERROR;JS LOG
  46. GNOME_DESKTOP_SESSION_ID=this-is-deprecated
  47. GPG_AGENT_INFO=/run/user/1001/gnupg/S.gpg-agent:0:1
  48. GTK3_MODULES=xapp-gtk3-module
  49. GTK_IM_MODULE=ibus
  50. GTK_MODULES=gail:atk-bridge
  51. HOME=/home/tom
  52. LANG=en_US.UTF-8
  53. LANGUAGE=en_US
  54. LANGUAGE=en_US
  55. LOGNAME=tom
  56. PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin:/opt/gfie-4.5
  57. PWD=/home/tom
  58. QT_ACCESSIBILITY=1
  59. QT_IM_MODULE=ibus
  60. QT_IM_MODULES=wayland;ibus
  61. SESSION_MANAGER=local/penguin-laptop:@/tmp/.ICE-unix/1673,unix/penguin-laptop:/tmp/.ICE-unix/1673
  62. SHELL=/bin/bash
  63. SHLVL=0
  64. SSH_AUTH_SOCK=/run/user/1001/keyring/ssh
  65. USER=tom
  66. XAUTHORITY=/home/tom/.Xauthority
  67. XDG_CONFIG_DIRS=/etc/xdg/xdg-cinnamon:/etc/xdg
  68. XDG_CURRENT_DESKTOP=X-Cinnamon
  69. XDG_DATA_DIRS=/usr/share/cinnamon:/home/tom/.local/share/flatpak/exports/share:/var/lib/flatpak/exports/share:/usr/local/share:/usr/share
  70. XDG_GREETER_DATA_DIR=/var/lib/lightdm-data/tom
  71. XDG_RUNTIME_DIR=/run/user/1001
  72. XDG_SEAT=seat0
  73. XDG_SEAT_PATH=/org/freedesktop/DisplayManager/Seat0
  74. XDG_SESSION_CLASS=user
  75. XDG_SESSION_DESKTOP=cinnamon
  76. XDG_SESSION_ID=c2
  77. XDG_SESSION_PATH=/org/freedesktop/DisplayManager/Session0
  78. XDG_SESSION_TYPE=x11
  79. XDG_VTNR=7
  80. XMODIFIERS=@im=ibus
  81.  
  82.  

 

TinyPortal © 2005-2018