Recent

Author Topic: Lazarus 0.9.30 won't let me "rewrite"  (Read 11486 times)

karlsplatzo

  • New member
  • *
  • Posts: 20
Lazarus 0.9.30 won't let me "rewrite"
« on: August 02, 2011, 12:54:10 pm »
I've just upgraded from Lazarus 0.9.28 with FPC 2.2.4 to Lazarus 0.9.30 with FPC 2.4.2 running under Windows XP SP3.

The first thing I noticed was that when I try to write to a file I get the following error message:
"Project myproj raised an exception class: 'External: ?' "

Assuming that the new version of Lazarus or FPC was not being fussy over something I'd gotten away with previously, I went back to basics and created a clean Application from the File | New | Application option, generated an OnCreate event which consisted of:
procedure TForm1.FormCreate(Sender: TObject);
var datout:textfile;
begin
     assignfile(datout,'c:\test.txt');
     rewrite(datout);
     closefile(datout);
end;   

This produced the same run time error.

So has anyone else experienced this or is this merely a bug in the new version I've encountered by strange chance?

At first I installed the new versions of Lazarus and FPC on top of the old. There don't seem to be clear guidelines and some conflicting advice. I renamed the FPC v2.2.4 folder and Lazarus seemed to have already chosen the new version anyway. However considering that there may have been a mix up in configurations I decided to uninstall Lazarus and then go for a re-install. This didn't work.

I noticed that when restarting Lazarus it remembered a few settings such as previous files and so on. Could anything else have been 'corrupted' from the older version?

I'm not sure therefore where to go. Go back to the previous version or could thinks be corrupt?

Sora-Kun

  • Full Member
  • ***
  • Posts: 162
  • I can smell your presence ...
    • Sora-Kun
Re: Lazarus 0.9.30 won't let me "rewrite"
« Reply #1 on: August 02, 2011, 01:31:46 pm »
Hi!
  Before you think about reinstalling Lazarus or FPC, try to debug the file, and find where the program stops.

  As, If you want to reinstall Lazarus, for me Lazarus saves it's settings in this folder
      "E:\Users\XerXeS\AppData\Local"  for Windows7
                                     and
      "C:\Documents and Settings\XerXeS\Application Data" for WindowsXP.
         
Note: That folder might be hidden.

Enjoy,
Cheers.
KingXerXes
if nothing suites you, make it your self!
The Revolution, Genesis. The next generation IDE.
If you want to help, PM me.

Made in Lazarus.
Soon, in The WWW.

Martin_fr

  • Administrator
  • Hero Member
  • *
  • Posts: 5465
    • wiki
Re: Lazarus 0.9.30 won't let me "rewrite"
« Reply #2 on: August 02, 2011, 02:21:00 pm »
Does your app run outside Lazarus?

Some Antivirus (Bitdefender/Comodo), and some printer drivers (not sure which) appear to conflict with gdb. (newer Lazarus, different gdb version)

karlsplatzo

  • New member
  • *
  • Posts: 20
Re: Lazarus 0.9.30 won't let me "rewrite"
« Reply #3 on: August 02, 2011, 02:36:38 pm »
@KingXerxes: Sorry I should have said that I know the programs stop at the "rewrite" statement by tracking through the debugger with stops and Step Into etc.

I had a look for the files you mentioned. They're in a slightly different place:
C:\Documents and Settings\karlsplatzo\Local Settings\Application Data\lazarus

@Martin_fr: Sorry I haven't tried that and now I'm on a different computer. Programs were working fine the previous day although I didn't have the debugger configured to allow me to trace through the code as I was previously trimming for size.

Martin_fr

  • Administrator
  • Hero Member
  • *
  • Posts: 5465
    • wiki
Re: Lazarus 0.9.30 won't let me "rewrite"
« Reply #4 on: August 02, 2011, 04:23:43 pm »
If it stops at the "rewrite" line, then it's *not* a problem from the list I gave.

Sora-Kun

  • Full Member
  • ***
  • Posts: 162
  • I can smell your presence ...
    • Sora-Kun
Re: Lazarus 0.9.30 won't let me "rewrite"
« Reply #5 on: August 02, 2011, 05:54:32 pm »
Hi all,
  Martin the problem that u said give the SIGSEGV error ..
Maybe the file is protected (guess not ur on WinXP) or used by another process?

Try to make a new project and JUST put the code you showed to us.
For me it works, on Win7, Lararus 0.9.31 and FPC 2.4.4.

Try to download todays snapshot from here: http://www.hu.freepascal.org/lazarus/
Cheers,,
KingXerxes
« Last Edit: August 02, 2011, 05:59:07 pm by KingXerxes »
if nothing suites you, make it your self!
The Revolution, Genesis. The next generation IDE.
If you want to help, PM me.

Made in Lazarus.
Soon, in The WWW.

User137

  • Hero Member
  • *****
  • Posts: 1790
    • Nxpascal home
Re: Lazarus 0.9.30 won't let me "rewrite"
« Reply #6 on: August 02, 2011, 06:21:25 pm »
Does it work if you disable debugger, or if you start your program executable from windows Explorer?

Does C:\ have write protection somehow? Try saving a textfile there with usual Notepad. What anti-virus software do you have?

Also what's maybe not related with WinXP but more to Win7, is that you have to set Lazarus to run with admin rights from its shortcut.

karlsplatzo

  • New member
  • *
  • Posts: 20
Re: Lazarus 0.9.30 won't let me "rewrite"
« Reply #7 on: August 02, 2011, 07:13:56 pm »
Hi all,
  Martin the problem that u said give the SIGSEGV error ..
Maybe the file is protected (guess not ur on WinXP) or used by another process?

