usnistgov / SP800-90B_EntropyAssessment

The SP800-90B_EntropyAssessment C++package implements the min-entropy assessment methods included in Special Publication 800-90B.
195 stars 88 forks source link

Selftest failing #203

Closed Zalamar closed 1 year ago

Zalamar commented 1 year ago

From commit 196881abf391c4f33185895c665efdd2df1a5fab onwards I get the following error on all tests, I included one test here but it is the same output for all of them:

$ ./selftest
biased-random-bits.bin: free(): double free detected in tcache 2
./selftest: line 3: 20842 Aborted                 ../ea_non_iid -vv ${file} > ${bfile/bin/res}
biased-random-bits.res: No corresponding value for Literal Markov Estimate: P_{1,1}
biased-random-bits.res: No corresponding value for Literal Lag Prediction Estimate: P_global'
biased-random-bits.res: No corresponding value for Literal Collision Estimate: p
biased-random-bits.res: No corresponding value for Literal MultiMCW Prediction Estimate: P_global
biased-random-bits.res: No corresponding value for Literal Markov Estimate: min entropy
biased-random-bits.res: No corresponding value for Literal Compression Estimate: min entropy
biased-random-bits.res: No corresponding value for Literal Collision Estimate: min entropy
biased-random-bits.res: No corresponding value for Literal Lag Prediction Estimate: r
biased-random-bits.res: No corresponding value for Literal MultiMMC Prediction Estimate: P_global
biased-random-bits.res: No corresponding value for Literal LRS Estimate: p-hat
biased-random-bits.res: No corresponding value for Literal LRS Estimate: v
biased-random-bits.res: No corresponding value for Literal Compression Estimate: sigma-hat
biased-random-bits.res: No corresponding value for Literal Lag Prediction Estimate: min entropy
biased-random-bits.res: No corresponding value for Literal MultiMCW Prediction Estimate: N
biased-random-bits.res: No corresponding value for Literal t-Tuple Estimate: p-hat_max
biased-random-bits.res: No corresponding value for Literal LZ78Y Prediction Estimate: C
biased-random-bits.res: No corresponding value for Literal t-Tuple Estimate: min entropy
biased-random-bits.res: No corresponding value for Literal Lag Prediction Estimate: N
biased-random-bits.res: No corresponding value for Literal MultiMMC Prediction Estimate: min entropy
biased-random-bits.res: No corresponding value for Literal t-Tuple Estimate: t
biased-random-bits.res: No corresponding value for Literal LZ78Y Prediction Estimate: r
biased-random-bits.res: No corresponding value for Literal Markov Estimate: p-hat_max
biased-random-bits.res: No corresponding value for Literal Most Common Value Estimate: Mode count
biased-random-bits.res: No corresponding value for Literal Collision Estimate: X-bar
biased-random-bits.res: No corresponding value for Literal Collision Estimate: X-bar'
biased-random-bits.res: No corresponding value for Literal LZ78Y Prediction Estimate: P_global
biased-random-bits.res: No corresponding value for Literal LZ78Y Prediction Estimate: min entropy
biased-random-bits.res: No corresponding value for Literal LRS Estimate: min entropy
biased-random-bits.res: No corresponding value for Literal Compression Estimate: p
biased-random-bits.res: No corresponding value for Literal Collision Estimate: v
biased-random-bits.res: No corresponding value for Literal LRS Estimate: u
biased-random-bits.res: No corresponding value for Literal t-Tuple Estimate: p_u
biased-random-bits.res: No corresponding value for Literal LZ78Y Prediction Estimate: N
biased-random-bits.res: No corresponding value for Literal Compression Estimate: X-bar'
biased-random-bits.res: No corresponding value for Literal MultiMMC Prediction Estimate: P_global'
biased-random-bits.res: No corresponding value for Literal Markov Estimate: P_1
biased-random-bits.res: No corresponding value for Literal Markov Estimate: P_{0,1}
biased-random-bits.res: No corresponding value for Literal Lag Prediction Estimate: P_local
biased-random-bits.res: No corresponding value for Literal MultiMCW Prediction Estimate: C
biased-random-bits.res: No corresponding value for Literal Collision Estimate: Sum t_i
biased-random-bits.res: No corresponding value for Literal MultiMCW Prediction Estimate: r
biased-random-bits.res: No corresponding value for Literal Markov Estimate: P_0
biased-random-bits.res: No corresponding value for Literal MultiMCW Prediction Estimate: P_global'
biased-random-bits.res: No corresponding value for Literal Collision Estimate: sigma-hat
biased-random-bits.res: No corresponding value for Literal MultiMMC Prediction Estimate: r
biased-random-bits.res: No corresponding value for Literal MultiMCW Prediction Estimate: min entropy
biased-random-bits.res: No corresponding value for Literal Most Common Value Estimate: p-hat
biased-random-bits.res: No corresponding value for Literal Compression Estimate: X-bar
biased-random-bits.res: No corresponding value for Literal Lag Prediction Estimate: C
biased-random-bits.res: No corresponding value for Literal Markov Estimate: P_{1,0}
biased-random-bits.res: No corresponding value for Literal LZ78Y Prediction Estimate: P_global'
biased-random-bits.res: No corresponding value for Literal MultiMMC Prediction Estimate: C
biased-random-bits.res: No corresponding value for Literal Most Common Value Estimate: min entropy
biased-random-bits.res: No corresponding value for Literal Most Common Value Estimate: p_u
biased-random-bits.res: No corresponding value for Literal Lag Prediction Estimate: P_global
biased-random-bits.res: No corresponding value for Literal MultiMMC Prediction Estimate: N
biased-random-bits.res: No corresponding value for Literal LRS Estimate: p_u
biased-random-bits.res: No corresponding value for Literal Markov Estimate: P_{0,0}
Maximum delta: 0

The error is not present on 209c445d1486f20d60de9785cdb7400ac635c617

Zalamar commented 1 year ago

To get to this point #202 is required to compile

joshuaehill commented 1 year ago

This appears to be a more general failure than suggested here. The line

biased-random-bits.bin: free(): double free detected in tcache 2

suggests that the executable failed and didn't output much.

joshuaehill commented 1 year ago

There are a bunch of problems with the new sha256_file function. I'll put together a PR.