Ticket #9 (new defect)

Opened 10 years ago

Last modified 5 years ago

savannah: Child process signal handling

Reported by: luk 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 (last modified by ossi) (diff)

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

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.

Comment 1 by Pavel Tsekov <ptsekov> at Wed 16 Feb 2005 02:13:45 PM UTC:

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'

Change History

comment:1 Changed 9 years ago by styx

  • Milestone set to 4.7

comment:2 Changed 8 years ago by ossi

  • Cc ossi@… added
  • severity set to no branch

comment:3 Changed 7 years ago by andrew_b

  • Version set to master
  • Branch state set to no branch
  • Milestone changed from 4.7 to Future Releases

comment:4 Changed 5 years ago by ossi

  • Description modified (diff)
  • Reporter changed from slavazanko to luk
Note: See TracTickets for help on using tickets.