Comments (14)
run rngd -f -d instead of running it via systemd while the system is up, then kill it with a SIGTERM from another terminal and send me the output of that
from rng-tools.
from rng-tools.
Ok description:
if I kill rngd before
jent_read_entropy time on cpu 0 is 1.265280712500e+01 sec
-> you have the first case
Initializing available sources
Initializing entropy source hwrng
Limiting thread count to 2 active cpus
JITTER starts 2 threads
JITTER thread on cpu 0 wakes up for refill
JITTER thread on cpu 1 wakes up for refill
Terminated
Instead if I wait after
Pool full at 4096, sleeping!
I got
Checking on done for thread 0
jent_read_entropy time on cpu 1 is 1.045238600000e+01 sec
Writing to pipe
DONE Writing to pipe with return -1
Error on pipe write: Bad file descriptor
jent_read_entropy time on cpu 0 is 3.505968987500e+01 sec
Writing to pipe
DONE Writing to pipe with return -1
Error on pipe write: Bad file descriptor
Closing thread 0
Checking on done for thread 1
Closing thread 1
but before the closing thread message is very slow
from rng-tools.
Also If I execute
rngd -d -l
Entropy sources that are available but disabled
1: TPM RNG Device (tpm)
and get stuck for a while
then it prints
Available and enabled entropy sources:
0: Hardware RNG Device (hwrng)
5: JITTER Entropy generator (jitter)
Checking on done for thread 0
but if I type
rngd -d -x jitter -l
is very fast
Disabling 5: JITTER Entropy generator (jitter)
Entropy sources that are available but disabled
1: TPM RNG Device (tpm)
5: JITTER Entropy generator (jitter)
Available and enabled entropy sources:
0: Hardware RNG Device (hwrng)
from rng-tools.
you don't have to disable jittier, thats where the problem is that we want to debug.
That said, I'm not sure how this is happening, on my system as soon as close the read side of the pipe, all the writers return immediately with the EBADF error, causing them to break out of their loop and exit.
Let me ask you, when you say "very slow" do you remember about how long it took to exit? Was it approximately 35 seconds?
from rng-tools.
time rngd -l
Entropy sources that are available but disabled
1: TPM RNG Device (tpm)
Available and enabled entropy sources:
0: Hardware RNG Device (hwrng)
5: JITTER Entropy generator (jitter)
Command terminated by signal 2
real 0m 12.59s
user 0m 21.41s
sys 0m 3.28s
time rngd -l -x jitter
Disabling 5: JITTER Entropy generator (jitter)
Entropy sources that are available but disabled
1: TPM RNG Device (tpm)
5: JITTER Entropy generator (jitter)
Available and enabled entropy sources:
0: Hardware RNG Device (hwrng)
Command exited with non-zero status 1
real 0m 0.00s
user 0m 0.00s
sys 0m 0.00s
from rng-tools.
ok, I think I know whats happening. if you look at
#67 (comment)
You'll see that the time spend generating entropy in the jitterentropy daemon is :
jent_read_entropy time on cpu 0 is 3.505968987500e+01 sec
Thats about 35 seconds, While sending pthread_kill(SIGINT) to the writer thread will make it break the loop if its blocked on a write, it won't cause it to return early from that generation function, meaning that you have to wait for some part of that 35 seconds to break out of the loop and exit. Thats not strictly speaking wrong, but it is a bit of an irritant. I might could try to square that up with some setjmp/longjump magic, but I'm not sure.
from rng-tools.
Ok my issue is that rngd get stuck on reboot
Now I have to look at another issue for now I disabled jitter and is working fine
I will try to add more printf and debug again (sadly is quite difficult to add gdb to this system :-( )
from rng-tools.
https://github.com/nhorman/rng-tools/tree/early-jitter-exit
I've created the new branch above, which uses sigsetjmp/siglongjump to effect an early return from jent_read_entropy, which should allow for earlier exiting from threads that are delayed by the gathering of entropy from the jitter library. Please build that branch and give it a try with jitterentropy enabled. If it works for you I'll merge it.
from rng-tools.
ping, any update?
from rng-tools.
Testing it now
from rng-tools.
no differences.
from rng-tools.
I will try to look at this next week (now I'm stuck with another issue).
if you want you can close it and I will reopen it with more debug information.
from rng-tools.
ok, saying no differences without additional information doesn't help. I'm going to add some debug information to this branch. I'll leave this open and when you have time, please run rngd with -d so debug information is recorded in the logs, and send that in.
from rng-tools.
Related Issues (20)
- Is rngd_rndr using correct rng_options index? HOT 2
- v6.15 build fails with jitterentropy 3.4 HOT 4
- rng-tools stopped to build with jitterentropy v3.4.0 HOT 16
- kernel handling of hwrng versus rngd HOT 3
- [6.14] rngd --list not showing full list and hangs HOT 31
- rngd and the LRNG HOT 14
- rngtestjitter.sh failures after recent changes HOT 23
- building without qrypt fails HOT 1
- Is it useful with kernel 5.18 (new rng blake2 output - entropy_avail always equal to 256)? HOT 1
- rngd fails with gcrypt library HOT 2
- 'rngd -l' | sources associated to an incorrect index HOT 1
- Add mention of kernel version when referring to it in documentation HOT 6
- External tool as entropy source for Jetson devices HOT 3
- Consider a new release for compatibility with jitterentropy-3.4 HOT 1
- Is it possible to add an option to capture the random data from the source to a file rather than adding it to the kernel entropy pool ? HOT 2
- 6.16: test suie runs forever HOT 2
- Change poolsize definition for recent Linux kernels? HOT 5
- Socket interface for hardware TRNGs HOT 7
- JITTER_OPT_TIMEOUT default value is too low HOT 4
- Coarse mixing of multiple entropy sources HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from rng-tools.