From mboxrd@z Thu Jan 1 00:00:00 1970 From: Sukadev Bhattiprolu Subject: Re: BUG in tty_open when using containers and ptrace Date: Wed, 22 Jul 2009 18:27:33 -0700 Message-ID: <20090723012733.GB27764@us.ibm.com> References: <20090713202610.GA6447@us.ibm.com> <20090713223444.GM18617@megiteam.pl> <20090714064905.GA25278@us.ibm.com> <20090714103129.GB12958@megiteam.pl> <20090715044744.GA25745@us.ibm.com> <20090715131923.GB21417@megiteam.pl> <20090718205244.GA23625@us.ibm.com> <20090719071531.GA20818@megiteam.pl> <20090722064120.GA24373@us.ibm.com> <20090722222550.GA633@megiteam.pl> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="IJpNTDwzlM2Ie8A6" Return-path: Content-Disposition: inline In-Reply-To: <20090722222550.GA633-yp6mvK3Bdd2rDJvtcaxF/A@public.gmane.org> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: containers-bounces-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA@public.gmane.org Errors-To: containers-bounces-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA@public.gmane.org To: Grzegorz Nosek Cc: containers-qjLDD68F18O7TbgM5vRIOg@public.gmane.org, hpa-YMNOUZJC4hwAvxtiuMwx3w@public.gmane.org, Alan Cox , lxc-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org List-Id: containers.vger.kernel.org --IJpNTDwzlM2Ie8A6 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Grzegorz Nosek [root-AfQBxy1nhrQ00sYp1HPQUA@public.gmane.org] wrote: | On wto, lip 21, 2009 at 11:41:20 -0700, Sukadev Bhattiprolu wrote: | > I set | > CONFIG_SLUB_DEBUG=y | > CONFIG_SLUB=y | > CONFIG_SLUB_DEBUG_ON=y | > # CONFIG_SLUB_STATS is not set | > | > and tried 2.6.29, 2.6.31-rc3 and linux-mmotm from July 13, but have | > not been able to repro either on an i386 machine or on a KVM guest. | > | > I run your program ./tty-bug in a tight loop. I will try to run the | > program overnight in a loop. | > | > Given that your program does not depend on NET_NS, can you see if you | > can repro on 2.6.28 and see if we can bisect this problem ? | | Immediate crash. I tried 2.6.18-something (Debian etch kernel) that I | had lying around on the VM. The result: Interesting. Attaching test program and Ccing Peter Anvin for any insights. | | idr_remove called for id=0 which is not allocated. | [] idr_remove+0xd4/0x137 | [] release_mem+0x1d5/0x1e1 | [] release_dev+0x5d6/0x5ee | [] __wake_up+0x2a/0x3d | [] tty_ldisc_enable+0x1f/0x21 | [] init_dev+0x378/0x49f | [] tty_open+0x2a9/0x2e8 | [] chrdev_open+0x126/0x141 | [] chrdev_open+0x0/0x141 | [] __dentry_open+0xc8/0x1ac | [] nameidata_to_filp+0x19/0x28 | [] do_filp_open+0x2b/0x31 | [] do_nanosleep+0x43/0x6a | [] do_sigaction+0x99/0x156 | [] do_sys_open+0x3e/0xb3 | [] sys_open+0x16/0x18 | [] syscall_call+0x7/0xb | | (on the bright side, the machine is still usable afterwards). | | However, 2.6.26 (both mine and Debian) survives the test so it may indeed | be a recent regression (was it broken again after fixing sometime | between .18 and .26?) | | Bisecting... | | Best regards, | Grzegorz Nosek --IJpNTDwzlM2Ie8A6 Content-Type: text/x-csrc; charset=us-ascii Content-Disposition: attachment; filename="tty-bug.c" #define _GNU_SOURCE #include #include #include #include #include #include #include void dummy(int sig) { } static int child(void *unused) { signal(SIGINT, dummy); signal(SIGHUP, dummy); pause(); /* cheesy synchronisation to wait for /dev/pts/0 to appear */ mount("/dev/pts/0", "/dev/console", NULL, MS_BIND, NULL); sleep(2); open("/dev/console", O_RDWR); dup(0); dup(0); write(1, "Hello world!\n", sizeof("Hello world!\n")-1); return 0; } int main(void) { pid_t pid; char *stack; int fd; stack = malloc(16384); pid = clone(child, stack+16384, CLONE_NEWNS|SIGCHLD, NULL); fd = open("/dev/ptmx", O_RDWR|O_NOCTTY|O_NONBLOCK); unlockpt(fd); grantpt(fd); kill(pid, SIGHUP); sleep(1); return 0; /* exit before child opens /dev/console */ } --IJpNTDwzlM2Ie8A6 Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ Containers mailing list Containers-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA@public.gmane.org https://lists.linux-foundation.org/mailman/listinfo/containers --IJpNTDwzlM2Ie8A6--