Re: lang/rust build fails

2020-05-16 Thread Robert Nestor
Happy to report that Martin’s suggestion to initialize /var/db/entropy-file on 
my newly installed system using the file from a older system did the trick.  
The build of rust completely successfully on a new 9.99.61 installation.

-bob

On May 15, 2020, at 4:53 PM, Andrew Doran  wrote:

> On Thu, May 14, 2020 at 11:53:04AM -0500, Robert Nestor wrote:
>> Ran into an interesting problem trying to build lang/rust from both -current 
>> and 2020Q1 pkgsrc.  On a NetBSD installation of 9.99.45 kernel and user 
>> land, the builds succeed.  Under 9.99.60 kernel and user land the builds 
>> fail.
>> 
>> The failure doesn?t give much of a clue about what?s happened.  The last 
>> lines in the build.log are:
>> 
>> running: /pkg_comp/work/pkg/lang/rust/work/rust-bootstrap/bin/cargo build 
>> --manifest-path 
>> /pkg_comp/work/pkg/lang/rust/work/rustc-1.42.0-src/src/bootstrap/Cargo.toml 
>> --frozen
>>   Compiling proc-macro2 v0.4.30
>> 
>> At that point there?s nothing consuming CPU time in the build and everything 
>> seems to be waiting on something to happen that never does.  I?ve left the 
>> system in that state for about 24 hours and still no progress.
>> 
>> Any  clues? Could this be something related to some of the recent kernel 
>> changes?
> 
> I think it's likely a race condition with pthread_mutex.  I found a decent
> repro and will take a look, hopefully this weekend.
> 
> Andrew



Re: lang/rust build fails

2020-05-16 Thread Havard Eidnes
> The failure doesn't give much of a clue about what's happened.
> The last lines in the build.log are:
>
> running: /pkg_comp/work/pkg/lang/rust/work/rust-bootstrap/bin/cargo build 
> --manifest-path 
> /pkg_comp/work/pkg/lang/rust/work/rustc-1.42.0-src/src/bootstrap/Cargo.toml 
> --frozen
>Compiling proc-macro2 v0.4.30
> 
> At that point there's nothing consuming CPU time in the build
> and everything seems to be waiting on something to happen that
> never does.  I've left the system in that state for about 24
> hours and still no progress.
>
> Any clues? Could this be something related to some of the
> recent kernel changes?

I think I've seen something similar to this in my rebuilds:
sometimes cargo is present and waiting, and there is at least one
rustc child which is in "zombie" process state.  It's as if cargo
didn't "get the message" that the child process is done, and its
status is available for collection.

"ps axd" will show the process relationships.

I don't have an explanation why this happens, though, or a fix
for the problem.

Regards,

- Håvard


Re: lang/rust build fails

2020-05-15 Thread Andrew Doran
On Thu, May 14, 2020 at 11:53:04AM -0500, Robert Nestor wrote:
> Ran into an interesting problem trying to build lang/rust from both -current 
> and 2020Q1 pkgsrc.  On a NetBSD installation of 9.99.45 kernel and user land, 
> the builds succeed.  Under 9.99.60 kernel and user land the builds fail.
> 
> The failure doesn?t give much of a clue about what?s happened.  The last 
> lines in the build.log are:
> 
> running: /pkg_comp/work/pkg/lang/rust/work/rust-bootstrap/bin/cargo build 
> --manifest-path 
> /pkg_comp/work/pkg/lang/rust/work/rustc-1.42.0-src/src/bootstrap/Cargo.toml 
> --frozen
>Compiling proc-macro2 v0.4.30
> 
> At that point there?s nothing consuming CPU time in the build and everything 
> seems to be waiting on something to happen that never does.  I?ve left the 
> system in that state for about 24 hours and still no progress.
> 
> Any  clues? Could this be something related to some of the recent kernel 
> changes?

I think it's likely a race condition with pthread_mutex.  I found a decent
repro and will take a look, hopefully this weekend.

Andrew


Re: lang/rust build fails

2020-05-15 Thread Robert Nestor
Thanks!  I’ll give your suggestions a try.

-bob

On May 15, 2020, at 7:27 AM, Martin Husemann  wrote:

> On Fri, May 15, 2020 at 06:27:41AM -0500, Robert Nestor wrote:
>> Yes, and it appears to be different from what Chavdar has on his slightly 
>> earlier system.
>> seed  0 ???  estimate, collect, v
> 
> Bingo!
> 
> You do not have a hardware random number generator, and your setup did not
> provide initial entropy.
> 
> There is an ongoing thread on some other list where this currently is
> discussed with lots of technical details and irritation, but the short
> story is:
> 
> - Easiest fix for now is to provide a properly seeded /var/db/entropy-file
>   (shutdown to single user, manually copy file over, reboot).
>   You can create such a file on another machine (with working random
>   number generator) via "rndctl -S $file".
>   After that reboot, all should be fine and the next rust build will
>   not block.
> 
> - If this is a virtual machine, add viornd(4) to your kernel (and hope the
>   hypervisor supports it)
> 
> There are variants of the first solution, like generating random bytes
> by some other means and write them to /dev/random.
> 
> Martin



