gvLayout() causes crash Windows 2.44.1

I am running into an issue that only seems to occur on Windows. I have created a simple graph, with a single node and am trying to use graphviz to create the layout. I have loaded the dot_plugin as shown below:

#define IMPORTED_SYMBOL extern “C” __declspec(dllimport)
#define EXPORTED_SYMBOL extern “C” __declspec(dllexport)

// You must load the plugins explicitly
IMPORTED_SYMBOL gvplugin_library_t gvplugin_dot_layout_LTX_library;

QGVGvcPrivate::QGVGvcPrivate(GVC_t *context)
{
setContext(context);
}

void QGVGvcPrivate::setContext(GVC_t *context)
{
_context = context;
gvAddLibrary(_context, &gvplugin_dot_layout_LTX_library);
}

Interestingly though, I am seeing a crash when trying to execute the layout. It is worth noting that we do not have any issues when compiling and executing this code in linux. Any help would be greatly appreciated!

I think we might need some more context for what’s going on here. E.g. what source language is this? C++? How are you calling this code?

Also if you think this is a Graphviz bug, please feel free to open a Gitlab issue.

I have seen the same issue under macOS Big Sur.

I wanted to make sure that I am not making a silly mistake before reporting a bug. The source language is C++. I am calling into the graphviz libraries from a cross-compiled Qt project.

I’ve looked and looked, but older stable versions don’t seem to be available anymore. Is there a way to get my hands on the Windows installer for graphviz 2.38.0 and test against that?

It’s still not clear to me how you’re calling this code. Can you post something more like a full program? Or at least the code that calls into this?

You may be able to install an older version via Chocolatey. Otherwise you unfortunately need to build Graphviz from source from the 2.38.0 Git tag.

I have uploaded my entire Qt project to drop box. Here is the link: Dropbox - graphvizSample.zip - Simplify your life

Ah, so it’s getting invoked from some Qt context. This will probably need someone with Qt experience or a Windows machine, neither of which I have unfortunately.

Did you already apply workaround from:

It might be the same issue which would explain why it rings a bell.