Try to make a new project and JUST put the code you showed to us.
For me it works, on Win7, Lararus 0.9.31 and FPC 2.4.4.

Try to download todays snapshot from here: http://www.hu.freepascal.org/lazarus/
Cheers,,
KingXerxes

The code I showed was added to a fresh project (i.e. that was the only code I added). I did wonder if it was my code that was the problem.

I'll try the latest snapshot - what's the best plan for installation? Clean everything out before installing? Even the User dependent configuration files that we discussed? I'll try this in a couple of hours.

Sora-Kun

  • Full Member
  • ***
  • Posts: 162
  • I can smell your presence ...
    • Sora-Kun
Re: Lazarus 0.9.30 won't let me "rewrite"
« Reply #8 on: August 02, 2011, 09:13:02 pm »
Hi,
  Yes, uninstall all and delete the Lazarus application data folder. Then install the snapshot that u downloaded.

Enjoy :D
,, KingXerXes
if nothing suites you, make it your self!
The Revolution, Genesis. The next generation IDE.
If you want to help, PM me.

Made in Lazarus.
Soon, in The WWW.

karlsplatzo

  • New member
  • *
  • Posts: 20
Re: Lazarus 0.9.30 won't let me "rewrite"
« Reply #9 on: August 02, 2011, 10:21:08 pm »
Does it work if you disable debugger, or if you start your program executable from windows Explorer?

Does C:\ have write protection somehow? Try saving a textfile there with usual Notepad. What anti-virus software do you have?

Also what's maybe not related with WinXP but more to Win7, is that you have to set Lazarus to run with admin rights from its shortcut.

In XP my C:\ directory is writable too - deliberately chosen for that.

I did the clean install of the latest snapshot as suggested before trying the debugger option. :-[

It does seem to be the debugger that is the issue. With it switched on I got the same error. When I switched it off in the Tools| Debugger option, the test code works OK. :D

Annoyingly I now need the debugger to continue working on my main code.  :o






Martin_fr

  • Administrator
  • Hero Member
  • *
  • Posts: 5465
    • wiki
Re: Lazarus 0.9.30 won't let me "rewrite"
« Reply #10 on: August 02, 2011, 11:59:51 pm »
It does seem to be the debugger that is the issue. With it switched on I got the same error. When I switched it off in the Tools| Debugger option, the test code works OK. :D

Quote
"Project myproj raised an exception class: 'External: ?' "

Ok, there is one way it can be the debugger, still baffled how that would be triggered in your case.

GDB can not recover from certain Signals that your process may receive. Well normally you process does not receive any. Except SigTrap (IIRC or maybe it was SigInt) which the IDE sends itself, and which is handled.

Quote
"Project myproj raised an exception class: 'External: ?' "

So if for some reason the above is the result of such a signal, then that's it. You can open the "Debug output" it may be there, or use --debug-log= opr any of the options on the page at the bottom of this msg to see if any useful info can be collected.

This Signal issue is also what creates the issue of starting an app, when Bitdefender or Comodo firewall is installed, They cause a signal, gdb can't handle it, bang.

Maybe you AV is interrupting when you access the file-system? Try setting your AV to "game-mode" or similar?


Why this only happens after you upgraded, I do not know. Maybe the newer FPC uses different methods to access the filesystem? Maybe it's the newer GDB? (google mingw / gdb => and find plenty of GDB versions.)

--
Info on debugger: http://wiki.lazarus.freepascal.org/GDB_Debugger_Tips

karlsplatzo

  • New member
  • *
  • Posts: 20
Re: Lazarus 0.9.30 won't let me "rewrite"
« Reply #11 on: August 04, 2011, 10:01:57 am »
After my last post I decided I was running out of time to fix this for now and reverted to my original version of Lazarus. I uninstalled the snapshot and did a clean install.

Now I found I had a debugging problem with the old version which was frustrating. I didn't get the same error message but the Assembler window would pop up when I tried to Run To Cursor and so on.

I decided it was better to try to fix a newer version with the DBG suggestions so I went back to 0.9.30 (rather than the snapshot). Again I deleted and did a clean installation.

This time everything worked again!!! I can now use the debugger as I'd like to. As before.

It's a bit frustrating not knowing the cause of the problem but I can only assume that something was mixed up in the installation and it got cleaned up. Or my AV updated and the conflict went away.

I'm using AVG Free Edition and ran the system diagnostic tool PC Analyzer (but this isn't meant to fix anything) in between times. I was worried that there might be some issues with registry items or equivalent. Maybe something got sorted magically. Heh.

Anyway, thanks for the suggestion folks. It helped a lot to have those and to have things to try.

User137

  • Hero Member
  • *****
  • Posts: 1790
    • Nxpascal home
Re: Lazarus 0.9.30 won't let me "rewrite"
« Reply #12 on: August 04, 2011, 03:35:32 pm »
Well now it sounds like you are not using debug info compiler switches. Also if you have optimizations on it might remove debugging possibilities.

I do know that adding debug info will increase executable size (which is propably why you may have disabled them) normally but there is also an option to save debug info in external file.

karlsplatzo

  • New member
  • *
  • Posts: 20
Re: Lazarus 0.9.30 won't let me "rewrite"
« Reply #13 on: August 04, 2011, 09:53:51 pm »
Well now it sounds like you are not using debug info compiler switches. Also if you have optimizations on it might remove debugging possibilities.

I do know that adding debug info will increase executable size (which is propably why you may have disabled them) normally but there is also an option to save debug info in external file.

The above could have been the case for the first go of 0.9.30 but the more recent snapshot was installed cleanly as was the reversion to the old version. In each of those cases I went with the debug and optimization settings from default.