Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 11 Jun 1999 15:48:19 +0200
From:      Jos Backus <Jos.Backus@nl.origin-it.com>
To:        current@freebsd.org
Subject:   Snoop device broken
Message-ID:  <19990611154819.E21893@hal.mpn.cp.philips.com>

next in thread | raw e-mail | index | archive | help
With a kernel built on June 9th, I am seeing the following:

hal:/sys/kern# w -h | grep jos
jos              p1       :0.0             Wed03PM     - /usr/local/bin/vim /ho
# watch p1
watch: fatal: cannot attach to tty
#

kdump output:

 25537 watch    CALL  open(0xbfbfd8f4,0,0xbfbfd9e4)
 25537 watch    NAMI  "/dev/snp0"
 25537 watch    RET   open 3
 25537 watch    CALL  stat(0xbfbfd504,0xbfbfd4a4)
 25537 watch    NAMI  "/dev/ttyp1"
 25537 watch    RET   stat 0
 25537 watch    CALL  ioctl(0x3,SNPSTTY,0x804ac80)
 25537 watch    RET   ioctl -1 errno 22 Invalid argument
 25537 watch    CALL  ioctl(0,TIOCSETA,0x804b0a0)
 25537 watch    RET   ioctl 0
 25537 watch    CALL  write(0x2,0xbfbfcd04,0x7)
 25537 watch    GIO   fd 2 wrote 7 bytes
       "watch: "
 25537 watch    RET   write 7
 25537 watch    CALL  write(0x2,0xbfbfcd1c,0x1b)
 25537 watch    GIO   fd 2 wrote 27 bytes
       "fatal: cannot attach to tty"
 25537 watch    RET   write 27/0x1b
 25537 watch    CALL  write(0x2,0xbfbfcd08,0x1)
 25537 watch    GIO   fd 2 wrote 1 byte
       "
       "
 25537 watch    RET   write 1
 25537 watch    CALL  exit(0x45) 

The following code in sys/kern/tty_snoop.c seems responsible:

                tp = snpdevtotty(tdev);
                if (!tp)
                        return (EINVAL);
 
which in turn leads to

static struct tty *
snpdevtotty (dev)
        dev_t           dev;
{
        struct cdevsw   *cdp;

        cdp = devsw(dev);
        if (cdp == NULL)
                return (NULL);
        return ((*cdp->d_devtotty)(dev));
}

Apparently cdp is set to NULL here by the ``devsw(dev)'' call.

I suspect that this issue is related to the recent dev_t changes.

Is anyone else seeing this?


Thanks,
-- 
Jos Backus                          _/ _/_/_/  "Reliability means never
                                   _/ _/   _/   having to say you're sorry."
                                  _/ _/_/_/             -- D. J. Bernstein
                             _/  _/ _/    _/
Jos.Backus@nl.origin-it.com  _/_/  _/_/_/      use Std::Disclaimer;


To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-current" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?19990611154819.E21893>