Recent

Author Topic: Blank form, program hanging in debug  (Read 3828 times)

Martin_fr

  • Administrator
  • Hero Member
  • *
  • Posts: 6818
  • Debugger - SynEdit - and more
    • wiki
Re: Blank form, program hanging in debug
« Reply #15 on: November 10, 2020, 05:40:54 pm »
Thank for coming back on this issue. I created a log file now as suggested, started Lazarus with said parameters und it did me the favour of starting the project blank and dead on first try. App was then killed via Linux Task Manager, not Lazarus Halt (Ctrl+F2). File attached. Odd thing is still that projects that have been created earlier still run without problems, still no blank forms, no hanging.

I can see you killing it:
Code: [Select]
"*stopped,reason="exited-signalled",signal-name="SIGKILL",signal-meaning="Killed""
Unfortunately nothing else suspicious before.
All that happens is, that libraries are loaded. (There is a very tiny change that DisableLoadLibrarySymbols (or similar) in the gdb debugger settings may affect that. But I would not count on it.

If it works in fpdebug, then keep using this. FpDebug is meant to take over eventually. (except for remote debug).

Otherwise you can look at the other thread I linked. It says to install some package and that would help the problem in the other thread. However I can't comment much on this, as that is more of a gtk issues than a debug issue (and outside my scope of expertise)

Quote
As for crash on app closing I mentioned it mainly because trouble seems(!) to have started after this happened for the first time. But as I said this 'unfortunate' behaviour can be prevented by just adding if not Application.Terminated. Changing creation/destruction order seems not to be possible, and switching positions of objects in *.lfm also didn't help. It's not he only 'unfortunate' issue with TTreeView/TShellTreeView but that is indeed a different topic.
Label is a GrapicsControl, so its in a different bucket when it comes to creation order. But a need to change the order IMHO should not be there.
IMHO that even should not fire. Anyway that should be a different thread. Or maybe try reporting it on the bugtracker.
I looked at the stack, and the node for which the event is fired, is in its destructor. So no point to fire the event.

Quote
The debug trouble seems to have no connection with them either. It also happens with the most simple projects with just a TButton on the form.
Indeed, those are 2 different issues.

Sieben

  • Full Member
  • ***
  • Posts: 196
Re: Blank form, program hanging in debug
« Reply #16 on: November 10, 2020, 08:30:12 pm »
Thanks again. While FpDebug is fine for your own code it does not seem to step in lcl etc code. I don't know if I can recompile stable with necessary debug info, and I don't know if I want to. So I'd be glad if this issue went away like it came - for no apparent reason. That said I d/led a test project here yesterday that to my surprise did not fail yet. I'll keep a close watch but didn't find any differences with my failing projects so far, just like I didn't with my non-failing projects...
Lazarus 2.0.10, FPC 3.2.0, .deb install on Ubuntu Xenial 32 / Gtk2 / Unity7

Martin_fr

  • Administrator
  • Hero Member
  • *
  • Posts: 6818
  • Debugger - SynEdit - and more
    • wiki
Re: Blank form, program hanging in debug
« Reply #17 on: November 10, 2020, 09:44:18 pm »
Thanks again. While FpDebug is fine for your own code it does not seem to step in lcl etc code. I don't know if I can recompile stable with necessary debug info, and I don't know if I want to.
It should step in. Unless fpc still defaults to "stabs".

Recompiling stable should be easy. In fact it is done always, if you install a package into the IDE. However, you do not need to rebuild the IDE.

Menu: Tools > Configure Build IDE
To the big "options" memo, add:  -gw3
"Save settings"

Now build your project, it should recompile the LCL.


Sieben

  • Full Member
  • ***
  • Posts: 196
Re: Blank form, program hanging in debug
« Reply #18 on: November 10, 2020, 10:25:11 pm »
That's good news, thanks, will give it a try. I thought with a package install or the like it would only be sort of 're-linked', not really recompiled.
Lazarus 2.0.10, FPC 3.2.0, .deb install on Ubuntu Xenial 32 / Gtk2 / Unity7

Sieben

  • Full Member
  • ***
  • Posts: 196
Re: Blank form, program hanging in debug
« Reply #19 on: November 10, 2020, 11:01:34 pm »
Works (of course...). However, IDE always suggested '-gs -godwarfsets' for projects with FpDebug, I guess I should switch that to '-gw3' as well?
Lazarus 2.0.10, FPC 3.2.0, .deb install on Ubuntu Xenial 32 / Gtk2 / Unity7

Martin_fr

  • Administrator
  • Hero Member
  • *
  • Posts: 6818
  • Debugger - SynEdit - and more
    • wiki
Re: Blank form, program hanging in debug
« Reply #20 on: November 10, 2020, 11:34:55 pm »
Works (of course...). However, IDE always suggested '-gs -godwarfsets' for projects with FpDebug, I guess I should switch that to '-gw3' as well?
gw or gs??
The suggestion should be -gw -godwarfsets

Yes, -gw3.

The debugger backend currently only flags what it supports. But not what preference it has within those. So the IDE list them all, and picks the one that is safe for other backends too.

FpDebug works best with dwarf 3.
The dwarf level does not affect single stepping, only watches/locals display.

--
Mind, if you switch back to gdb => go back to the -gw -godwarfsets

gdb crashes slightly more often, if using -gw3
« Last Edit: November 10, 2020, 11:36:44 pm by Martin_fr »

Sieben

  • Full Member
  • ***
  • Posts: 196
Re: Blank form, program hanging in debug
« Reply #21 on: November 10, 2020, 11:39:03 pm »
Thanks once more. :)

Edit: with gdb, setting was 'automatic (-g)'. And you are right re '-gw -godwarfsets'.
« Last Edit: November 10, 2020, 11:42:48 pm by Sieben »
Lazarus 2.0.10, FPC 3.2.0, .deb install on Ubuntu Xenial 32 / Gtk2 / Unity7

 

TinyPortal © 2005-2018