This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [patch] Fix CLONE_VM vs. TLS [Re: Is CLONE_VM really needed in gdbserver?]
- From: "H.J. Lu" <hjl dot tools at gmail dot com>
- To: Jan Kratochvil <jan dot kratochvil at redhat dot com>
- Cc: gdb-patches at sourceware dot org, GDB <gdb at sourceware dot org>
- Date: Thu, 28 Jan 2010 08:21:58 -0800
- Subject: Re: [patch] Fix CLONE_VM vs. TLS [Re: Is CLONE_VM really needed in gdbserver?]
- References: <6dc9ffc81001261551j6221db6v88e96713d6dd9497@mail.gmail.com> <20100127000821.GA29862@caradoc.them.org> <20100127221236.GA4746@host0.dyn.jankratochvil.net>
On Wed, Jan 27, 2010 at 2:12 PM, Jan Kratochvil
<jan.kratochvil@redhat.com> wrote:
> On Wed, 27 Jan 2010 01:08:26 +0100, Daniel Jacobowitz wrote:
>> On Tue, Jan 26, 2010 at 03:51:38PM -0800, H.J. Lu wrote:
>> > Hi,
>> >
>> > There is a race condition between gdbserver and ld.so on Linux/x86-64:
>> >
>> > http://www.sourceware.org/bugzilla/show_bug.cgi?id=11214
>> >
>> > Is CLONE_VM really needed? In general, CLONE_VM is a very bad
>> > idea if there is any symbol lookup in both parent and child processes.
>>
>> It is necessary because gdbserver supports uClinux. ?However, on Linux
>> we might be able to get away with fork (see linux_tracefork_child in
>> gdb/linux-nat.c).
>
> Coded it as suggested.
>
> No regressions on {x86_64,x86_64-m32,i686}-fedora12-linux-gnu and on
> x86_64-fedora12-linux-gnu via gdbserver.
>
> Verified linux_supports_tracefork_flag gets still set with the patch.
>
> Verified unsetting HAVE_FORK for gdb/gdbserver/ still works the same.
>
> gdb/ already tests HAVE_FORK in config.in but it is brought in by other
> macros, therefore rather added an explicit configure.ac test for it.
>
> Have not found an easy enough uClinux disk image of some arch for qemu-*.
>
>
>
I think it is a glibc regression. I will try to fix it in glibc.
--
H.J.