I have no idea since when, but the latest I've tried is r43866. Lazarus keeps asking for FPC source directory and it can't even find its own directory. Even so, after choosing the correct values, upon restarting these are asked again. So, I inspect environmentoptions.xml and indeed these values are missing. Could anyone confirm before I file a bug report? Or link to the bugtracker if it's been reported?
Mailing lists / lazarus / 2014-02
LazarusDir and FPCSourceDirectory not saved to environmentoptions.xml
16 messages · 5 people · –
- Lleledumbo 8
- MMattias Gaertner 4
- MMartin Frb 2
- AAllan E. Registos 1
- MMark Morgan Lloyd 1
Reply by email Subscribe to this list Your subscription
Read-only archive. Use j and k to move between messages.
leledumbo wroteI have no idea since when, but the latest I've tried is r43866. Lazarus keeps asking for FPC source directory and it can't even find its own directory.
If Lazarus is on Linux, one problem is due to file permissions. Your .lazarus directory was somehow changed to read only or owner so you can't save env variables on it, if not, the file must be corrupt? If on Ubuntu in your home directory, you can try 'sudo chown yourusername.yourusername -R .lazarus' then launch lazarus, change to correct settings, exit then run again.
Show quoted text 16 lines
-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/pkcs7-signature
Size: 4267 bytes
Desc: S/MIME Cryptographic Signature
URL: <http://lists.lazarus.freepascal.org/pipermail/lazarus/attachments/20140212/7eed661e/attachment-0001.bin>
I have no idea since when, but the latest I've tried is r43866. Lazarus keeps asking for…
leledumbo wrote 6 lines
I've noticed in the past that if the IDE fails during startup (e.g. an obscure bug in Synedit which raises an exception dialogue) the setup information isn't saved. So the actual problem can be quite a way from the configuration file handling.
If Lazarus is on Linux, one problem is due to file permissions. Your .lazarus directory…
If Lazarus is on Linux, one problem is due to file permissions. Your
.lazarus directory was somehow changed to read only or owner so you can't save env variables on it, if not, the file must be corrupt? If on Ubuntu in your home directory, you can try 'sudo chown yourusername.yourusername -R .lazarus' then launch lazarus, change to correct settings, exit then run again.
Yes, I'm on linux. The file is not read only, because I can rename it normally (no sudo required) and when I start Lazarus with environmentoptions.xml renamed, after I close the IDE it creates a new environmentoptions.xml. Still, in the new file, LazarusDirectory and FPCSourceDirectory don't exist.
After some experiments, it looks like there's a bug in handling MY environmentoptions.xml.
Running the IDE from terminal shows up:
[TEnvironmentOptions.Save] error writing
"/home/leledumbo/.lazarus/environmentoptions.xml": EDOMError in DOMDocument.CreateElement
when I change certain value. but when I rename my .lazarus to .lazarusold, the IDE creates a new .lazarus folder and when I change the same certain value, the file can be saved. Moving the new environmentoptions.xml to .lazarusold and rename it back to .lazarus shows that the IDE can save modified values. Since the permissions of both files are the same, I simply copy-paste the contents of my old environmentoptions.xml to the new one. Guess what? The error message above comes again.
Here I attach the environmentoptions.xml that breaks the saving routine. Please run lazarus from terminal, try changing a value (e.g. single button on taskbar) and see the debug log. If it could reveal the same error message in your installation, I'll file a bug report.
environmentoptions.xml
<http://free-pascal-lazarus.989080.n3.nabble.com/file/n4035804/environmentoptions.xml>
Show quoted text 8 lines
This probably means that somewhere an invalid xml path is used.
Show quoted text 14 lines
Please load the IDE in the debugger and set a breakpoint at FPC_RAISEEXCEPTION.
Then run, reproduce the error and create a backtrace. See here
http://wiki.freepascal.org/Creating_a_Backtrace_with_GDB
Mattias
Please load the IDE in the debugger and set a breakpoint at
FPC_RAISEEXCEPTION.
Then run, reproduce the error and create a backtrace.
Done, but gdb doesn't seem to catch the exception. Here's the log:
(gdb) b FPC_RAISEEXCEPTION
Breakpoint 1 at 0x8072a45
(gdb) run
Starting program: /usr/bin/startlazarus
Fontconfig warning: "/etc/fonts/conf.d/50-user.conf", line 14: reading configurations from ~/.fonts.conf is deprecated.
is a file
TLazarusManager.Run starting /media/LinuxShared/lazarus/lazarus ... Fontconfig warning: "/etc/fonts/conf.d/50-user.conf", line 14: reading configurations from ~/.fonts.conf is deprecated.
TMainIDE.ParseCmdLineOptions:
PrimaryConfigPath="/home/leledumbo/.lazarus"
SecondaryConfigPath="/etc/lazarus"
TSourceEditorSharedValues.GetMainLinkScanner not pascal highlighted: unit1.pas
[TEnvironmentOptions.Save] error writing
"/home/leledumbo/.lazarus/environmentoptions.xml": EDOMError in DOMDocument.CreateElement
X Error: BadWindow (invalid Window parameter) 3
Major opcode: 20 (X_GetProperty)
Resource id: 0x64000eb
[TEnvironmentOptions.Save] error writing
"/home/leledumbo/.lazarus/environmentoptions.xml": EDOMError in DOMDocument.CreateElement
LAZARUS END - cleaning up ...
[TMainIDE.Destroy] A
[TMainIDE.Destroy] B -> inherited Destroy... TMainIDE [TMainIDE.Destroy] END
During startup program exited normally.
However, I've managed to get the exception source (line 2656 of laz2_dom) by removing try-except in the respective code block. Extending the exception message a bit, I guess I know the problem. Here's the log:
[TEnvironmentOptions.Save] error writing
"/home/leledumbo/.lazarus/environmentoptions.xml": EDOMError in DOMDocument.CreateElement PackageEditor_
NiceChartD7 FXML11=0
As you can see, I have PackageEditor_<LineEnding>NiceChartD7 in FormIdList tag. The line ending seems to be the cause. I've removed the whole FormIdList tag and everything seems well now.
I have no idea now whether this should be reported as bug or not. I have no idea where that LineEnding comes from, because I never touch environmentoptions.xml before this (unless when there's a problem).
Show quoted text 10 lines
Ah, you debugged startlazarus.
Please start /media/LinuxShared/lazarus/lazarus in gdb.
TLazarusManager.Run starting /media/LinuxShared/lazarus/lazarus ...
Mattias
Ah, you debugged startlazarus. Please start /media/LinuxShared/lazarus/lazarus in gdb.
No difference:
leledumbo at LeleBuntu:/media/Sources/fpc$ gdb
/media/LinuxShared/lazarus/lazarus
GNU gdb (GDB) 7.5-ubuntu
Copyright (C) 2012 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 "i686-linux-gnu".
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>...
Reading symbols from /media/LinuxShared/lazarus/lazarus...done. (gdb) b FPC_RAISEEXCEPTION
Breakpoint 1 at 0x8072f25
(gdb) run
Starting program: /media/LinuxShared/lazarus/lazarus Fontconfig warning: "/etc/fonts/conf.d/50-user.conf", line 14: reading configurations from ~/.fonts.conf is deprecated.
TMainIDE.ParseCmdLineOptions:
PrimaryConfigPath="/home/leledumbo/.lazarus"
SecondaryConfigPath="/etc/lazarus"
TSourceEditorSharedValues.GetMainLinkScanner not pascal highlighted: unit1.pas
[TEnvironmentOptions.Save] error writing
"/home/leledumbo/.lazarus/environmentoptions.xml": EDOMError in DOMDocument.CreateElement PackageEditor_
NiceChartD7 0
X Error: BadWindow (invalid Window parameter) 3
Major opcode: 20 (X_GetProperty)
Resource id: 0x66000fe
[TEnvironmentOptions.Save] error writing
"/home/leledumbo/.lazarus/environmentoptions.xml": EDOMError in DOMDocument.CreateElement PackageEditor_
NiceChartD7 0
LAZARUS END - cleaning up ...
[TMainIDE.Destroy] A
[TMainIDE.Destroy] B -> inherited Destroy... TMainIDE [TMainIDE.Destroy] END
During startup program exited normally.
Show quoted text 33 lines
Strange. It is raising a FPC exception. gdb should break here, but it does not.
Martin, do you have an idea how this is possible?
Anyway I now see, that there is an invalid identifier: " NiceChartD7".
I added check. Please test.
Mattias
Mattias Gaertner wrote 23 lines
Not sure, maybe (Marc pointed that out ot me once) it is the same, why the IDE does take the address of RAISE_Exception, and set the break at the address.
GDB looks at the assembler of the function and makes a decision where the prologue ends. With FPC omitting the stackframe it may get that wrong.
Though I have used the
b FPC_RAISEEXCEPTION
myself, and it had worked, but it may depend on versions, etc.
Try
info address
b *0x8072f25
--------------
here is output from gdb I just tried
(gdb) b FPC_RAISEEXCEPTION
Breakpoint 1 at 0x40da33: file ../inc/except.inc, line 195. (gdb) info address FPC_RAISEEXCEPTION
Symbol "FPC_RAISEEXCEPTION" is at 0x40da20 in a file compiled without debugging. (gdb)
info address is 19 bytes earlier
In my case that is correct (looking at disaasemble), but my FPC was build with -O1
Ah...my bad, my FPC wasn't built with debugging info, only Lazarus was. Perhaps that could be the problem? But GDB knows when I give "b FPC_RAISEEXCEPTION"? OK, this is weird...
leledumbo wrote 5 lines
FPC_RAISEEXCEPTION is declared
Function fpc_RaiseException (Obj : TObject; AnAddr : CodePointer; AFrame : Pointer) : TObject;[Public, Alias : 'FPC_RAISEEXCEPTION']; compilerproc;the alias means it is exported always. But apparently GDB gets it wrong. At least for use as breakpoint.
It should work via the address trick. Most users have an RTL without dbg info, and yet can debug
It should work via the address trick. Most users have an RTL without dbg
info, and yet can debug
Got it, I can debug now. In my case, the address is shifted 5 bytes. No idea who is wrong...
On Thu, 13 Feb 2014 19:05:57 -0800 (PST) Strange. It is raising a FPC exception. gdb…
Anyway I now see, that there is an invalid identifier:
" NiceChartD7".
I added check. Please test.
Tested and working. So, what the code would do now if such an invalid identifier occurs?
Show quoted text 6 lines
It does not save it.
I have to find out, where the space is coming from.
Mattias
