[plt-dev] MzCOM triggers error in salloc.c

From: Paul Steckler (steck at stecksoft.com)
Date: Sat May 22 22:12:26 EDT 2010

Erich Neuwirth had written to me that MzCOM from the latest PLT
release crashed for him, so I went off to investigate.  I hadn't run
MzCOM (or MysterX) in yonks (as they say here).

I compiled MzCOM from sources using Visual Studio 2008, no issues
there.  I couldn't get MysterX (libmysterx)
to compile, though.  The thought was to load MzCOM into MysterX, but
it looked like a tough slog to fix the
compilation errors.  So instead, I decided to write a little C++
driver to load MzCOM.

The driver compiled fine, but the Eval method in MzCOM just hung.  I
haven't yet looked into that.

Next, I tried call the About method.  Indeed, I saw the About box --
but then MzCOM crashed.

The crash is due to a write-to-NULL error around line 368 of salloc.c,
in this block:

  # elif defined(IMPLEMENT_THREAD_LOCAL_VIA_WIN_TLS)
    *scheme_get_thread_local_variables_ptr() = vars;

Here's the driver program:

#include "stdafx.h"
#include "mzcom.h"

int _tmain(int argc, _TCHAR* argv[])
{
	CLSID clsid;
	IMzObj *pIMzObj;

	CoInitialize(NULL);

	CLSIDFromProgID(L"MzCOM.MzObj.4.2.5.0",&clsid);
	CoCreateInstance(clsid,NULL,CLSCTX_SERVER,IID_IMzObj, (void **)&pIMzObj);

	pIMzObj->About();

	return 0;
}

It's a VS2008 project, and you need to add mzcom.h and mzcom_i.c from
the mzcom directory in
src/worksp.

Any ideas?

-- Paul


Posted on the dev mailing list.