It is a dune diff action. The test binary writes to standard output, dune captures it in a file and diffs it with another file. If they are the same then the test passes. This is working for me locally with OCaml 4.14 stock version. But it’s failing in Opam-CI with the ‘no naked pointers’ check.
Thanks. It looks like the binary is dune itself so I guess I can scan it with the nnpchecker. Kinda surprising that dune would be messing with C pointers though. I’ll try later today.
According to the log, I think I don’t think the issue is in dune itself. It’s in dream_html_test.exe and dune is displaying the command that failed:
# (cd _build/default/test && ./dream_html_test.exe) > _build/default/test/got.html
# Out-of-heap pointer at 0x55dd1c32e210 of value 0x55dd1c1d2180 has non-black head (tag=65)
Thanks for the pointer (no pun intended). Although, that is puzzling because the test is just building an HTML data structure, converting it to a string, and printing it to standard output:
let node = ...
let () = node |> to_string |> print_endline
In fact, we can see that it ran successfully because we see the entire test HTML output in the logs:
<!DOCTYPE html>
<html ...>
...
</html>
Only after it successfully finishes printing, does it throw the out-of-heap pointer error. So, I am actually hesitant to conclude that the issue is even in my test executable. Will look into it further.
Carefully audit the results to see if any of those creates a naked pointer.
Here it seems that ocaml-ssl creates a naked pointer in the C function ocaml_ssl_get_current_cipher. This does not guarantee that it is the source of your issue though, maybe it is possible to cross-check with other clues at your disposal.
This method is not exhaustive of course, like the nnp checker detector, but so far it seems to prove successful in finding code that is incompatible with OCaml 5. Unlike the nnp detector, it is not limited to code paths that actually run nor by the whims of GC scheduling, and the (value) cast seems to be an invariant of some of the techniques that are now deprecated. It does require to understand the code in order to exclude valid uses of the (value) cast, though.
For the context, this method has proven useful in identifying many packages that use naked pointers. See the OCaml workshop 2022 paper which contains the most up-to-date discussion on the nnp issue. While some have been fixed for OCaml 5, it is likely that many of these have not yet been fixed, while still showing as green. Unfortunately for this issue, I had to stop when I ran out of time, because it proved more tedious and time-consuming than expected (e.g. compared to code audits I did in the past). But I thought the core developers who were working on fixing deprecations in opam packages might be interested in this approach.