zsh-workers
 help / color / mirror / code / Atom feed
* [vincent@vinc17.org: Re: Bug#205685: clone corruption]
@ 2004-07-20 18:16 Clint Adams
  2004-07-20 18:45 ` Philippe Troin
  0 siblings, 1 reply; 6+ messages in thread
From: Clint Adams @ 2004-07-20 18:16 UTC (permalink / raw)
  To: zsh-workers; +Cc: 205685-forwarded

I haven't used clone before this, but I can reproduce the behavior
described below.

----- Forwarded message from Vincent Lefevre <vincent@vinc17.org> -----

On 2004-07-17 16:10:04 -0400, Clint Adams wrote:
> Hmm, is this still a problem?

clone doesn't even work any longer. For instance:

In the first terminal:

greux:~> exec zsh -f
greux% tty
/dev/pts/240
greux% foo=bar
greux% echo $foo
bar
greux% zmodload zsh/clone
greux% clone /dev/pts/241
greux% 

In the second terminal:

greux:~> exec zsh -f
greux% tty
/dev/pts/241
greux% clone: could not make /dev/pts/241 my controlling tty, job control disabled
greux% echo $foo

greux% 

(The message "clone: could not make..." appeared just after executing
"clone /dev/pts/241" in the first terminal.)

----- End forwarded message -----


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [vincent@vinc17.org: Re: Bug#205685: clone corruption]
  2004-07-20 18:16 [vincent@vinc17.org: Re: Bug#205685: clone corruption] Clint Adams
@ 2004-07-20 18:45 ` Philippe Troin
  2004-07-28 15:50   ` Clint Adams
  0 siblings, 1 reply; 6+ messages in thread
From: Philippe Troin @ 2004-07-20 18:45 UTC (permalink / raw)
  To: Clint Adams; +Cc: zsh-workers, 205685-forwarded

Clint Adams <schizo@debian.org> writes:

> I haven't used clone before this, but I can reproduce the behavior
> described below.
> 
> ----- Forwarded message from Vincent Lefevre <vincent@vinc17.org> -----
> 
> On 2004-07-17 16:10:04 -0400, Clint Adams wrote:
> > Hmm, is this still a problem?
> 
> clone doesn't even work any longer. For instance:
> 
> In the first terminal:
> 
> greux:~> exec zsh -f
> greux% tty
> /dev/pts/240
> greux% foo=bar
> greux% echo $foo
> bar
> greux% zmodload zsh/clone
> greux% clone /dev/pts/241
> greux% 
> 
> In the second terminal:
> 
> greux:~> exec zsh -f
> greux% tty
> /dev/pts/241
> greux% clone: could not make /dev/pts/241 my controlling tty, job control disabled
> greux% echo $foo
> 
> greux% 
> 
> (The message "clone: could not make..." appeared just after executing
> "clone /dev/pts/241" in the first terminal.)
> 
> ----- End forwarded message -----

Probably two shells running on the same terminal, this is NOT
supported and can only lead to bad results.

The only way to use clone is to start it on an unused terminal,
started with eg:

  xterm -e sh -c 'trap : INT QUIT TSTP; tty; while :; do sleep 100000000; done'

or on an unused virtual console.

Phil.


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [vincent@vinc17.org: Re: Bug#205685: clone corruption]
  2004-07-20 18:45 ` Philippe Troin
@ 2004-07-28 15:50   ` Clint Adams
  2004-07-28 23:24     ` Philippe Troin
  0 siblings, 1 reply; 6+ messages in thread
From: Clint Adams @ 2004-07-28 15:50 UTC (permalink / raw)
  To: Philippe Troin; +Cc: zsh-workers, 205685-forwarded

> The only way to use clone is to start it on an unused terminal,

Is this wording accurate?

Index: Doc/Zsh/mod_clone.yo
===================================================================
RCS file: /cvsroot/zsh/zsh/Doc/Zsh/mod_clone.yo,v
retrieving revision 1.1.1.8
diff -u -r1.1.1.8 mod_clone.yo
--- Doc/Zsh/mod_clone.yo	20 Dec 1999 11:24:39 -0000	1.1.1.8
+++ Doc/Zsh/mod_clone.yo	28 Jul 2004 15:49:42 -0000
@@ -16,5 +16,10 @@
 
 The return value of the builtin is zero in both shells if successful,
 and non-zero on error.
+
+The target of tt(clone) should be an unused terminal, such as an unused virtual
+console or a virtual terminal created by
+
+xterm -e sh -c 'trap : INT QUIT TSTP; tty; while :; do sleep 100000000; done'
 )
 enditem()


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [vincent@vinc17.org: Re: Bug#205685: clone corruption]
  2004-07-28 15:50   ` Clint Adams
@ 2004-07-28 23:24     ` Philippe Troin
  2004-07-30 16:04       ` Clint Adams
  0 siblings, 1 reply; 6+ messages in thread
From: Philippe Troin @ 2004-07-28 23:24 UTC (permalink / raw)
  To: Clint Adams; +Cc: zsh-workers, 205685-forwarded

Clint Adams <schizo@debian.org> writes:

> > The only way to use clone is to start it on an unused terminal,
> 
> Is this wording accurate?
> 
> Index: Doc/Zsh/mod_clone.yo
> ===================================================================
> RCS file: /cvsroot/zsh/zsh/Doc/Zsh/mod_clone.yo,v
> retrieving revision 1.1.1.8
> diff -u -r1.1.1.8 mod_clone.yo
> --- Doc/Zsh/mod_clone.yo	20 Dec 1999 11:24:39 -0000	1.1.1.8
> +++ Doc/Zsh/mod_clone.yo	28 Jul 2004 15:49:42 -0000
> @@ -16,5 +16,10 @@
>  
>  The return value of the builtin is zero in both shells if successful,
>  and non-zero on error.
> +
> +The target of tt(clone) should be an unused terminal, such as an unused virtual
> +console or a virtual terminal created by
> +
> +xterm -e sh -c 'trap : INT QUIT TSTP; tty; while :; do sleep 100000000; done'

Some words of explanation are warranted about this long xterm command
line: when doing clone on a pseudo-terminal, some other session
("session" meant as a unix session group, or SID) is already owning
the terminal. Hence the cloned zsh cannot acquire the pseudo-terminal
as a controlling tty. That means two things:

 - the job control signals will go to the sh-started-by-xterm process
   group (that's why we disable INT QUIT and TSTP with trap; otherwise
   the while loop could get suspended or killed)

 - the cloned shell will have job control disabled, and the job
   control keys (control-C, control-\ and control-Z) will not work.

This does not apply when cloning to an *unused* vc.

Cloning to an used (and unprepared) terminal will result in two
processes reading simultaneously from the same terminal, with input
bytes going randomly to either process.

Clone is mostly useful as a shell built-in replacement for openvt.

Hope that explains clone better.

Phil.


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [vincent@vinc17.org: Re: Bug#205685: clone corruption]
  2004-07-28 23:24     ` Philippe Troin
@ 2004-07-30 16:04       ` Clint Adams
  2004-07-30 16:43         ` Philippe Troin
  0 siblings, 1 reply; 6+ messages in thread
From: Clint Adams @ 2004-07-30 16:04 UTC (permalink / raw)
  To: Philippe Troin; +Cc: zsh-workers, 205685

> Hope that explains clone better.

Good now?

Index: Doc/Zsh/mod_clone.yo
===================================================================
RCS file: /cvsroot/zsh/zsh/Doc/Zsh/mod_clone.yo,v
retrieving revision 1.1.1.8
diff -u -r1.1.1.8 mod_clone.yo
--- Doc/Zsh/mod_clone.yo	20 Dec 1999 11:24:39 -0000	1.1.1.8
+++ Doc/Zsh/mod_clone.yo	30 Jul 2004 16:02:38 -0000
@@ -16,5 +16,32 @@
 
 The return value of the builtin is zero in both shells if successful,
 and non-zero on error.
+
+The target of tt(clone) should be an unused terminal, such as an unused virtual
+console or a virtual terminal created by
+
+xterm -e sh -c 'trap : INT QUIT TSTP; tty; while :; do sleep 100000000; done'
+
+Some words of explanation are warranted about this long xterm command
+line: when doing clone on a pseudo-terminal, some other session
+("session" meant as a unix session group, or SID) is already owning
+the terminal. Hence the cloned zsh cannot acquire the pseudo-terminal
+as a controlling tty. That means two things:
+
+      the job control signals will go to the sh-started-by-xterm process
+      group (that's why we disable INT QUIT and TSTP with trap; otherwise
+      the while loop could get suspended or killed)
+
+      the cloned shell will have job control disabled, and the job
+      control keys (control-C, control-\ and control-Z) will not work.
+
+This does not apply when cloning to an bf(unused) vc.
+
+Cloning to an used (and unprepared) terminal will result in two
+processes reading simultaneously from the same terminal, with
+input bytes going randomly to either process.
+
+tt(clone) is mostly useful as a shell built-in replacement for
+openvt.
 )
 enditem()


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [vincent@vinc17.org: Re: Bug#205685: clone corruption]
  2004-07-30 16:04       ` Clint Adams
@ 2004-07-30 16:43         ` Philippe Troin
  0 siblings, 0 replies; 6+ messages in thread
From: Philippe Troin @ 2004-07-30 16:43 UTC (permalink / raw)
  To: Clint Adams; +Cc: zsh-workers, 205685

Clint Adams <clint@zsh.org> writes:

> > Hope that explains clone better.
> 
> Good now?

Yes.

Phil.

> Index: Doc/Zsh/mod_clone.yo
> ===================================================================
> RCS file: /cvsroot/zsh/zsh/Doc/Zsh/mod_clone.yo,v
> retrieving revision 1.1.1.8
> diff -u -r1.1.1.8 mod_clone.yo
> --- Doc/Zsh/mod_clone.yo	20 Dec 1999 11:24:39 -0000	1.1.1.8
> +++ Doc/Zsh/mod_clone.yo	30 Jul 2004 16:02:38 -0000
> @@ -16,5 +16,32 @@
>  
>  The return value of the builtin is zero in both shells if successful,
>  and non-zero on error.
> +
> +The target of tt(clone) should be an unused terminal, such as an unused virtual
> +console or a virtual terminal created by
> +
> +xterm -e sh -c 'trap : INT QUIT TSTP; tty; while :; do sleep 100000000; done'
> +
> +Some words of explanation are warranted about this long xterm command
> +line: when doing clone on a pseudo-terminal, some other session
> +("session" meant as a unix session group, or SID) is already owning
> +the terminal. Hence the cloned zsh cannot acquire the pseudo-terminal
> +as a controlling tty. That means two things:
> +
> +      the job control signals will go to the sh-started-by-xterm process
> +      group (that's why we disable INT QUIT and TSTP with trap; otherwise
> +      the while loop could get suspended or killed)
> +
> +      the cloned shell will have job control disabled, and the job
> +      control keys (control-C, control-\ and control-Z) will not work.
> +
> +This does not apply when cloning to an bf(unused) vc.
> +
> +Cloning to an used (and unprepared) terminal will result in two
> +processes reading simultaneously from the same terminal, with
> +input bytes going randomly to either process.
> +
> +tt(clone) is mostly useful as a shell built-in replacement for
> +openvt.
>  )
>  enditem()


^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2004-07-30 16:46 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-07-20 18:16 [vincent@vinc17.org: Re: Bug#205685: clone corruption] Clint Adams
2004-07-20 18:45 ` Philippe Troin
2004-07-28 15:50   ` Clint Adams
2004-07-28 23:24     ` Philippe Troin
2004-07-30 16:04       ` Clint Adams
2004-07-30 16:43         ` Philippe Troin

Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).