Just came through the shell list on opensolaris.org.
I can confirm that the bug occurs for simple statements like:
fle...@meridian:~/ksh93/docsvn/doc$ (while true ; do true | true ;
done)
^Z^Z^Z^Z^Z^C

                  fle...@meridian:~/ksh93/docsvn/doc$ jobs
[1] + Stopped(SIGTTOU)         (while true ; do true | true ; done)

Multiple attempts to stop the process failed and the ^C didn't kill
it. The process is hanging in a ioctl() call:
fle...@meridian:~/ksh93/docsvn/doc$ pstack 27378
27378:  -ksh93
 ffffffff7f0c7c70 ioctl    (2, 7415, ffffffff7fffb38c)
 ffffffff7d94a4c0 job_set (100125680, ffffffff7daa9720, 3720, 7067,
15bbd4, 3400) + 98
 ffffffff7d94bce8 job_wait (7067, 7067, 0, 0, 0, 0) + 1b4
 ffffffff7d983d74 sh_exec (0, ffffffff7ecee3e8, 1001232e0,
ffffffff7daa8f08, 7067, 100000000) + 2d14
 ffffffff7d98428c sh_exec (48e, 20a, 48e, ffffffff7fffccd0, 2, 100109790) + 322c
 ffffffff7d984db8 sh_exec (0, 1, 0, 4, 0, 0) + 3d58
 ffffffff7d97d1c0 sh_subshell (100109580, 4, 4, 4, 4, 3400) + 5c8
 ffffffff7d984030 sh_exec (4, 24, 0, a0, 0, 100109550) + 2fd0
  ffffffff7d95c0f4 exfile (ffffffff7daa8f08, ffffffff7daa8f08,
100109550, 24, 34, 34) + be8
 ffffffff7d95b4f0 sh_main (20, 840a01210030, 0, ffffffff7daa8f08, 0,
ffffffff7daa6000) + c80
 0000000100000d58 main (1, ffffffff7ffffc98, ffffffff7ffffca8, 1f3ee8,
1c80, 10000) + 44
 0000000100000cfc _start (0, 0, 0, 0, 0, 0) + 17c

---------- Forwarded message ----------
From: Kyle McDonald <[email protected]>
Date: Oct 28, 2009 6:35 PM
Subject: [osol-discuss] KSH93 problem?
To: [email protected], opensolaris-discuss
<[email protected]>


[Resend to opensolaris-discuss too.]

 Hi!

 Yesterday while debugging a shell script I think I may have found a bug
 in ksh93 from sNV b124.

 The script is basically checking a large list of DNS hostnames for ones
 that already end in a '.'. I've boiled it down to a simpler test case:

 while true; do if ! echo gretsch-p21-396 | grep '\.$'; then true; else
 echo false; fi; done

 If I run the above line at the shell prompt, for a long period of time I
 get no ouput at all, which is to be expected. However, pretty regularly
 rhe shell will be 'stopped' (as if I'd hit CTRL-Z) and I'll be returned
 to my login shell.

 If I continue the test by typing 'fg', then eventually, that 'if'
 statement will actually echo 'false' to stdout. In my original script
 that was having issues, I only ever saw the 'if' take the wrong path,
 and I never saw this 'Stopped' problem. What could cause the system to
 send 'SIGSTOP' to the ksh93 process?

 Here is a sample:


> >while true; do if ! echo gretsch-p21-396 | grep '\.$'; then true; else echo 
> >false; fi; done
> [1]+  Stopped                 ksh93
> 37>fg
> ksh93
> false
>
> [1]+  Stopped                 ksh93
> 38>fg
> ksh93
>
> [1]+  Stopped                 ksh93
> 39>fg
> ksh93
>
> [1]+  Stopped                 ksh93
> 40>fg
> ksh93
>
> [1]+  Stopped                 ksh93
> 41>fg
> ksh93
>
> [1]+  Stopped                 ksh93
> 42>fg
> ksh93
>
> [1]+  Stopped                 ksh93
> 43>
>
 Is it me, or is this wierd?

 -Kyle



 _______________________________________________
 opensolaris-discuss mailing list
 [email protected]


-- 
      ,   _                                    _   ,
     { \/`o;====-    Olga Kryzhanovska   -====;o`\/ }
.----'-/`-/     [email protected]   \-`\-'----.
 `'-..-| /     Solaris/BSD//C/C++ programmer   \ |-..-'`
      /\/\                                     /\/\
      `--`                                      `--`
_______________________________________________
ast-users mailing list
[email protected]
https://mailman.research.att.com/mailman/listinfo/ast-users

Reply via email to