On Wed, Sep 12, 2007 at 11:52:32PM +0200, Fermín Galán Márquez wrote: > This is the trace (as you can see I're repeated the experiment twice, > the result is basically the same), hoping it could be useful to diagnose > the problem and fix eventual bugs in the UML kernel. See below regarding > the test procedure. > > (gdb) bt > #0 0xb7f9d7f2 in ?? () from /lib/ld-linux.so.2 > #1 0xb7f19ab0 in tcsetattr () from /lib/i686/cmov/libc.so.6 > #2 0x080610d5 in generic_console_write (fd=7, > buf=0x828fc13 "ip_tables: (C) 2000-2006 Netfilter Core Team\n", n=45) > at arch/um/drivers/chan_user.c:37 > #3 0x0806096e in console_write_chan (chans=0x82756f0, > buf=0x828fc13 "ip_tables: (C) 2000-2006 Netfilter Core Team\n", len=45) > at arch/um/drivers/chan_kern.c:352
My reaction to this has been that you are running UML under a script which isn't reading UML output correctly, therefore the pts device fills up, and UML hangs during console output because the pts device buffer is full and tcsetattr is waiting for it to empty. However, after looking at this, it turns up a host bug where, under the conditions that UML is using it, tcsetattr will always, guaranteed, return -EINTR. UML will then hang because it will loop, making the call until it returns something other than -EINTR. See http://marc.info/?l=linux-kernel&m=119618990807182&w=2 for my analysis. There is a workaround in UML, attached below. I basically block SIGIO over the block of code which is fiddling terminal attributes. Jeff -- Work email - jdike at linux dot intel dot com Index: linux-2.6.22/arch/um/drivers/chan_user.c =================================================================== --- linux-2.6.22.orig/arch/um/drivers/chan_user.c 2007-11-21 11:43:50.000000000 -0500 +++ linux-2.6.22/arch/um/drivers/chan_user.c 2007-11-27 14:03:10.000000000 -0500 @@ -74,10 +74,16 @@ void generic_free(void *data) int generic_console_write(int fd, const char *buf, int n) { + sigset_t old, no_sigio; struct termios save, new; int err; if (isatty(fd)) { + sigemptyset(&no_sigio); + sigaddset(&no_sigio, SIGIO); + if (sigprocmask(SIG_BLOCK, &no_sigio, &old)) + goto error; + CATCH_EINTR(err = tcgetattr(fd, &save)); if (err) goto error; @@ -97,8 +103,11 @@ int generic_console_write(int fd, const * Restore raw mode, in any case; we *must* ignore any error apart * EINTR, except for debug. */ - if (isatty(fd)) + if (isatty(fd)) { CATCH_EINTR(tcsetattr(fd, TCSAFLUSH, &save)); + sigprocmask(SIG_SETMASK, &old, NULL); + } + return err; error: return -errno; ------------------------------------------------------------------------- This SF.net email is sponsored by: Microsoft Defy all challenges. Microsoft(R) Visual Studio 2005. http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/ _______________________________________________ User-mode-linux-user mailing list User-mode-linux-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/user-mode-linux-user