Possibly irrelevant aside: much as I love the theory of torsocks (and am in a former life a big fan of LD_PRELOAD) - I latterly have given up on it and swapped entirely to 'curl -x' and variations upon 'nc' to perform onion testing; I just got fed up with version incompatibilities between the libraries and the command line. Torsocks sadly very much feels like a second class citizen product with respect to the rest of the Tor ecosystem.

There's examples of what I do instead, in:

https://lists.torproject.org/pipermail/tor-onions/2018-September/000311.html

-a