On 1/23/25 00:31, Pavel Begunkov wrote:
On 1/22/25 23:49, Askar Safin wrote:
---- On Sun, 19 Jan 2025 07:03:51 +0400 Pavel Begunkov wrote ---
> I also wonder, if copying the page table is a performance problem, why
> CLONE_VM + exec is not an option?
Do you mean CLONE_VFORK? Anyway, CLONE_VM surprisingly turns out
No, vfork is troublesome. What I mean is a task that shares
the page table, or in other words a vfork that doesn't block
and has a dedicated stack.
to be a good solution. So thank you!
There is a bug in libc or in Linux: https://sourceware.org/bugzilla/show_bug.cgi?id=32565 .
I suspect this is actually a Linux bug.
After receiving your letter I decided to try CLONE_VM. And it works!
There is no bug in CLONE_VM version! You can see more details here:
https://www.openwall.com/lists/musl/2025/01/22/1
I haven't looked at the bug, but IIUC fundamentally posix_spawn()
does the same thing, and if so it's likely that any problem you
have with posix_spawn() could be triggered for your hand crafted
version.
Seems I was wrong, posix_spawn(3) mentions it uses CLONE_VFORK.
--
Pavel Begunkov