View Issue Details

IDProjectCategoryView StatusLast Update
0007021GNUnetNSE servicepublic2022-02-26 22:18
Reportermd Assigned ToChristian Grothoff Due Date
PrioritylowSeveritytweakReproducibilitysometimes
Status closedResolutionfixed 
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);
  else
    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.

Activities

md

2021-09-20 10:06

reporter   ~0018399

Oops it's detected on 0.13.1, not 0.13.0.

Christian Grothoff

2021-09-22 09:36

manager   ~0018403

Fix committed to master branch.

Christian Grothoff

2021-09-22 09: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.

Issue History

Date ModifiedUsernameFieldChange
2021-09-20 10:03mdNew Issue
2021-09-20 10:06mdNote Added: 0018399
2021-09-22 09:36Christian Grothoff
2021-09-22 09:36Christian GrothoffNote Added: 0018403
2021-09-22 09:36Christian GrothoffAssigned To => Christian Grothoff
2021-09-22 09:36Christian GrothoffStatusnew => resolved
2021-09-22 09:36Christian GrothoffResolutionopen => fixed
2021-09-22 09:40Christian GrothoffNote Added: 0018404
2022-02-26 22:18schanzenStatusresolved => closed