[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20090223182153.GD13151@us.ibm.com>
Date: Mon, 23 Feb 2009 12:21:53 -0600
From: "Serge E. Hallyn" <serue@...ibm.com>
To: Cedric Le Goater <clg@...ibm.com>
Cc: Linux Containers <containers@...ts.osdl.org>,
Linux Kernel Mailing List <linux-kernel@...r.kernel.org>
Subject: Re: debugging threaded apps running under a clone(CLONE_NEWPID)
Quoting Cedric Le Goater (clg@...ibm.com):
> Hello !
>
> to debug threaded apps, gdb uses a special libthread_db which seeks in the
> symbols of the exec the list of running threads. This list contains the glibc
> 'struct pthread' descriptor with pids and tids which values are relative
> to the namespace in which the threads were created.
>
> unless you run gdb in the same pid namespace, gdb will not see any thread
> in the debugged app. this is frustrating for some scenarios and some
> support from the kernel would be needed to address this issue. Here
> are some ideas :
>
> . enter a pid namespace. hard.
>
> . expose the pid numbers of a task in its pid namespaces, through some
> ways like /proc/self/stat or /proc/self/pids and modify gdb to make
> the conversion.
>
> How would you do it ?
perhaps a /proc/$$/vpid which prints out
task_pid_nr_ns(tsk, current->nsproxy->pidns)
then each thread opens an fd for /proc/self/vpid and passes it
over an af_unix socket to the parent gdb, which then reads it
to get the pid in its own ns?
-serge
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists