[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <1333480873.10230.35.camel@lenny>
Date: Tue, 03 Apr 2012 15:21:13 -0400
From: Colin Walters <walters@...bum.org>
To: KOSAKI Motohiro <kosaki.motohiro@...il.com>
Cc: Alexey Dobriyan <adobriyan@...il.com>, akpm@...ux-foundation.org,
viro@...iv.linux.org.uk, torvalds@...ux-foundation.org,
drepper@...il.com, linux-kernel@...r.kernel.org,
linux-fsdevel@...r.kernel.org
Subject: Re: [PATCH] nextfd(2)
On Mon, 2012-04-02 at 16:17 -0700, KOSAKI Motohiro wrote:
> we can only call async-signal-safe functions after fork() when multi threads and
> opendir() call malloc() internally.
>
> As far as I know, OpenJDK has a such fork-readdir-exec code and it can
> make deadlock
> when spawnning a new process. Unfortunately Java language perfeter to
> make a lot of threads rather than other language.
>
> This patch can solve such multi threaded case.
>
> offtopic, glibc malloc is a slightly clever. It reinitialize its
> internal lock when fork by
> using thread_atfork() hook. It mean glibc malloc can be used after
> fork() and the
> technique can avoid this issue.
Yeah, a *lot* of code out there depends on this glibc malloc
implementation detail. We uncovered our dependency on this in
GNOME a while back while investigating getenv/setenv/fork and threads:
https://bugzilla.gnome.org/show_bug.cgi?id=659326
--
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