Ticket #9 (new defect) — at Initial Version

Opened 16 years ago

Last modified 11 years ago

savannah: Child process signal handling

Reported by: slavazanko Owned by:
Priority: minor Milestone: Future Releases
Component: mc-core Version: master
Keywords: Cc: ossi@…
Blocked By: Blocking:
Branch state: no branch Votes for changeset:

Description

Original: http://savannah.gnu.org/bugs/?11984

Release:
Submitted by:Lukas Jelinek <luk>Submitted on:Mon 14 Feb 2005 09:45:45 AM UTC
Category:SubshellSeverity:3 - Normal
Status:NonePrivacy:Public
Assigned to:NoneOpen/Closed:Open
4.5.55Operating System:GNU/Linux

Discussion:

Wed 16 Feb 2005 02:13:45 PM UTC, comment #1:

This is not exactly a bug, but I'd say a side effect. Since you 
don't mention which program do you start from MC i have to assume 
that it is a program which writes its output to the terminal.

Now, when the subshell feature is enabled commands are executed 
through the subshell. The shell being run when the subshell feature 
is enabled is a shell that has JOB CONTROL enabled. So when you stop
the process it is put in the background and the shell gains control 
over the terminal. Switching from MC to the subshell causes certain 
terminal settings to change - one of them being the TOSTOP flag. 
Here is what the libc manual has to say about the TOSTOP flag:

[...]
Similarly, when a process in a background job tries to write to its
controlling terminal, the default behavior is to send a `SIGTTOU'
signal to the process group. However, the behavior is modified by 
the `TOSTOP' bit of the local modes flags (*note Local Modes::). If 
this bit is not set (which is the default), then writing to the 
controlling terminal is always permitted without sending a signal. 
Writing is also permitted if the `SIGTTOU' signal is being ignored 
or blocked by the writing process.
[...]

So when you send the SIGCONT signal to the stopped process it starts
writing to the terminal again but it is stopped and sent the SIGTTOU
signal.

Now, one way to achieve what I guess you expect to happen is to 
disable the job control when executing commands typed in the shell 
prompt widget and th e subshell feature is enabled. You can test if 
this is what you expect by doing this:

1) Run MC

2) Ctrl + O

3) set +m

4) Ctrl + O

4) ls -lR / (or some other command taking time)

5) from another shell 'kill -STOP pid_of_ls'

6) from another shell 'kill -CONT pid_of_ls'
	Pavel Tsekov <ptsekov>
Project Administrator
Mon 14 Feb 2005 09:45:45 AM UTC, original submission:

If I stop a child process (executed from MC) using SIGSTOP, there is
no way how to resume this process again (SIGCONT has no effect). I 
don't know whether this is a bug or a "feature".

Please review this.
	Lukas Jelinek <luk>
Note: See TracTickets for help on using tickets.