Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: zsh hangs on IRIX 5.2 / me to: (SunOS4.1.3 + Solaris 2.4)



Bas V. de Bakker writes on March 26:
 > Surely it shouldn't be a problem to find out where a program loops?
 > That's what debuggers are for.  Have you tried "gdb zsh <pid>"?

Thank you very much, I really didn't know of this possibility.

I used dbx and found out that the loop occurs in utils.c:


/* give the tty to some process */

/**/
void
attachtty(pid_t pgrp)
{
    static int ep = 0;

    if (jobbing) {
#ifdef HAVE_TCSETPGRP
        if (SHTTY != -1 && tcsetpgrp(SHTTY, pgrp) == -1 && !ep)
#else
# if ardent
        if (SHTTY != -1 && setpgrp() == -1 && !ep)
# else
        int arg = pgrp;

        if (SHTTY != -1 && ioctl(SHTTY, TIOCSPGRP, &arg) == -1 && !ep)
# endif
#endif
        {
            if (kill(pgrp, 0) == -1)
                attachtty(mypgrp);                     <===============
            else {
                zerr("can't set tty pgrp: %e", NULL, errno);
                fflush(stderr);
                opts[MONITOR] = OPT_UNSET;
                ep = 1;
                errflag = 0;
            }
        }
    }
}


I marked the line that I find suspicious. After I simply commented out
this line the hangups didn't occur anymore.

Does that help the experts to figure out the problem? Please tell me if
you need more information. And thanks for the help!

-- Achim --





Messages sorted by: Reverse Date, Date, Thread, Author