I recently spent several days improving the OCaml FreeTDS C bindings for work, and I thought it might be useful to share the problems I ran into and how to solve them. I tried to order things so the most likely issues are listed first, but if you're trying to debug some C binding crashes, I recommend just reading the whole thing. This post will assume you're already familiar with the official documentation.