This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Re: malloc, vfork, and OpenJDK
* Adhemerval Zanella:
>> And OpenJDK recently switched to posix_spawn + jspawnhelper for its
>> default process launch method, so that bug is going to go away
>> eventually. But Java binaries tend to stick around for a long time.
>
> So the idea is to focus on making malloc work correctly with vfork,
> so old OpenJDK which uses vfork for process spawning does not issue
> undefined behaviour? Or the remaining bugs are not really affecting
> OpenJDK and the idea is start to define a strict environment where
> malloc after vfork would be safe?
I think this is an unintended, but very relevant constraint on the
future evolution of malloc. This scenario has to keep working, even
though it's undefined behavior.
> It looks like even the *option* to use posix_spawn is a recent addition
> to openjdk [2]. So the question I have is how effective would to focus on
> backport the option to use posix_spawn on OpenJDK.
OpenJDK backports are unrealistic. People will use some download of the
free/gratuit version of Oracle JDK and not upgrade to the commercial,
still-maintained version. So even if we can get the fix into OpenJDK 8,
it's not likely to be available to users in practice.
That's why I think we can't break this usage scenario.
> We can focus on extending posix_spawn to add the missing features to remove
> the requirement of jspawnhelper (which is orthogonal to the issue).
Yes, it's independent.
> [1] https://zatrazz.github.io/More-About-Lauching-Processes/
Nice, thanks for writing this up.
Florian