From: Pedro Alves <palves@redhat.com>
To: Jan Kratochvil <jan.kratochvil@redhat.com>,
Yao Qi <yao@codesourcery.com>
Cc: gdb-patches@sourceware.org, Sergio Durigan Junior <sergiodj@redhat.com>
Subject: Re: [patch] Fix TLS access for -static -pthread
Date: Thu, 05 Jun 2014 15:18:00 -0000 [thread overview]
Message-ID: <53908A15.8000501@redhat.com> (raw)
In-Reply-To: <20140605080639.GA32146@host2.jankratochvil.net>
On 06/05/2014 09:06 AM, Jan Kratochvil wrote:
> On Thu, 05 Jun 2014 09:15:05 +0200, Yao Qi wrote:
> [...]
>> thread 1^M
>> [Switching to thread 1 (Thread 5784)]^M
>> #0 clone () at ../ports/sysdeps/unix/sysv/linux/arm/nptl/../clone.S:62^M
>> 62 cmp r0, #0^M
>> (gdb) PASS: gdb.threads/staticthreads.exp: thread 1
>> up 10^M
>> #2 0xbe8ea7e4 in ?? ()^M
>> (gdb) FAIL: gdb.threads/staticthreads.exp: up 10
It'd be nice if this was reported to glibc upstream.
> This is a bug of unwinding clone() at this PC. IIRC even x86_64 has this or
> similar CFI bug, though.
I think it's fixed. It works here on f20:
(gdb) bt
#0 thread_function0 (arg=0x0) at threads.c:63
#1 0x000000373c807f33 in start_thread (arg=0x7ffff7fc6700) at pthread_create.c:309
#2 0x000000373bcf4ded in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:111
(gdb)
It seems this bug ends up easily happening on new ports:
https://sourceware.org/ml/libc-ports/2012-05/msg00068.html
https://sourceware.org/ml/libc-alpha/2014-01/msg00337.html
Sounds like nobody has a test to catch this. Assuming glibc's
backtrace() makes use of CFI, glibc itself could have one.
But maybe we should be have it too - a GNU/Linux specific,
but arch-independent test that makes sure a backtrace in a thread
always stops at clone. Likewise for catching bogus frames beyond
'_start' in the main thread (with "set backtrace past-main on").
--
Pedro Alves
next prev parent reply other threads:[~2014-06-05 15:18 UTC|newest]
Thread overview: 22+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-04-10 11:52 Jan Kratochvil
2014-04-11 11:03 ` Jan Kratochvil
2014-05-20 15:10 ` Tom Tromey
2014-05-20 15:18 ` Jan Kratochvil
2014-05-20 15:10 ` Tom Tromey
2014-05-21 12:17 ` Jan Kratochvil
2014-05-21 14:14 ` Tom Tromey
2014-05-21 14:28 ` [commit] " Jan Kratochvil
2014-06-05 7:17 ` Yao Qi
2014-06-05 8:06 ` Jan Kratochvil
2014-06-05 9:32 ` Yao Qi
2014-06-05 9:39 ` Jan Kratochvil
2014-06-05 14:20 ` Yao Qi
2014-06-05 15:23 ` Pedro Alves
2014-06-06 2:26 ` Yao Qi
2014-06-05 15:18 ` Pedro Alves [this message]
2014-06-06 15:03 ` Jan Kratochvil
2014-06-06 2:36 ` Yao Qi
2014-06-06 6:16 ` Yao Qi
2014-06-06 14:20 ` Jan Kratochvil
2014-06-06 5:34 ` Sergio Durigan Junior
2014-06-06 14:21 ` Jan Kratochvil
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=53908A15.8000501@redhat.com \
--to=palves@redhat.com \
--cc=gdb-patches@sourceware.org \
--cc=jan.kratochvil@redhat.com \
--cc=sergiodj@redhat.com \
--cc=yao@codesourcery.com \
/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