Linux Container Development
 help / color / mirror / Atom feed
From: Grzegorz Nosek <root-AfQBxy1nhrQ00sYp1HPQUA@public.gmane.org>
To: "Serge E. Hallyn" <serue-r/Jw6+rmf7HQT0dZR+AlfA@public.gmane.org>
Cc: containers-qjLDD68F18O7TbgM5vRIOg@public.gmane.org,
	lxc-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org
Subject: Re: BUG in tty_open when using containers and ptrace
Date: Sat, 4 Jul 2009 15:28:52 +0200	[thread overview]
Message-ID: <20090704132851.GA16373@megiteam.pl> (raw)
In-Reply-To: <20090413142038.GB13007-r/Jw6+rmf7HQT0dZR+AlfA@public.gmane.org>

Hi,

On pon, kwi 13, 2009 at 09:20:38 -0500, Serge E. Hallyn wrote:
> Quoting Môshe van der Sterre (me@moshe.nl):
> > Hello,
> > 
> > I am working on the lxc userspace tools, and got this BUG a couple of
> > times.
> > Here are the reports:
> > 
> > http://moshe.nl/tty-bugshot1.png
> > http://moshe.nl/tty-bugshot2.png
> > 
> > I am running 2.6.29.1 from kernel.org in a virtual machine under kvm.
> > I have not been able to reliably reproduce it, but it happens only after
> > the container is setup and ptrace is active on lxc-start.
> > I think the first screen shot is while all ttys where allowed in
> > cgroup.devices, the second one while only tty1 was allowed.
> 
> Which distro is this - an uptodate F10, fresh F11, something else?
> 
> Since it also happens when all ttys are allowed it probably isn't the
> devices cgroup...  Actually the devpts code seems the most likely
> cause.  Suka, can you take a look at the 2.6.29.1 source for anything
> suspect?
> 
> Môshe, can you send me tty_io.S after doing:
> 	'objdump -d drivers/char/tty_io.o > tty_io.S'
> 
> as well as strace_output after doing:
> 	'strace -f -ostrace_output <your_lxc_start_command_here>'
> ?

Sorry for digging up such an old thread but I have apparently been
bitten by the same bug. I've been playing with libvirt 0.6.4 (which
mounts devpts with option newinstance) and I got the oops below
while strace'ing container init (upstart actually, got SIGINT and was
about to exit; sorry, no strace available but I remember nothing
extraordinary except for a "+++ Killed by SIGSEGV +++" at the end).

The kernel was vanilla 2.6.30 (hand-rolled on Debian Lenny).

The machine is quite uncomfortable to reboot but is not in production
use, so I guess I can test some patches if needed.

Best regards,
 Grzegorz Nosek

