# gvLayout() causes crash Windows 2.44.1

**URL:** <https://forum.graphviz.org/t/gvlayout-causes-crash-windows-2-44-1/478>\
**Category:** Uncategorized\
**Created:** [December 22, 2020, 8:30pm UTC](https://forum.graphviz.org/t/gvlayout-causes-crash-windows-2-44-1/478 "2020-12-22T20:30:19Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![delltom](https://avatars.discourse-cdn.com/v4/letter/d/db5fbb/32.png) [@delltom](https://forum.graphviz.org/u/delltom)\
**Post date:** [December 22, 2020, 8:30pm UTC](https://forum.graphviz.org/t/gvlayout-causes-crash-windows-2-44-1/478/1 "2020-12-22T20:30:20Z")

</div>

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!

 ![image](https://global.discourse-cdn.com/graphviz/original/1X/ac4893eb7001a499f3aa0742d59c678bef1e1f22.png)

---

<div class="post-metadata">

**Author:** ![smattr](https://sea2.discourse-cdn.com/graphviz/user_avatar/forum.graphviz.org/smattr/32/85_2.png) [@smattr](https://forum.graphviz.org/u/smattr)\
**Post date:** [December 24, 2020, 4:26am UTC](https://forum.graphviz.org/t/gvlayout-causes-crash-windows-2-44-1/478/2 "2020-12-24T04:26:16Z")

</div>

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](https://gitlab.com/graphviz/graphviz/-/issues).

---

<div class="post-metadata">

**Author:** ![Vithanco](https://sea2.discourse-cdn.com/graphviz/user_avatar/forum.graphviz.org/vithanco/32/292_2.png) [@Vithanco](https://forum.graphviz.org/u/Vithanco)\
**Post date:** [December 26, 2020, 3:57pm UTC](https://forum.graphviz.org/t/gvlayout-causes-crash-windows-2-44-1/478/3 "2020-12-26T15:57:39Z")

</div>

I have seen the same issue under macOS Big Sur.

---

<div class="post-metadata">

**Author:** ![delltom](https://avatars.discourse-cdn.com/v4/letter/d/db5fbb/32.png) [@delltom](https://forum.graphviz.org/u/delltom)\
**Post date:** [December 28, 2020, 2:08pm UTC](https://forum.graphviz.org/t/gvlayout-causes-crash-windows-2-44-1/478/4 "2020-12-28T14:08:27Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![delltom](https://avatars.discourse-cdn.com/v4/letter/d/db5fbb/32.png) [@delltom](https://forum.graphviz.org/u/delltom)\
**Post date:** [December 28, 2020, 2:19pm UTC](https://forum.graphviz.org/t/gvlayout-causes-crash-windows-2-44-1/478/5 "2020-12-28T14:19:51Z")

</div>

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?

---

<div class="post-metadata">

**Author:** ![smattr](https://sea2.discourse-cdn.com/graphviz/user_avatar/forum.graphviz.org/smattr/32/85_2.png) [@smattr](https://forum.graphviz.org/u/smattr)\
**Post date:** [December 28, 2020, 3:19pm UTC](https://forum.graphviz.org/t/gvlayout-causes-crash-windows-2-44-1/478/6 "2020-12-28T15:19:24Z")

</div>

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?

> [@delltom](#):
>
> Is there a way to get my hands on the Windows installer for graphviz 2.38.0 and test against that?

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.

---

<div class="post-metadata">

**Author:** ![delltom](https://avatars.discourse-cdn.com/v4/letter/d/db5fbb/32.png) [@delltom](https://forum.graphviz.org/u/delltom)\
**Post date:** [December 28, 2020, 3:29pm UTC](https://forum.graphviz.org/t/gvlayout-causes-crash-windows-2-44-1/478/7 "2020-12-28T15:29:12Z")

</div>

I have uploaded my entire Qt project to drop box. Here is the link: [Dropbox - graphvizSample.zip - Simplify your life](https://www.dropbox.com/s/30132bfe5wh03z2/graphvizSample.zip?dl=0)

---

<div class="post-metadata">

**Author:** ![smattr](https://sea2.discourse-cdn.com/graphviz/user_avatar/forum.graphviz.org/smattr/32/85_2.png) [@smattr](https://forum.graphviz.org/u/smattr)\
**Post date:** [December 29, 2020, 2:34am UTC](https://forum.graphviz.org/t/gvlayout-causes-crash-windows-2-44-1/478/8 "2020-12-29T02:34:47Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![Vithanco](https://sea2.discourse-cdn.com/graphviz/user_avatar/forum.graphviz.org/vithanco/32/292_2.png) [@Vithanco](https://forum.graphviz.org/u/Vithanco)\
**Post date:** [December 29, 2020, 4:21pm UTC](https://forum.graphviz.org/t/gvlayout-causes-crash-windows-2-44-1/478/9 "2020-12-29T16:21:37Z")

</div>

Did you already apply workaround from:

> **[Null pointer dereference while calling gvLayout (gvc-\>textfont\_dt in...](https://gitlab.com/graphviz/graphviz/-/issues/1520)**
>
> Exception thrown at 0x1002AF71 (gvc.dll) in ProjectDependencyVisualizer.Desktop.exe: 0xC0000005: Access violation reading location 0x00000000. I'm happy to provide a .zip containing a complete repro...

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