View Issue Details

IDProjectCategoryView StatusLast Update
0035071LazarusIDEpublic2019-06-16 11:45
ReporterDavid Assigned ToMartin Friebe  
Status closedResolutionfixed 
Product Version2.0 
Summary0035071: Console/Terminal crashes an app if closed before the app itself is closed.
DescriptionLinux users can open a Terminal/Console while an app is running within the IDE. If that app has written to the console and the console is closed before the app is, some sort of crash happens.
Steps To ReproduceDrop a button a form, call debugln('hello'); in its onclick event. Add lazlogger to uses clause.

Run the app (in the IDE), open the console (View->DebugWindows->ConsoleIn/Output)

Click the button on the minimal project, note the 'hello' in Console Window, close the console window and it apparently triggers a crash in the minimal project.
Additional InformationThe crash is followed up by two dialogs -

Project project1 raised exception class 'External: SIGCONT'.
 In file '../sysdeps/unix/sysv/linux/poll.c' at line 29


The file "/build/glibc-OTsEL5/glibc-2.27/sysdeps/unix/sysv/linux/poll.c" was not found.
Do you want to locate it yourself?

Current Fixes_2_0 also seems to do same thing.
TagsNo tags attached.
Fixed in Revision
WidgetsetGTK 2
Attached Files


related to 0033935 closedMartin Friebe Wishlist items for IDE debugger interface 


Martin Friebe

2019-02-16 21:28

manager   ~0114197

I tried with trunk, on Fedora 28. I encountered no issues.

If I close the "console output" window, any output the app writes gets buffered. If I open the window again, the cached output is shown.

I am also not sure how the "console output" window should have such an effect.
Well it does send the its size to the tty (so the app can read the size of the pseudo terminal).
Maybe on your system it sends a size that your libc does not like.

Please run the IDE to produce a logfile
But with the following param

And also with the following modifications to the IDE source:
Open file debugger\pseudoterminaldlg.pp
Find function TPseudoConsoleDlg.consoleSizeChanged;
Uncomment the "//DebugLn(DBG_VERBOSE"
Or make sure, that on each call, it will be logged what size the console window is set to.

You can then see, what the last size was, and if that size looks suspicious.

You can also see if the tty handle was closed, and if that may have caused the problem


2019-02-17 03:06

reporter   ~0114207

OK Martin, an incomplete report, sorry, I'm away from home.

I suspect it is about an altered console window size. I had, previously and unintentionally, changed the window size. When the attached log was taken it was 74x24.

So, I had a play, I could trigger a (?) crash just by resizing. And not stupid sizes, just on screen stuff. And, before a restart, it was telling me it was 2784x1088 - pretty good eh ?

A restart of lazarus and we have my 74x24 back, hmm, and now I cannot trigger a crash. More research is indicated .....

Attached is a log taken while a crash did occur

I'll do the edit to source, recompile and rerun later today if possible or, more likely, tomorrow.



2019-02-17 03:07


LOG_FILE.gz (11,314 bytes)


2019-02-19 00:50

reporter   ~0114253

OK Martin, I have now done the run with the edit to src as requested, produced a 500K file this time ! I have zipped it up this time rather than gzip noting the directions of your slashes in your example - sorry !

(I needed to also uncomment declaration and initialisation of DBG_VERBOSE, pretty sure thats what you wanted)

Attached crash log


2019-02-19 00:51

reporter (61,363 bytes)

Martin Friebe

2019-02-20 16:49

manager   ~0114301

Please try with the changes from


2019-02-21 11:36

reporter   ~0114327

Yep, that seems to to have got it !
I have applied the patch to my fixes_2_0 source tree and I cannot reproduce that problem. Tried several different combos. Tried my ~13K lines project. All good !

Well done, thanks Martin !


2019-06-16 11:45

reporter   ~0116748

Thanks, all good.

Issue History

Date Modified Username Field Change
2019-02-13 09:34 David New Issue
2019-02-13 09:43 Martin Friebe Assigned To => Martin Friebe
2019-02-13 09:43 Martin Friebe Status new => assigned
2019-02-16 21:28 Martin Friebe LazTarget => -
2019-02-16 21:28 Martin Friebe Note Added: 0114197
2019-02-16 21:28 Martin Friebe Status assigned => feedback
2019-02-16 21:29 Martin Friebe Relationship added related to 0033935
2019-02-17 03:06 David Note Added: 0114207
2019-02-17 03:06 David Status feedback => assigned
2019-02-17 03:07 David File Added: LOG_FILE.gz
2019-02-19 00:50 David Note Added: 0114253
2019-02-19 00:51 David File Added:
2019-02-20 16:49 Martin Friebe Note Added: 0114301
2019-02-21 02:22 Martin Friebe Status assigned => feedback
2019-02-21 11:36 David Note Added: 0114327
2019-02-21 11:36 David Status feedback => assigned
2019-02-21 14:03 Martin Friebe Status assigned => resolved
2019-02-21 14:03 Martin Friebe Resolution open => fixed
2019-06-16 11:45 David Status resolved => closed
2019-06-16 11:45 David Note Added: 0116748