NetBSD-Bugs archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
Re: pkg/54192: lang/rust build error
The following reply was made to PR toolchain/54192; it has been noted by GNATS.
From: Kamil Rytarowski <n54%gmx.com@localhost>
To:
Cc: gnats-bugs%netbsd.org@localhost
Subject: Re: pkg/54192: lang/rust build error
Date: Wed, 16 Oct 2019 15:56:47 +0200
On 16.10.2019 15:50, Martin Husemann wrote:
> Since it was not obvious to me, let me try to explain what happens:
>
> - a multithreaded program calls fork()
> - the forked child process only has a single lwp initially, wich has l=
id 1
>
> So in the parent thread _lwp_self() (aka lid) was !=3D 1, and now in the=
child
> it has changed. Apparently something in ld.elf_so goes wrong later when
> using _lwp_self() =3D=3D 1 with a memory state inherited that was setup =
for
> _lwp_self() !=3D 1.
>
> Joergs patch makes the single lwp inherit the lid from the forking paren=
t
> thread (instead of always being 1).
>
> Martin
>
This is right behavior of the kernel.
The same will happen on FreeBSD (lwpid is always unique globally), on
Linux (getpid is always unique) etc.
If there is some assumption in NetBSD on copied lid, it's a bug in
ld.elf_so.
Home |
Main Index |
Thread Index |
Old Index