On Tue, Sep 16, 2008 at 08:51:47PM +0000, Thorsten Glaser wrote: > Agustin Martin dixit: > > >I may have messed up the names with all the sh changes. > > I just changed the shebang lines instead ;) > Note /bin/ksh is a symbolic link, thus shouldn't be needed to be tested.
I am re-trying with pdksh in etch and, funny, when explicitly change the symlink to pdksh /bin# ln -sf pdksh sh and keep the shebang lines pointing to /bin/sh the test script runs (no hang and no error signalled, even with '-e' flag enabled in both scripts, and the right return value shown). However, if I explicitly change the shebang lines scripts seem to fail, $ ./test-miscksh.pdksh debconf: DbDriver "passwords" warning: could not open /var/cache/debconf/passwords.dat: ... ./run-test.pdksh[7]: >&3 : bad file descriptor Now does not hang, probably because I added 'set -e' to both scripts. I have straced both cases for pdksh and here goes the output. I do not know about the internals of *ksh, but I am surprised at the different clone lines, where the error appears, $ strace ./test-miscksh.pdksh || echo "error" ----------------- BAD: shebang to pdksh ------------------------------------ ... close(3) = 0 pipe([3, 6]) = 0 ioctl(3, SNDCTL_TMR_TIMEBASE or TCGETS, 0xbffabd08) = -1 EINVAL (Invalid argument) _llseek(3, 0, 0xbffabd50, SEEK_CUR) = -1 ESPIPE (Illegal seek) ioctl(6, SNDCTL_TMR_TIMEBASE or TCGETS, 0xbffabd08) = -1 EINVAL (Invalid argument) _llseek(6, 0, 0xbffabd50, SEEK_CUR) = -1 ESPIPE (Illegal seek) fcntl64(3, F_SETFD, FD_CLOEXEC) = 0 fcntl64(6, F_SETFD, FD_CLOEXEC) = 0 pipe([7, 8]) = 0 ioctl(7, SNDCTL_TMR_TIMEBASE or TCGETS, 0xbffabd08) = -1 EINVAL (Invalid argument) _llseek(7, 0, 0xbffabd50, SEEK_CUR) = -1 ESPIPE (Illegal seek) ioctl(8, SNDCTL_TMR_TIMEBASE or TCGETS, 0xbffabd08) = -1 EINVAL (Invalid argument) _llseek(8, 0, 0xbffabd50, SEEK_CUR) = -1 ESPIPE (Illegal seek) fcntl64(7, F_SETFD, FD_CLOEXEC) = 0 fcntl64(8, F_SETFD, FD_CLOEXEC) = 0 clone(./run-test.pdksh[7]: >&3 : bad file descriptor child_stack=0, flags=CLONE_CHILD_CLEARTID|CLONE_CHILD_SETTID|SIGCHLD, child_tidptr=0xb7db1708) = 6038 --- SIGCHLD (Child exited) @ 0 (0) --- $ strace ./test-miscksh || echo "error" ---------------- GOOD: pdksh with sh -> pdksh and shebang to sh ------------- ... close(3) = 0 pipe([3, 6]) = 0 ioctl(3, SNDCTL_TMR_TIMEBASE or TCGETS, 0xbfddf358) = -1 EINVAL (Invalid argument) _llseek(3, 0, 0xbfddf3a0, SEEK_CUR) = -1 ESPIPE (Illegal seek) ioctl(6, SNDCTL_TMR_TIMEBASE or TCGETS, 0xbfddf358) = -1 EINVAL (Invalid argument) _llseek(6, 0, 0xbfddf3a0, SEEK_CUR) = -1 ESPIPE (Illegal seek) fcntl64(3, F_SETFD, FD_CLOEXEC) = 0 fcntl64(6, F_SETFD, FD_CLOEXEC) = 0 pipe([7, 8]) = 0 ioctl(7, SNDCTL_TMR_TIMEBASE or TCGETS, 0xbfddf358) = -1 EINVAL (Invalid argument) _llseek(7, 0, 0xbfddf3a0, SEEK_CUR) = -1 ESPIPE (Illegal seek) ioctl(8, SNDCTL_TMR_TIMEBASE or TCGETS, 0xbfddf358) = -1 EINVAL (Invalid argument) _llseek(8, 0, 0xbfddf3a0, SEEK_CUR) = -1 ESPIPE (Illegal seek) fcntl64(7, F_SETFD, FD_CLOEXEC) = 0 fcntl64(8, F_SETFD, FD_CLOEXEC) = 0 clone(child_stack=0, flags=CLONE_CHILD_CLEARTID|CLONE_CHILD_SETTID|SIGCHLD, child_tidptr=0xb7d98708) = 6028 close(3) = 0 close(8) = 0 rt_sigprocmask(SIG_BLOCK, [PIPE], [], 8) = 0 rt_sigaction(SIGPIPE, {0x80afdb0, [], 0}, {SIG_DFL}, 8) = 0 rt_sigprocmask(SIG_SETMASK, [], NULL, 8) = 0 brk(0x8b3e000) = 0x8b3e000 read(7, "GET dictionaries-common/default-"..., 4096) = 39 write(6, "0 castellano8 (Spanish 8 bit)\n", 30castellano8 (Spanish 8 bit) ) = 30 --- SIGCHLD (Child exited) @ 0 (0) --- and here goes the result for sh->mksh symlink, closer to the wrong pdksh case, ---------------- mksh with sh->mksh symlink ------------------------------- ... close(3) = 0 pipe([3, 6]) = 0 ioctl(3, SNDCTL_TMR_TIMEBASE or TCGETS, 0xbfd78ad8) = -1 EINVAL (Invalid argument) _llseek(3, 0, 0xbfd78b20, SEEK_CUR) = -1 ESPIPE (Illegal seek) ioctl(6, SNDCTL_TMR_TIMEBASE or TCGETS, 0xbfd78ad8) = -1 EINVAL (Invalid argument) _llseek(6, 0, 0xbfd78b20, SEEK_CUR) = -1 ESPIPE (Illegal seek) fcntl64(3, F_SETFD, FD_CLOEXEC) = 0 fcntl64(6, F_SETFD, FD_CLOEXEC) = 0 pipe([7, 8]) = 0 ioctl(7, SNDCTL_TMR_TIMEBASE or TCGETS, 0xbfd78ad8) = -1 EINVAL (Invalid argument) _llseek(7, 0, 0xbfd78b20, SEEK_CUR) = -1 ESPIPE (Illegal seek) ioctl(8, SNDCTL_TMR_TIMEBASE or TCGETS, 0xbfd78ad8) = -1 EINVAL (Invalid argument) _llseek(8, 0, 0xbfd78b20, SEEK_CUR) = -1 ESPIPE (Illegal seek) fcntl64(7, F_SETFD, FD_CLOEXEC) = 0 fcntl64(8, F_SETFD, FD_CLOEXEC) = 0 clone(./run-test[7]: >&3 : bad file descriptor child_stack=0, flags=CLONE_CHILD_CLEARTID|CLONE_CHILD_SETTID|SIGCHLD, child_tidptr=0xb7d78708) = 6049 --- SIGCHLD (Child exited) @ 0 (0) --- I am in low bandwith and does not have ksh available, and is real late, hope I did not mess many things when testing. Will try with ksh when possible. Note that all tests are for the *etch* versions, scripts are the same as before with 'set -e' lines added and slightly renamed. > >The simple way to keep everybody joined is to abuse he BTS, reassigning bug > >report to e.g. 'mksh,pdksh,ksh', so it can be accessed from the three > >packages and everybody receives mails. I am bcc'ing those packages to keep > >them aware. > > Ah, okay, thanks. I subscribed successfully to this bug report, so there should be no need to explicitly cc me (However, I will not get angry at that). -- Agustin -- To UNSUBSCRIBE, email to [EMAIL PROTECTED] with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]