6-current totally hangs by this program, from user, not root. No responds on keys pressed, Control-Alt-ESC, switching console and etc. System run in infinite loop in sys/kern/tty.c:ttread() === read: splx(s); /* * Input present, check for input mapping and processing. */ first = 1; if (ISSET(lflag, ICANON | ISIG)) goto slowcase; for (;;) { char ibuf[IBUFSIZ]; int icc; icc = imin(uio->uio_resid, IBUFSIZ); /* XXX uio_resid==0 => icc=0 */ icc = q_to_b(qp, ibuf, icc); /* icc == 0 */ if (icc <= 0) { if (first) goto loop; === How-To-Repeat: Run this test program and type any. System immediately hangs. #include <stdio.h> #include <stdlib.h> #include <unistd.h> #include <errno.h> #include <termios.h> #include <sys/types.h> #include <sys/stat.h> #include <fcntl.h> #include <string.h> #define cfmakeraw(ptr) (ptr)->c_iflag &= ~(IGNBRK|BRKINT|PARMRK|ISTRIP|INLCR\ |IGNCR|ICRNL|IXON);\ (ptr)->c_oflag &= ~OPOST;\ (ptr)->c_lflag &= ~(ECHO|ECHONL|ICANON|ISIG|IEXTEN);\ (ptr)->c_cflag &= ~(CSIZE|PARENB);\ (ptr)->c_cflag |= CS8 int main(int argc, char *argv[]) { int fd, i; char *buf[1024]; struct termios tcn; if ((fd = open("/dev/tty", O_RDWR | O_NONBLOCK)) == -1) { return -1; /* errno already set */ } /* Set the tty to raw and to the correct speed */ tcgetattr(fd, &tcn); tcn.c_oflag = 0; tcn.c_iflag = IGNBRK | IGNPAR; tcn.c_cflag = CREAD | CLOCAL | CS8; tcn.c_lflag = NOFLSH; cfmakeraw(&tcn); for (i = 0; i < 16; i++) tcn.c_cc[i] = 0; tcn.c_cc[VMIN] = 1; tcn.c_cc[VTIME] = 0; tcsetattr(fd, TCSANOW, &tcn); if ((i = fcntl(fd, F_GETFL, 0)) != -1) { i &= ~O_NONBLOCK; fcntl(fd, F_SETFL, i); } read(fd, buf, 0); }
Responsible Changed From-To: freebsd-bugs->phk Poul-Henning has done major overhaul of tty code in 6-CURRENT.
Poul-Henning, Slawa has done a binary search and has found that the problem was introduced Nov 15 2004, between 18:00 and 24:00 GMT. There was a serie of commits fixing each other, and he can't find the exact one. However, I think the time slice of breakage is given quite precisely. Hope this information will be useful for you. -- Totus tuus, Glebius. GLEBIUS-RIPN GLEB-RIPE
Mime-Version: 1.0 Content-Type: text/plain; charset=koi8-r Content-Disposition: inline In-Reply-To: <20050124205703.GA1019@mail.acropolis.ru> User-Agent: Mutt/1.5.6i X-Virus-Scanned: ClamAV version devel-20050119, clamav-milter version 0.80ff on relay.bestcom.ru X-Virus-Status: Clean Poul-Henning, some more information from Slawa. I'm just Russian-English translator. [Slawa] I've found the commit which makes my test program freeze system. S> phk 2004-11-15 22:11:09 UTC S> S> FreeBSD src repository S> S> Modified files: S> sys/fs/devfs devfs_vnops.c S> Log: S> Make vnode bypass the default for devices. S> S> Can be disabled in case of problems with S> vfs.devfs.fops=0 S> in loader.conf S> S> Revision Changes Path S> 1.85 +1 -1 src/sys/fs/devfs/devfs_vnops.c I suppose that cause of the problem has been in tty.c for a long time, and this commit exposes it. The test were made with program submitted in PR. Sorry, but can't run the tests with real hardware, since it is not longer available. Originally the problem was found on a dial in server. [/Slawa] Slawa, does CURRENT works for you if you put vfs.devfs.fops=0 in loader.conf? -- Totus tuus, Glebius. GLEBIUS-RIPN GLEB-RIPE
On Tue, Jan 25, 2005 at 11:05:09AM +0300, Gleb Smirnoff wrote: > some more information from Slawa. I'm just Russian-English translator. > > [Slawa] > I've found the commit which makes my test program freeze system. > > S> phk 2004-11-15 22:11:09 UTC > S> > S> FreeBSD src repository > S> > S> Modified files: > S> sys/fs/devfs devfs_vnops.c > S> Log: > S> Make vnode bypass the default for devices. > S> > S> Can be disabled in case of problems with > S> vfs.devfs.fops=0 > S> in loader.conf > S> > S> Revision Changes Path > S> 1.85 +1 -1 src/sys/fs/devfs/devfs_vnops.c > > I suppose that cause of the problem has been in tty.c for a long time, > and this commit exposes it. > > The test were made with program submitted in PR. Sorry, but can't run the > tests with real hardware, since it is not longer available. Originally the > problem was found on a dial in server. > [/Slawa] > > Slawa, does CURRENT works for you if you put vfs.devfs.fops=0 in loader.conf? No, if vfs.devfs.fops=0 only test program run OK, pilot-xfer alike hangs system. -- Slawa Olhovchenkov
State Changed From-To: open->closed Fixed! Sorry for the delay.