[Lxc-users] Problem with core dumps generated from containers, apport

Serge Hallyn serge.hallyn at ubuntu.com
Tue Apr 23 12:52:14 UTC 2013


Quoting Hans Feldt (hans.feldt at ericsson.com):
> 
> > -----Original Message-----
> > From: Serge Hallyn [mailto:serge.hallyn at ubuntu.com]
> > Sent: den 22 april 2013 17:59
> > To: Hans Feldt
> > Cc: lxc-users at lists.sourceforge.net
> > Subject: Re: [Lxc-users] Problem with core dumps generated from
> > containers, apport
> > 
> > My guess would be similar to this but slightly different.  I'd guess that apport
> > on the host sees the SEGV in kernel log.  That will have the correct pid for the
> 
> Actually the kernel (3.5.0-27 in this case) executes apport with some arguments,
> one is a PID. It seems like this is container PID from the apport logs:
> 
> Traceback (most recent call last):
>   File "/usr/share/apport/apport", line 54, in drop_privileges
>     stat = os.stat('/proc/' + pid)
> OSError: [Errno 2] No such file or directory: '/proc/260'
> 
> During handling of the above exception, another exception occurred:
> 
> Traceback (most recent call last):
>   File "/usr/share/apport/apport", line 279, in <module>
>     drop_privileges(pid, True)
>   File "/usr/share/apport/apport", line 56, in drop_privileges
>     raise ValueError('Invalid process ID: ' + str(e))
> ValueError: Invalid process ID: [Errno 2] No such file or directory: '/proc/260'
> ERROR: apport (pid 3224) Mon Apr 22 22:03:03 2013: pid: 3224, uid: 0, gid: 0, euid: 0, egid: 0
> ERROR: apport (pid 3224) Mon Apr 22 22:03:03 2013: environment: environ({})
> 
> 260 is the PID of my test program (sleep 1000) in the container. It of course had another
> PID on the host...

Hm, well that's certainly surprising to me, but there it is, in
fs/coredump.c:format_corename(): case 'p' uses task_tgid_vnr().

Would you like to send a patch upstream to add 'P' as an option
for using the global pid?

-serge




More information about the lxc-users mailing list