Recent

Author Topic: Post-Mortem debugging the IDE?  (Read 5515 times)

ArminLinder

  • Sr. Member
  • ****
  • Posts: 314
  • Keep it simple.
Post-Mortem debugging the IDE?
« on: January 27, 2017, 07:30:03 am »
Hi Lazarus Team,

I've been working with Lazarus for 4 weeks now to see, whether it can be an alternative to commercial IDEs, and whether it is suitable for commercial development (that's where time matters, and the results need to look great), and I must say, I am impressed, considering that this is a free project Lazarus has reached an astonishing level.

Nevertheless there are still serious drawbacks, one of them is an unnerving instability in the IDE: every now and then, say 1-4 times a day, it does crash for no apparent reason. In rare cases there is a message (something like "file missing", or "file not open" - cannot remember which one, and a filename is never given), sometimes there are SIGSEVs, sometimes I get just program hangs and I must terminate using the operating system.

The damage done is never very big, it seems that Lazarus has a very capable "parachute", so I can almost always fire up the IDE again and continue work without loosing more than a line or two of my last entries, nevertheless it is an unnecessary annoyance if one cannot trust his IDE.

I am aware that such vague informations help nobody, so I think about ways to be able to provide more accurate information. If I'd compile Lazarus with Debug ... and if it crashes ... can I somehow attach a debugger to the program, as long as it is still in memory, and try to extract the exact location of the crash, and the call-stack?

Thx, Armin.
« Last Edit: January 27, 2017, 07:32:37 am by Nimral »
Lazarus 3.3.2 on Windows 7,10,11, Debian 10.8 "Buster", macOS Catalina, macOS BigSur, VMWare Workstation 15, Raspberry Pi

Handoko

  • Hero Member
  • *****
  • Posts: 5158
  • My goal: build my own game engine using Lazarus
Re: Post-Mortem debugging the IDE?
« Reply #1 on: January 27, 2017, 08:10:35 am »
Nevertheless there are still serious drawbacks, one of them is an unnerving instability in the IDE: every now and then, say 1-4 times a day, it does crash for no apparent reason. In rare cases there is a message (something like "file missing", or "file not open" - cannot remember which one, and a filename is never given), sometimes there are SIGSEVs, sometimes I get just program hangs and I must terminate using the operating system.

That is strange. Never heard someone complain Lazarus crashes so often. I use Lazarus on Linux system, I notice some minor bugs but it never crash without reason except my code really do something stupid.

Antivirus and virus may cause something unexpected on Lazarus. Have you try to disable or switch to other antivirus? Or maybe try to run Lazarus on other computer.
« Last Edit: January 27, 2017, 08:15:58 am by Handoko »

wp

  • Hero Member
  • *****
  • Posts: 11923
Re: Post-Mortem debugging the IDE?
« Reply #2 on: January 27, 2017, 09:10:04 am »
Lazarus itself is very stable. If there is a crash it is due to buggy third-party components or my own code. Which components are installed in your system? What is you OS?

FTurtle

  • Sr. Member
  • ****
  • Posts: 292
Re: Post-Mortem debugging the IDE?
« Reply #3 on: January 27, 2017, 11:01:56 am »
By the way...

Quote
Using FPC 1.6.2 on Windows 10/7/XP

I think you mean Lazarus 1.6.2, not FPC

JuhaManninen

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 4474
  • I like bugs.
Re: Post-Mortem debugging the IDE?
« Reply #4 on: January 27, 2017, 11:11:38 am »
Lazarus itself is very stable.
No crashes here neither. The problem must be something else.
Mostly Lazarus trunk and FPC 3.2 on Manjaro Linux 64-bit.

Thaddy

  • Hero Member
  • *****
  • Posts: 14381
  • Sensorship about opinions does not belong here.
Re: Post-Mortem debugging the IDE?
« Reply #5 on: January 27, 2017, 11:19:19 am »
The current Lazarus IDE is indeed very stable.
If your problems would be common, the forum would be awash with complaints and that is not the case.
Lazarus has 10.000ths of users, maybe more, and that would not go unnoticed.
What CAN usually cause instabilities is:
- third-party components
- badly written code. (Can crash even the most resilient IDE's for any language)

Of course, the IDE contains bugs, as with any software, but can you attach a project that will crash the IDE?
Apart from such a project, we need: version of Lazarus, Version of FPC (and where you got these from!) , Operating system + version and processor to help you any further.

Note that you can run Lazarus itself under the debugger should you want to do so... Highly advice against it, though.
« Last Edit: January 27, 2017, 11:41:16 am by Thaddy »
Object Pascal programmers should get rid of their "component fetish" especially with the non-visuals.

ArminLinder

  • Sr. Member
  • ****
  • Posts: 314
  • Keep it simple.
Re: Post-Mortem debugging the IDE?
« Reply #6 on: January 27, 2017, 03:45:00 pm »
Thank you all for your input. I am glad to hear that your Lazarus'ses are stable, but this info doesn't help me very much, mine is not.

Your hints: I run Lazarus in a virtual machine (VMware Workstation). The VM has been a fresh Install (Windows 7 x86), and there is absolutely nothing installed, not even a virus scanner.

In Lazarus I haven't installed any third party components.

Uploading a project is pointless, it does happen in simplest projects, like for instance I am currently messing with TComboBox not working like I expect, and the affected project has only a combobox, a button and a few event handlers with absolutely no dangerous code in it.

Crashes do usually happen during debugging. Unfortunately they are not reproducible, I've tried many times. Once the IDE has been restarted, I can do exactly what I have done before, and I won't crash.

From what you are saying (or not saying ...), my idea to try some post-mortem debugging to get an idea where to search is pointless?

Armin.
« Last Edit: January 27, 2017, 03:49:55 pm by Nimral »
Lazarus 3.3.2 on Windows 7,10,11, Debian 10.8 "Buster", macOS Catalina, macOS BigSur, VMWare Workstation 15, Raspberry Pi

Martin_fr

  • Administrator
  • Hero Member
  • *
  • Posts: 9908
  • Debugger - SynEdit - and more
    • wiki
Re: Post-Mortem debugging the IDE?
« Reply #7 on: January 27, 2017, 03:58:56 pm »
1) Do you use anchor docking or any other "one window" solution?

2) The original question, how to find where the crash happens.

recompile the IDE with debug info. This must apply to all packages too.

If you go to menu: Tools > configure build IDE
you can specify options, and they apply to most packages too.

(( Otherwise find and edit fpc config, or maybe open the project ide/lazarus.lpi and edit "Additions and overides"  ))

Add the following options
-gw -gh -gl       for debug info
-Criot               for error checking

then run the IDE with
--debug-log=c:\log.txt

After the crash you should find a stacktrace (with units and line numbers)

When it crashes, make a note what you last did.

You can post the trace here.

--------------------------
You can also debug the IDE itself, by opening and running ide/lazarus.lpi

ArminLinder

  • Sr. Member
  • ****
  • Posts: 314
  • Keep it simple.
Re: Post-Mortem debugging the IDE?
« Reply #8 on: January 27, 2017, 05:10:13 pm »
Hi Martin,

thank you for your info, this is exactly what I am looking for.

No, I have no docking solution, I tried one or two of them last autumn, and found all of them instable. After regularly experiencing a crashing IDE (with some message that some controls are in kind of loop state - don't remember exactly waht the words were) I removed them, and since I use a VM and Snapshots there is no chance any remaints of those components have caused my headaches.

As a side note, I would prefer a one window approach to the GUI too. Running Lazarus in a VM comes close, since I usually don't run other software in the same VM, so Lazarus has the whole screen for exclusive use, which is close to a one-window Lazarus IDE.

Rearding my stability problem ... unfortunately I could not wait, and don't have any time left today for extensive troubleshooting, I need to get a project done. I have bookmarked this thread for next time, if the problem should come back.

In the meanwhile I have reset my VM to a Snapshot I stored away right after I installed Lazarus, and till now I expected no crash any more. So I guess I messed up something somewhere some time, but I am afraid the issue cannot be tracked right now.

Greetz

Armin.
Lazarus 3.3.2 on Windows 7,10,11, Debian 10.8 "Buster", macOS Catalina, macOS BigSur, VMWare Workstation 15, Raspberry Pi

Thaddy

  • Hero Member
  • *****
  • Posts: 14381
  • Sensorship about opinions does not belong here.
Re: Post-Mortem debugging the IDE?
« Reply #9 on: January 27, 2017, 05:15:38 pm »
Sorry, but an example is never pointless. Especially when it is hard to reproduce for almost everyone else.
We really need some code that can make the IDE unstable, your versions, etc. Like I explained.
We are trying to help here, not second guess you. And a lot of us have umpty years of experience as professionals.

You what you think is pointless may very well be not the case.

I must insist on an example.
Object Pascal programmers should get rid of their "component fetish" especially with the non-visuals.

Handoko

  • Hero Member
  • *****
  • Posts: 5158
  • My goal: build my own game engine using Lazarus
Re: Post-Mortem debugging the IDE?
« Reply #10 on: January 27, 2017, 05:23:48 pm »
In the meanwhile I have reset my VM to a Snapshot I stored away right after I installed Lazarus, and till now I expected no crash any more.

Glad to know you now can run Lazarus without crash. Please report back if you found any issue.

By the way, you may be interested to know that you can make Lazarus to show only single button in the taskbar:

Lazarus main menu > Tools > Options > Environment > Window > enable "Show single button in Taskbar"

wp

  • Hero Member
  • *****
  • Posts: 11923
Re: Post-Mortem debugging the IDE?
« Reply #11 on: January 27, 2017, 05:30:16 pm »
In your signature you write you have Laz 1.6.2 on Win10, 7 and XP in a VM. Are all these Win versions affected by the issue that you describe? I have several VMs with Lazarus (among them Win2000, XP, Win7) and have never seen such issues, it's VirtualBox, though. Could it be a VMWare issue?

How did you install Lazarus? Into which folder? "c:\program files" is not recommended because some tools used don't like the space in the directory name, and you don't have write permission in this folder usually.

balazsszekely

  • Guest
Re: Post-Mortem debugging the IDE?
« Reply #12 on: January 27, 2017, 05:36:43 pm »
@wp
Quote
Could it be a VMWare issue?
No. I also have multiple OSs(including linux) in VMWare, no crash so far. :)

FTurtle

  • Sr. Member
  • ****
  • Posts: 292
Re: Post-Mortem debugging the IDE?
« Reply #13 on: January 27, 2017, 06:54:36 pm »
After regularly experiencing a crashing IDE (with some message that some controls are in kind of loop state

These troubles happened in Anchor Editor?

 

TinyPortal © 2005-2018