Comments (18)
In most cases the user will "Force Quit" anyway so there seems little harm in doing it code?
from terminal.
So the issue is that the tab cannot be closed with the close button if the child is a zombie? Do you know why the child became zombified? Is there a way of detecting a zombie in code?
from terminal.
I actually don't know why it becomes a zombie :-(
from terminal.
If the cause is external to Terminal/Elementary, then throwing that dialog with a Force Quit option seems a reasonable response pro temp pending an upstream fix. Otherwise we need to stop the zombification.
from terminal.
😞 Yeah I am still looking into it, it seems that it only becomes a zombie when the first Posix.kill (this.child_pid, Posix.Signal.HUP);
happened and it was not zombie before. Actually this is what I did:
public void term_ps () {
killed = true;
warning (this.child_pid.to_string ());
Thread.usleep (10000000);
Posix.kill (this.child_pid, Posix.Signal.HUP);
// Posix.kill (this.child_pid, Posix.Signal.TERM);
warning ("Done");
while (true) { }
}
Do you have any suggestions on how to debug this? I actually tried launching a random zenity process (outside of the elementary terminal), get the pid and replace this.child_pid
with it like:
public void term_ps () {
killed = true;
// warning (this.child_pid.to_string ());
Thread.usleep (10000000);
Posix.kill (145200, Posix.Signal.HUP);
// Posix.kill (this.child_pid, Posix.Signal.TERM);
warning ("Done");
while (true) { }
}
While the terminal still freeze (as expected) Posix.kill
actually successfully hang up the zenity process.
Update: Also tried using a pid from a zsh which is launched in a xterm terminal, with the same steps Posix.kill
is still able to hang up the external zsh.
from terminal.
I'll have a look into it and see if I can reproduce. Perhaps we should not be able to close a tab with running child anyway? What becomes of a the child process if Terminal is terminated some other way?
from terminal.
What setting save-exited-tabs
do you have? If this is true then the shell process for closed tabs will continue until the Terminal window is closed and when that tab is restored no new shell process is created. The default setting on Elementary is true
.
from terminal.
I have switch my default shell to zsh but as yet not reproduced the freeze.
from terminal.
Can you reproduce this on NixOS using bash
as the shell?
from terminal.
Can you reproduce this on NixOS using bash
as the shell?
from terminal.
gsettings get io.elementary.terminal.settings save-exited-tabs
gave me true
. Yeah it can be possible that those GNOME 43 packages are needed to reproduce the issue :-(
from terminal.
Can you reproduce this on NixOS using bash as the shell?
Yes (actually my laptop is using zsh but the screenshot above is a VM that uses bash)
from terminal.
Unfortunately the commit that introduced this possibility of an infinite loop by removing the maximum number of tries to kill the shell process is too old for me to find out what issue this was supposed to fix. It would seem sensible to impose a maximum number of retries.
from terminal.
Just tried commenting out the while of that loop so Terminal no longer tries to close the shell process. The processes and any child processes get closed anyway so 🤷
from terminal.
Can https://gitlab.gnome.org/GNOME/glib/-/merge_requests/2408 be the reason of this issue? I actually did some bisect and noticed that MR.
/cc @jtojnar
from terminal.
Hmmm... So maybe this will be another possible workaround?
public void term_ps () {
killed = true;
Posix.kill (this.child_pid, Posix.Signal.HUP);
Posix.kill (this.child_pid, Posix.Signal.TERM);
int status;
Posix.waitpid (this.child_pid, out status, 0);
}
From my testing the terminal will no longer freeze when closing but you will get a new warning (when closing the terminal) if you build it with GLib 2.72.3
[GLib] GChildWatchSource: Exit status of a child process was requested but ECHILD was received by waitpid(). See the documentation of g_child_watch_source_new() for possible causes.
The warning does not present if you build with GLib 2.74.0 however.
from terminal.
Okay, sounds like waitpid is the correct way, let's just do this conditionally: cockpit-project/cockpit#17564 Ah no, see the PR below, which uses pidfd
from terminal.
I'm also experiencing this freeze when trying to close the terminal -- though I'm not running the official distro of Elementary, I'm running Pantheon on my Arch install.
from terminal.
Related Issues (20)
- Terminal notification displays timestamp when HISTTIMEFORMAT variable is set
- Change default font HOT 1
- Pressing the menu key don't refresh the context menu
- When using `screen` tab title and window title does not change HOT 2
- `.profile` appears to not be loaded by the shell HOT 2
- # char in URLs is escaped in a way that breaks the URL HOT 3
- Add the Mac OS Focus Follows Mouse HOT 1
- Terminal launched without restoring tabs overwrites saved tabs on saving HOT 2
- Clickable Terminal Toggle HOT 1
- Allow to use Ctrl+Backspace for deleting words to the left HOT 8
- Add SIXEL support
- Commands history of new terminal tab
- No autocomplete of commands on fresh install HOT 8
- Incomplete man page HOT 2
- Semi-translatent background becmoes opaque when Terminal is tiled or maximized HOT 2
- Error notification not working? HOT 2
- When creating a new terminal window with the setting the working directory, there is an additional tab that starts at the working directrory HOT 2
- Tabs and tab-zooms not saved to settings continuously HOT 7
- The F11 shortcut key causes the maximize/unmaximize button to fail, in termial, HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from terminal.