The "uint32_t *versions, uint32_t num_versions" wrapper makes a list with the number of elements that SBModule::GetVersion said it returns, but if one of those elements is UINT32_MAX it aborts filling the list. If you then iterate over that returned list in Python, you will get a crash. This patch will fill all the elements GetVersion said it had.
This comes up if you have a library with a version 0.0.0. That returns the (to me) not very sensical result of 2 elements, the first of which is UINT32_MAX.
This patch is just to handle the crash that that result causes in Python. I asked on lldb-dev why GetVersion does this - maybe there is some good reason I don't know. But anyway, I want to treat that as a separate issue.
Would it be possible to generate this binary via yaml2obj (e.g. compile it manually, like you did above, and then yamlize it)? Then, if you avoid running the target and just load the module by creating the SBModule object directly from a ModuleSpec, you should get a test that is able to run on all platforms, and not just darwin.