Re: lang/rust build fails

2020-05-15 Thread Robert Nestor
Yes, and it appears to be different from what Chavdar has on his slightly 
earlier system.

Source Bits Type  Flags
/dev/random   0 ???  estimate, collect, v
ums0  0 tty  estimate, collect, v, t, dt
ukbd0 0 tty  estimate, collect, v, t, dt
cd0   0 disk estimate, collect, v, t, dt
wd2   0 disk estimate, collect, v, t, dt
wd1   0 disk estimate, collect, v, t, dt
wd0   0 disk estimate, collect, v, t, dt
cpu7  0 vm   estimate, collect, v, t, dv
cpu6  0 vm   estimate, collect, v, t, dv
cpu5  0 vm   estimate, collect, v, t, dv
cpu4  0 vm   estimate, collect, v, t, dv
cpu3  0 vm   estimate, collect, v, t, dv
cpu2  0 vm   estimate, collect, v, t, dv
cpu1  0 vm   estimate, collect, v, t, dv
cpu0  0 vm   estimate, collect, v, t, dv
coretemp3-cpu30 env  estimate, collect, v, t, dv, dt
coretemp2-cpu20 env  estimate, collect, v, t, dv, dt
coretemp1-cpu10 env  estimate, collect, v, t, dv, dt
coretemp0-cpu00 env  estimate, collect, v, t, dv, dt
wm0   0 net  estimate, v, t, dt
system-power  0 power estimate, collect, v, t, dt
autoconf  0 ???  estimate, collect, t
seed  0 ???  estimate, collect, v

-bob

On May 14, 2020, at 11:47 PM, Martin Husemann  wrote:

> Can you show output (as root) of rndctl -l please?
> 
> Martin



Re: lang/rust build fails

2020-05-15 Thread Martin Husemann
On Fri, May 15, 2020 at 06:27:41AM -0500, Robert Nestor wrote:
> Yes, and it appears to be different from what Chavdar has on his slightly 
> earlier system.
> seed  0 ???  estimate, collect, v

Bingo!

You do not have a hardware random number generator, and your setup did not
provide initial entropy.

There is an ongoing thread on some other list where this currently is
discussed with lots of technical details and irritation, but the short
story is:

 - Easiest fix for now is to provide a properly seeded /var/db/entropy-file
   (shutdown to single user, manually copy file over, reboot).
   You can create such a file on another machine (with working random
   number generator) via "rndctl -S $file".
   After that reboot, all should be fine and the next rust build will
   not block.

 - If this is a virtual machine, add viornd(4) to your kernel (and hope the
   hypervisor supports it)

There are variants of the first solution, like generating random bytes
by some other means and write them to /dev/random.

Martin


Re: lang/rust build fails

2020-05-15 Thread Mike Pumford




On 14/05/2020 17:53, Robert Nestor wrote:


running: /pkg_comp/work/pkg/lang/rust/work/rust-bootstrap/bin/cargo build 
--manifest-path 
/pkg_comp/work/pkg/lang/rust/work/rustc-1.42.0-src/src/bootstrap/Cargo.toml 
--frozen
Compiling proc-macro2 v0.4.30

At that point there’s nothing consuming CPU time in the build and everything 
seems to be waiting on something to happen that never does.  I’ve left the 
system in that state for about 24 hours and still no progress.

Any  clues? Could this be something related to some of the recent kernel 
changes?
It might be but it also happens sometimes on 9.0-stable as well. Never 
managed to work out why.


Mike


Re: lang/rust build fails

2020-05-15 Thread Martin Husemann
On Fri, May 15, 2020 at 09:15:20AM +0100, Chavdar Ivanov wrote:
> Sure, here it is.

Heh, sorry- I meant Robert.

> rdrand  512 rng  estimate, collect, v

I wanted to know if a line with "rng" is in his output (just a wild guess).

Martin


Re: lang/rust build fails

2020-05-15 Thread Chavdar Ivanov
Sure, here it is.

