Jan and I were discussing some problems I was having with pam_mount, and
discovered that my issues were in fact caused by fish. Here's what we've
concluded:

Summary: Multiple bugs w.r.t. foreground-background handling in fish
Affected: fish 1.23.0
Hardware Platform: x86_64, gentoo. It is believed to affect all
configurations however.
Operating System: Linux 2.6.28
Details:

        Starting fish as a backgroud process (from another subshell),
        it goes into an infinite loop whilst waiting for itself to
        become the process group leader.

Reproducibility: Always
Steps to reproduce:

        1. start a shell different than fish, for example, bash
        2. issue "fish &"
        3. (infinite loop until put into foreground)

Actual Results:

        fish goes into an endless loop. The code responsible is:

        /* Loop until we are in the foreground. */
        while (tcgetpgrp(0) != shell_pgid)
        {
                killpg(shell_pgid, SIGTTIN);
        }

        tcgetpgrp(0) returns the PID of the bash shell; shell_pgid
        is the PID of fish, and getpid() happens to equal shell_pgid.

        I [Jan] am by no means familiar with fish, but it seems that
        it catches SIGTTIN and "handles" it without action, that is,
        fails to suspend itself, which the default handler for SIGTTIN
        would do. This would explain the endless loop.

Expected results:

        Not busy looping.

Additional information:

        Calling tcsetpgrp() in the aforementioned function also seems
        a bit dangerous (it looks like fish "steals" the tty control),
        for the parent shell (bash in the example) should have issued
        tcsetpgrp when it gave control to the fish subshell.

Severity: Major?
Impact:

        Though calling "fish &" might seem a bit strange, it seems to
        be part of a bigger issue of a hanging login procedure
        (both with standard console login(1) and others, such as
        bash->su->fish) that we observed.

        # ps xaf -o pid,pgrp,stat,command
         PID  PGRP  STAT COMMAND
         8287  8287 Ss   /bin/login --
         8299  8287 R     \_ -fish

Attachment: signature.asc
Description: OpenPGP digital signature

------------------------------------------------------------------------------
Open Source Business Conference (OSBC), March 24-25, 2009, San Francisco, CA
-OSBC tackles the biggest issue in open source: Open Sourcing the Enterprise
-Strategies to boost innovation and cut costs with open source participation
-Receive a $600 discount off the registration fee with the source code: SFAD
http://p.sf.net/sfu/XcvMzF8H
_______________________________________________
Fish-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/fish-users

Reply via email to