Visions of Aestia

28 Apr 2005

The last 2 percent is the hardest

Filed under: PlanetRDF, Python — JBowtie @ 5:58 pm

I can almost run the Redland example.py all the way through, but there is something dreadfully wrong. Every single crash happens when freeing memory. I can get around it in the very short term by disabling the specific, crashing calls, but that’s not much comfort.

Obviously I am going to have to dig in and figure out exactly what is different about the allocation patterns on Windows. This is straight C code, so it shouldn’t be too hard. I don’t think I can release like this, though, it’s too flaky. Maybe there’s a bug causing memory corruption?

Or maybe Dave is sane in not programming on Windows anymore. [forced grin]

5 Responses to “The last 2 percent is the hardest”

  1. Suzan Foster Says:

    This sounds the same problem as nearly everybody has with redland running under windows. It’s most likely caused by memory allocated by one runtime and freed by another. I expect you have everything compiled as dll’s from the (converted) workspaces, which links with the multithreaded runtime (/MD). If any of the libraries that you use are linked to another runtime and let their memory be freed by libraries upstream you’ll get your crash. see http://winfx.msdn.microsoft.com/library/default.asp?url=/library/en-us/dv_vccomp/html/cf7ed652-dc3a-49b3-aab9-ad60e5395579.asp for more about the runtimes.

  2. JBowtie Says:

    Actually, I linked them all to the static mulitthreaded runtime(/MT), but that’s a fair point. I’ll need to check the settings of the linked upstream libraries (libxml et al.) and see if that fixes my problem.

  3. Suzan Foster Says:

    /MT and /MD won’t make much difference. /MD is synonimous with /MT /LD. To link to the static version you need to include /D_STATIC_CPPLIB.

  4. JBowtie Says:

    That’s what I thought. However, I switched everything to /MD and the crashes are gone!

    So I just need to solve the problems with raptor mangling the filename so I can run the test suite, and I’m done. Thanks so much; never would have thought to do that without your comment.

  5. Visions of Aestia » Success - Redland/Python on Windows! Says:

    […] it (and give the location in the comments) - my allocated bandwidth is meager. Thanks to this tip from Suzan Foster, I was able to get everythi […]

Leave a Reply

Powered by WordPress