# rndctl -l
Source Bits Type  Flags
/dev/random   0 ???  estimate, collect, v
ukbd0 0 tty  estimate, collect, v, t, dt
wd2   0 disk estimate, collect, v, t, dt
wd1   0 disk estimate, collect, v, t, dt
wd0   0 disk estimate, collect, v, t, dt
acpibat0-discha   0 power estimate, collect, v, t, dv, dt
acpibat0-charge   0 power estimate, collect, v, t, dv, dt
acpibat1-discha   0 power estimate, collect, v, t, dv, dt
acpibat1-charge   0 power estimate, collect, v, t, dv, dt
cpu7  0 vm   estimate, collect, v, t, dv
cpu6  0 vm   estimate, collect, v, t, dv
cpu5  0 vm   estimate, collect, v, t, dv
cpu4  0 vm   estimate, collect, v, t, dv
cpu3  0 vm   estimate, collect, v, t, dv
cpu2  0 vm   estimate, collect, v, t, dv
cpu1  0 vm   estimate, collect, v, t, dv
cpu0  0 vm   estimate, collect, v, t, dv
coretemp3-cpu60 env  estimate, collect, v, t, dv, dt
coretemp2-cpu40 env  estimate, collect, v, t, dv, dt
coretemp1-cpu20 env  estimate, collect, v, t, dv, dt
coretemp0-cpu00 env  estimate, collect, v, t, dv, dt
wm0   0 net  estimate, v, t, dt
pms0  0 tty  estimate, collect, v, t, dt
pckbd00 tty  estimate, collect, v, t, dt
acpitz7-tempera   0 env  estimate, collect, v, t, dv, dt
acpitz6-tempera   0 env  estimate, collect, v, t, dv, dt
acpitz5-tempera   0 env  estimate, collect, v, t, dv, dt
acpitz4-cpu0-te   0 env  estimate, collect, v, t, dv, dt
acpitz3-tempera   0 env  estimate, collect, v, t, dv, dt
acpitz2-tempera   0 env  estimate, collect, v, t, dv, dt
acpitz1-cpu0-te   0 env  estimate, collect, v, t, dv, dt
acpitz0-tempera   0 env  estimate, collect, v, t, dv, dt
system-power  0 power estimate, collect, v, t, dt
autoconf  0 ???  estimate, collect, t
seed256 ???  estimate, collect, v
rdrand  512 rng  estimate, collect, v

On Fri, 15 May 2020 at 05:47, Martin Husemann  wrote:
>
> Can you show output (as root) of rndctl -l please?
>
> Martin



-- 



Re: lang/rust build fails

2020-05-14 Thread Martin Husemann
Can you show output (as root) of rndctl -l please?

Martin


Re: lang/rust build fails

2020-05-14 Thread Chavdar Ivanov
On Thu, 14 May 2020 at 19:09, Robert Nestor  wrote:
>
> Ran into an interesting problem trying to build lang/rust from both -current 
> and 2020Q1 pkgsrc.  On a NetBSD installation of 9.99.45 kernel and user land, 
> the builds succeed.  Under 9.99.60 kernel and user land the builds fail.

# ls -l /usr/pkg/bin/rustc
-rwxr-xr-x  1 root  wheel  13728 May  7 16:08 /usr/pkg/bin/rustc
# file /usr/pkg/bin/rustc
/usr/pkg/bin/rustc: ELF 64-bit LSB shared object, x86-64, version 1
(SYSV), dynamically linked, interpreter /usr/libexec/ld.elf_so, for
NetB
SD 9.99.60, not stripped
# rustc --version
rustc 1.42.0

So I've built it a week ago under 9.99.60.

>
> The failure doesn’t give much of a clue about what’s happened.  The last 
> lines in the build.log are:
>
> running: /pkg_comp/work/pkg/lang/rust/work/rust-bootstrap/bin/cargo build 
> --manifest-path 
> /pkg_comp/work/pkg/lang/rust/work/rustc-1.42.0-src/src/bootstrap/Cargo.toml 
> --frozen
>Compiling proc-macro2 v0.4.30
>
> At that point there’s nothing consuming CPU time in the build and everything 
> seems to be waiting on something to happen that never does.  I’ve left the 
> system in that state for about 24 hours and still no progress.
>
> Any  clues? Could this be something related to some of the recent kernel 
> changes?
> Thanks,
> -bob



-- 



lang/rust build fails

2020-05-14 Thread Robert Nestor
Ran into an interesting problem trying to build lang/rust from both -current 
and 2020Q1 pkgsrc.  On a NetBSD installation of 9.99.45 kernel and user land, 
the builds succeed.  Under 9.99.60 kernel and user land the builds fail.

The failure doesn’t give much of a clue about what’s happened.  The last lines 
in the build.log are:

running: /pkg_comp/work/pkg/lang/rust/work/rust-bootstrap/bin/cargo build 
--manifest-path 
/pkg_comp/work/pkg/lang/rust/work/rustc-1.42.0-src/src/bootstrap/Cargo.toml 
--frozen
   Compiling proc-macro2 v0.4.30

At that point there’s nothing consuming CPU time in the build and everything 
seems to be waiting on something to happen that never does.  I’ve left the 
system in that state for about 24 hours and still no progress.

Any  clues? Could this be something related to some of the recent kernel 
changes?
Thanks,
-bob