* How the devil can gettid() return 1?
@ 2016-08-08 12:11 Tom Horsley
2016-08-08 12:49 ` Vegard Nossum
0 siblings, 1 reply; 2+ messages in thread
From: Tom Horsley @ 2016-08-08 12:11 UTC (permalink / raw)
To: linux-kernel
Every once in a while google-chrome goes into a 100% cpu loop.
I got curious and examined the thread that was running at 100%
and strace says this over and over again till I interrupt it:
gettid() = 1
gettid() = 1
gettid() = 1
gettid() = 1
^Cstrace: Process 18863 detached
<detached ...>
Clearly Process 18863 isn't the init process, how can it
have a tid of 1?
This is on a fedora 24 box with a 4.6 kernel:
Linux tomh 4.6.4-301.fc24.x86_64 #1 SMP Tue Jul 12 11:50:00 UTC 2016 x86_64 x86_64 x86_64 GNU/Linux
Just curious...
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: How the devil can gettid() return 1?
2016-08-08 12:11 How the devil can gettid() return 1? Tom Horsley
@ 2016-08-08 12:49 ` Vegard Nossum
0 siblings, 0 replies; 2+ messages in thread
From: Vegard Nossum @ 2016-08-08 12:49 UTC (permalink / raw)
To: Tom Horsley; +Cc: LKML
On 8 August 2016 at 14:11, Tom Horsley <horsley1953@gmail.com> wrote:
> Every once in a while google-chrome goes into a 100% cpu loop.
> I got curious and examined the thread that was running at 100%
> and strace says this over and over again till I interrupt it:
>
> gettid() = 1
> gettid() = 1
> gettid() = 1
> gettid() = 1
> ^Cstrace: Process 18863 detached
> <detached ...>
>
> Clearly Process 18863 isn't the init process, how can it
> have a tid of 1?
If you call clone() with CLONE_NEWPID then the new process will run in
a new PID namespace (with new pids/tids starting at 1). The new
process still has a pid in the old (containing) namespace, here
presumably 18863. Chrome is probably using namespaces to isolate
itself from the rest of the system.
You can read more about CLONE_NEWPID in 'man 2 clone'.
Vegard
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2016-08-08 12:56 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-08-08 12:11 How the devil can gettid() return 1? Tom Horsley
2016-08-08 12:49 ` Vegard Nossum
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®