Sporadic R null pointer errors in tests
mccalluc opened this issue · comments
R tests failed with the following error, but no error when re-running. Tests should be deterministic.
══ Failed ══════════════════════════════════════════════════════════════════════
── 1. Error ('test-mod.R:8:34'): binary search ─────────────────────────────────
Error: Error in `make_chain_mt(rhs, lhs)`: [FFI] : null pointer: measurement1
Error: Error: Failures detected.
Execution halted
disabled backtrace
Backtrace:
▆
1. ├─opendp::binary_search_chain(...) at test-mod.R:8:5
2. │ ├─opendp (local) make_chain(...) at opendp/R/mod.R:507:3
3. │ │ └─opendp::then_laplace(t_sum, s) at test-mod.R:8:34
4. │ │ ├─opendp:::new_constructor_log(...) at opendp/R/measurements.R:1032:5
5. │ │ │ └─opendp::new_hashtab(...) at opendp/R/mod.R:431:3
6. │ │ └─opendp::new_hashtab(list("scale", "QO"), list(scale, .QO)) at opendp/R/mod.R:405:3
7. │ └─opendp::binary_search_param(...) at opendp/R/mod.R:405:3
8. │ └─opendp::binary_search(...) at opendp/R/mod.R:525:3
9. │ └─opendp (local) predicate(mid) at opendp/R/mod.R:584:5
10. │ └─make_chain(param)(d_in = d_in, d_out = d_out) at opendp/R/mod.R:526:5
11. │ └─opendp::measurement_check(ptr, d_in, d_out) at opendp/R/mod.R:155:9
12. │ └─opendp::measurement_input_distance_type(measurement) at opendp/R/core.R:54:5
13. │ ├─opendp:::new_constructor_log(...) at opendp/R/core.R:133:5
14. │ │ └─opendp::new_hashtab(...) at opendp/R/mod.R:431:3
15. │ └─opendp::new_hashtab(list("this"), list(this)) at opendp/R/mod.R:405:3
16. └─opendp::make_chain_mt(rhs, lhs) at opendp/R/mod.R:405:3
══ DONE ════════════════════════════════════════════════════════════════════════
Error: Process completed with exit code 1.
Another occurrence: (from this PR)
── 1. Error ('test-measurements.R:64:3'): test_gaussian_curve ──────────────────
Error: Error in `make_zCDP_to_approxDP(then_gaussian(input_space, 4))`: [FFI] : null pointer: measurement
disabled backtrace
https://github.com/opendp/opendp/actions/runs/9532168225/job/26274066401
And another: #1687 (comment)
── 1. Error ('test-measurements.R:64:3'): test_gaussian_curve ──────────────────
Error: Error in `make_zCDP_to_approxDP(then_gaussian(input_space, 4))`: [FFI] : null pointer: measurement
Error: Error: Failures detected.
Execution halted
disabled backtrace
Backtrace:
▆
1. └─opendp::make_zCDP_to_approxDP(then_gaussian(input_space, 4)) at test-measurements.R:64:3
Going back through the past week and collecting all the failures of this type:
- https://github.com/opendp/opendp/actions/runs/9588208826/job/26440087474
- https://github.com/opendp/opendp/actions/runs/9554951904/job/26346414035
- https://github.com/opendp/opendp/actions/runs/9531840741/job/26273331638
Though the initial report is coming from a different place, the last three are all the same. Possible that it's not actually that erratic? Would it help to run the test repeatedly, either locally or on CI to get more examples? Is there any more instrumentation we could add, right before the point of the error?
https://github.com/opendp/opendp/actions/runs/9941992793/job/27463056354?pr=1767
── 1. Error ('test-mod.R:6:32'): binary search ─────────────────────────────────
Error: Error in `measurement_input_distance_type(measurement)`: [FFI] : null pointer: this
Error: Error: Failures detected.
Execution halted
disabled backtrace
Backtrace:
▆
1. └─opendp::binary_search_chain(...) at test-mod.R:6:3
2. ├─opendp (local) make_chain(...) at opendp/R/mod.R:510:3
3. │ └─opendp::then_laplace(t_sum, s) at test-mod.R:6:32
4. │ ├─opendp:::new_constructor_log(...) at opendp/R/measurements.R:442:3
5. │ │ └─opendp::new_hashtab(...) at opendp/R/mod.R:434:3
6. │ └─opendp::new_hashtab(...) at opendp/R/mod.R:408:3
7. └─opendp::binary_search_param(...) at opendp/R/mod.R:408:3
8. └─opendp::binary_search(...) at opendp/R/mod.R:528:3
9. └─opendp (local) predicate(mid) at opendp/R/mod.R:587:5
10. └─make_chain(param)(d_in = d_in, d_out = d_out) at opendp/R/mod.R:529:5
11. └─opendp::measurement_check(ptr, d_in, d_out) at opendp/R/mod.R:155:9
12. └─opendp::measurement_input_distance_type(measurement) at opendp/R/core.R:53:3