View Issue Details

IDProjectCategoryView StatusLast Update
0007021GNUnetNSE servicepublic2021-09-22 11:40
Reportermd Assigned ToChristian Grothoff  
Status resolvedResolutionfixed 
PlatformGNU/LinuxOSGuix SystemOS Versionv???
Product Version0.13.0 
Summary0007021: NSE service sometimes returns stddev=NaN
DescriptionThe NSE service sometimes sends estimates wih stddev=NaN. This might or might not be a bug. However, this contradicts the statements in setup_estimate_message, that imply the stddev is a finite positive number (or zero) or positive infinity.

  if (variance >= 0)
    std_dev = sqrt (variance);
    std_dev = variance; /* must be infinity due to estimate_count == 0 */

As infinity >= 0, this doesn't seem correct. Maybe the comment should be changed to /* must be NaN due to estimate_count == 0 */?
Steps To ReproduceThis was detected on an offline peer. Possibly you need to delete ~/.local/share/gnunet/nse/proof.dat (not sure). Not 100% reproducible: I only observed this after the Scheme-GNUnet release. To observe this, run gnunet-nse, or run the "examples/nse-web.scm" script in Scheme-GNUnet and notice the "Scheme-GNUnet: an ill-formed message of type 323 was received’ messages.
TagsNo tags attached.



2021-09-20 12:06

reporter   ~0018399

Oops it's detected on 0.13.1, not 0.13.0.

Christian Grothoff

2021-09-22 11:36

manager   ~0018403

Fix committed to master branch.

Christian Grothoff

2021-09-22 11:40

manager   ~0018404

Ah, interesting catch. The logic above did 0.0/0.0 which is indeed NaN, while the comment reasoning was X/0.0 is "always" INF for all non-negative X. Well, that was almost true ;-). I've debated this with myself, and I think NaN is actually better here. So we'll keep the result at NaN. I've updated the comment in Git Master.

Related Changesets

gnunet: master 7bf37b7e

2021-09-22 11:35:46

Christian Grothoff

Details Diff
NSE: return INF, not NaN (fixes 0007021) Affected Issues
mod - src/nse/gnunet-service-nse.c Diff File

Issue History

Date Modified Username Field Change
2021-09-20 12:03 md New Issue
2021-09-20 12:06 md Note Added: 0018399
2021-09-22 11:36 Christian Grothoff Changeset attached => gnunet master 7bf37b7e
2021-09-22 11:36 Christian Grothoff Note Added: 0018403
2021-09-22 11:36 Christian Grothoff Assigned To => Christian Grothoff
2021-09-22 11:36 Christian Grothoff Status new => resolved
2021-09-22 11:36 Christian Grothoff Resolution open => fixed
2021-09-22 11:40 Christian Grothoff Note Added: 0018404