Jul  3 23:23:31 sback kernel: [170809.413989] general protection fault: 0000 [#1] SMP
Jul  3 23:23:31 sback kernel: [170809.414024] last sysfs file: /sys/class/net/lo/operstate
Jul  3 23:23:31 sback kernel: [170809.414052] CPU 0
Jul  3 23:23:31 sback kernel: [170809.414074] Modules linked in: veth ipt_MASQUERADE iptable_nat nf_nat nf_conntrack_ipv4 nf_defrag_ipv4 xt_state nf_conntrack ipt_REJECT xt_tcpudp iptable_filter ip_tables x_tables bridge stp llc ipv6 w
83627hf lm85 hwmon_vid loop evdev tg3 libphy k8temp shpchp pci_hotplug i2c_nforce2 i2c_core container thermal processor thermal_sys button
Jul  3 23:23:31 sback kernel: [170809.414272] Pid: 13974, comm: init Not tainted 2.6.30-sback #3 S2891
Jul  3 23:23:31 sback kernel: [170809.414301] RIP: 0010:[<ffffffff80437914>]  [<ffffffff80437914>] tty_open+0x1fb/0x423
Jul  3 23:23:31 sback kernel: [170809.414354] RSP: 0018:ffff880068015cf8  EFLAGS: 00010246
Jul  3 23:23:31 sback kernel: [170809.414383] RAX: ffff88007e540800 RBX: ffff88007e540800 RCX: ffff88007e8cd708
Jul  3 23:23:31 sback kernel: [170809.414428] RDX: 6973646e65732f64 RSI: 0000000000000000 RDI: ffff880058c8dc10
Jul  3 23:23:31 sback kernel: [170809.414474] RBP: ffff880068015d48 R08: 0000000000000002 R09: 0000000000000000
Jul  3 23:23:31 sback kernel: [170809.414519] R10: 0000000000000167 R11: 0000000000000004 R12: ffff88013ede9000
Jul  3 23:23:31 sback kernel: [170809.414564] R13: ffff88013ede9008 R14: ffff88007e586c00 R15: 0000000000000100
Jul  3 23:23:31 sback kernel: [170809.414609] FS:  00007f4a887056e0(0000) GS:ffffc20000000000(0000) knlGS:0000000000000000
Jul  3 23:23:31 sback kernel: [170809.414656] CS:  0010 DS: 0000 ES: 0000 CR0: 000000008005003b
Jul  3 23:23:31 sback kernel: [170809.414685] CR2: 00000000020cd000 CR3: 000000007dc1a000 CR4: 00000000000006e0
Jul  3 23:23:31 sback kernel: [170809.414730] DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
Jul  3 23:23:31 sback kernel: [170809.414775] DR3: 0000000000000000 DR6: 00000000ffff4ff0 DR7: 0000000000000400
Jul  3 23:23:31 sback kernel: [170809.414821] Process init (pid: 13974, threadinfo ffff880068014000, task ffff880072560040)
Jul  3 23:23:31 sback kernel: [170809.414868] Stack:
Jul  3 23:23:31 sback kernel: [170809.414889]  ffff88007e586c00 ffff880058c8dc10 0880000000008101 0000000000000001
Jul  3 23:23:31 sback kernel: [170809.414922]  0000000000000000 0000000000000000 0000000000000000 ffff88013ede9008
Jul  3 23:23:31 sback kernel: [170809.414971]  0000000000000000 ffff880058c8dc10 ffff880068015d98 ffffffff802d5b25
Jul  3 23:23:31 sback kernel: [170809.415036] Call Trace:
Jul  3 23:23:31 sback kernel: [170809.415059]  [<ffffffff802d5b25>] chrdev_open+0x15f/0x17e
Jul  3 23:23:31 sback kernel: [170809.415090]  [<ffffffff803baa3b>] ? selinux_dentry_open+0xf2/0xfb
Jul  3 23:23:31 sback kernel: [170809.415125]  [<ffffffff802d59c6>] ? chrdev_open+0x0/0x17e
Jul  3 23:23:31 sback kernel: [170809.415154]  [<ffffffff802d1082>] __dentry_open+0x155/0x274
Jul  3 23:23:31 sback kernel: [170809.415186]  [<ffffffff802d1278>] nameidata_to_filp+0x46/0x57
Jul  3 23:23:31 sback kernel: [170809.415218]  [<ffffffff802deb1b>] do_filp_open+0x4ca/0x924
Jul  3 23:23:31 sback kernel: [170809.415251]  [<ffffffff802e7ce8>] ? alloc_fd+0x122/0x133
Jul  3 23:23:31 sback kernel: [170809.415281]  [<ffffffff802d0e61>] do_sys_open+0x5b/0xdb
Jul  3 23:23:31 sback kernel: [170809.415312]  [<ffffffff802d0f14>] sys_open+0x20/0x22
Jul  3 23:23:31 sback kernel: [170809.415341]  [<ffffffff8020bf36>] tracesys+0xd9/0xde
Jul  3 23:23:31 sback kernel: [170809.415373] Code: 81 fb 00 f0 ff ff 76 11 48 c7 c7 60 61 7d 80 e8 c1 38 17 00 e9 a9 00 00 00 48 85 db 74 5c 80 bb 40 01 00 00 00 48 8b 53 08 78 64 <81> ba 9c 00 00 00 04 00 01 00 75 16 83 bb 48 01 00 0
0 00 75 4f
Jul  3 23:23:31 sback kernel: [170809.415582] RIP  [<ffffffff80437914>] tty_open+0x1fb/0x423
Jul  3 23:23:31 sback kernel: [170809.415612]  RSP <ffff880068015cf8>
Jul  3 23:23:31 sback kernel: [170809.415869] ---[ end trace e65e6319b2f34f5a ]---


Decoding the code yields:
All code
========
   0:   81 fb 00 f0 ff ff       cmp    $0xfffff000,%ebx
   6:   76 11                   jbe    0x19
   8:   48 c7 c7 60 61 7d 80    mov    $0xffffffff807d6160,%rdi
   f:   e8 c1 38 17 00          callq  0x1738d5
  14:   e9 a9 00 00 00          jmpq   0xc2
  19:   48 85 db                test   %rbx,%rbx
  1c:   74 5c                   je     0x7a
  1e:   80 bb 40 01 00 00 00    cmpb   $0x0,0x140(%rbx)
  25:   48 8b 53 08             mov    0x8(%rbx),%rdx
  29:   78 64                   js     0x8f
  2b:*  81 ba 9c 00 00 00 04    cmpl   $0x10004,0x9c(%rdx)     <-- trapping instruction
  32:   00 01 00
  35:   75 16                   jne    0x4d
  37:   83                      .byte 0x83
  38:   bb 48 01 00 00          mov    $0x148,%ebx

Code starting with the faulting instruction
===========================================
   0:   81 ba 9c 00 00 00 04    cmpl   $0x10004,0x9c(%rdx)
   7:   00 01 00
   a:   75 16                   jne    0x22
   c:   83                      .byte 0x83
   d:   bb 48 01 00 00          mov    $0x148,%ebx


_______________________________________________
Containers mailing list
Containers@lists.linux-foundation.org
https://lists.linux-foundation.org/mailman/listinfo/containers

  parent reply	other threads:[~2009-07-04 13:28 UTC|newest]

Thread overview: 40+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-04-12 13:45 BUG in tty_open when using containers and ptrace Môshe van der Sterre
2009-04-13 14:20 ` Serge E. Hallyn
     [not found]   ` <20090413142038.GB13007-r/Jw6+rmf7HQT0dZR+AlfA@public.gmane.org>
2009-07-04 13:28     ` Grzegorz Nosek [this message]
     [not found]       ` <20090704132851.GA16373-yp6mvK3Bdd2rDJvtcaxF/A@public.gmane.org>
2009-07-04 14:34         ` Grzegorz Nosek
     [not found]           ` <20090704143412.GA27523-yp6mvK3Bdd2rDJvtcaxF/A@public.gmane.org>
2009-07-05 12:08             ` Grzegorz Nosek
2009-07-07  3:31             ` Sukadev Bhattiprolu
     [not found]               ` <20090707033135.GA29461-r/Jw6+rmf7HQT0dZR+AlfA@public.gmane.org>
2009-07-07  7:34                 ` Grzegorz Nosek
2009-07-08 10:54             ` Grzegorz Nosek
     [not found]               ` <20090708105417.GA16833-yp6mvK3Bdd2rDJvtcaxF/A@public.gmane.org>
2009-07-11 19:30                 ` Grzegorz Nosek
     [not found]                   ` <20090711193055.GA11303-yp6mvK3Bdd2rDJvtcaxF/A@public.gmane.org>
2009-07-11 20:01                     ` Grzegorz Nosek
     [not found]                       ` <20090711200133.GB11303-yp6mvK3Bdd2rDJvtcaxF/A@public.gmane.org>
2009-07-11 22:19                         ` Alan Cox
     [not found]                           ` <20090711231935.6ff59796-qBU/x9rampVanCEyBjwyrvXRex20P6io@public.gmane.org>
2009-07-12  7:49                             ` Grzegorz Nosek
     [not found]                               ` <20090712074932.GA17291-yp6mvK3Bdd2rDJvtcaxF/A@public.gmane.org>
2009-07-13 19:02                                 ` Serge E. Hallyn
     [not found]                                   ` <20090713190211.GA4208-r/Jw6+rmf7HQT0dZR+AlfA@public.gmane.org>
2009-07-13 19:30                                     ` Grzegorz Nosek
     [not found]                                       ` <20090713193058.GL18617-yp6mvK3Bdd2rDJvtcaxF/A@public.gmane.org>
2009-07-13 20:26                                         ` Serge E. Hallyn
     [not found]                                           ` <20090713202610.GA6447-r/Jw6+rmf7HQT0dZR+AlfA@public.gmane.org>
2009-07-13 22:34                                             ` Grzegorz Nosek
     [not found]                                               ` <20090713223444.GM18617-yp6mvK3Bdd2rDJvtcaxF/A@public.gmane.org>
2009-07-14  6:49                                                 ` Sukadev Bhattiprolu
     [not found]                                                   ` <20090714064905.GA25278-r/Jw6+rmf7HQT0dZR+AlfA@public.gmane.org>
2009-07-14 10:31                                                     ` Grzegorz Nosek
     [not found]                                                       ` <20090714103129.GB12958-yp6mvK3Bdd2rDJvtcaxF/A@public.gmane.org>
2009-07-15  4:47                                                         ` Sukadev Bhattiprolu
     [not found]                                                           ` <20090715044744.GA25745-r/Jw6+rmf7HQT0dZR+AlfA@public.gmane.org>
2009-07-15  5:42                                                             ` Grzegorz Nosek
2009-07-15 13:19                                                             ` Grzegorz Nosek
     [not found]                                                               ` <20090715131923.GB21417-yp6mvK3Bdd2rDJvtcaxF/A@public.gmane.org>
2009-07-18 20:52                                                                 ` Sukadev Bhattiprolu
     [not found]                                                                   ` <20090718205244.GA23625-r/Jw6+rmf7HQT0dZR+AlfA@public.gmane.org>
2009-07-19  7:15                                                                     ` Grzegorz Nosek
     [not found]                                                                       ` <20090719071531.GA20818-yp6mvK3Bdd2rDJvtcaxF/A@public.gmane.org>
2009-07-22  6:41                                                                         ` Sukadev Bhattiprolu
     [not found]                                                                           ` <20090722064120.GA24373-r/Jw6+rmf7HQT0dZR+AlfA@public.gmane.org>
2009-07-22 22:25                                                                             ` Grzegorz Nosek
     [not found]                                                                               ` <20090722222550.GA633-yp6mvK3Bdd2rDJvtcaxF/A@public.gmane.org>
2009-07-23  1:27                                                                                 ` Sukadev Bhattiprolu
     [not found]                                                                                   ` <20090723012733.GB27764-r/Jw6+rmf7HQT0dZR+AlfA@public.gmane.org>
2009-07-23  1:48                                                                                     ` H. Peter Anvin
     [not found]                                                                                       ` <4A67C187.5000201-YMNOUZJC4hwAvxtiuMwx3w@public.gmane.org>
2009-07-23  7:47                                                                                         ` Grzegorz Nosek
     [not found]                                                                                           ` <20090723074736.GA20236-yp6mvK3Bdd2rDJvtcaxF/A@public.gmane.org>
2009-07-23  8:04                                                                                             ` [lxc-devel] " Daniel Lezcano
2009-07-23 18:26                                                                                         ` Grzegorz Nosek
     [not found]                                                                                           ` <20090723182620.GA16322-yp6mvK3Bdd2rDJvtcaxF/A@public.gmane.org>
2009-07-23 19:32                                                                                             ` Sukadev Bhattiprolu
     [not found]                                                                                               ` <20090723193245.GA25662-r/Jw6+rmf7HQT0dZR+AlfA@public.gmane.org>
2009-07-23 20:33                                                                                                 ` Grzegorz Nosek
     [not found]                                                                                                   ` <20090723203329.GC16322-yp6mvK3Bdd2rDJvtcaxF/A@public.gmane.org>
2009-07-23 22:11                                                                                                     ` H. Peter Anvin
     [not found]                                                                                                       ` <4A68E026.1070608-YMNOUZJC4hwAvxtiuMwx3w@public.gmane.org>
2009-07-24  7:31                                                                                                         ` Grzegorz Nosek
     [not found]                                                                                                           ` <20090724073158.GA2617-yp6mvK3Bdd2rDJvtcaxF/A@public.gmane.org>
2009-07-30 18:06                                                                                                             ` Sukadev Bhattiprolu
     [not found]                                                                                                               ` <20090730180611.GA20872-r/Jw6+rmf7HQT0dZR+AlfA@public.gmane.org>
2009-07-30 18:44                                                                                                                 ` Sukadev Bhattiprolu
2009-07-31 21:58                                                                                                                 ` Grzegorz Nosek
2009-08-07 19:08                                                                                                                   ` Sukadev Bhattiprolu
2009-07-05 20:00         ` Môshe van der Sterre
2009-07-05 20:35           ` Grzegorz Nosek

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20090704132851.GA16373@megiteam.pl \
    --to=root-afqbxy1nhrq00syp1hpqua@public.gmane.org \
    --cc=containers-qjLDD68F18O7TbgM5vRIOg@public.gmane.org \
    --cc=lxc-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org \
    --cc=serue-r/Jw6+rmf7HQT0dZR+AlfA@public.gmane.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox