It seems that mandoc_reallocarray() (if it calls reallocarray(3))
have not realloc-ated!
Giving a look at the compiler warnings seem to shed some light!:
| mandoc_aux.c: In function 'mandoc_reallocarray':
| mandoc_aux.c:83:8: warning: implicit declaration of function 'reallocarray' [-Wimplicit-function-declaration]
| ptr = reallocarray(ptr, num, size);
| ^~~~~~~~~~~~
Whoops! This is why (IIRC) since NetBSD 8.0 programs that uses
reallocarray(3) needs to be compiled with -D_OPENBSD_SOURCE.
The attached patch seems to fix this problem and after running the
`test' target all tests are now passed.
Paul, can you please try it and let us know if it fixes the problem?