# How to get stack trace of vtkDebugLeaks infos on Windows

**URL:** https://discourse.vtk.org/t/how-to-get-stack-trace-of-vtkdebugleaks-infos-on-windows/12729
**Category:** Support
**Created:** [November 16, 2023, 9:15am UTC](https://discourse.vtk.org/t/how-to-get-stack-trace-of-vtkdebugleaks-infos-on-windows/12729 "2023-11-16T09:15:11Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![TangLung-cn](https://discourse.vtk.org/user_avatar/discourse.vtk.org/tanglung-cn/32/8020_2.png) [@TangLung-cn](https://discourse.vtk.org/u/TangLung-cn)
#### Post date: [November 16, 2023, 9:15am UTC](https://discourse.vtk.org/t/how-to-get-stack-trace-of-vtkdebugleaks-infos-on-windows/12729/1 "2023-11-16T09:15:11Z")

</div>

Hi  
Does anyone can tell me how to get the stack trace of vtkDebugLeaks infos on Windows. I use VTK8.1 in Qt project, I only can get the brief info of VTK leak info when the program exist. Thanks.

 ![image](https://discourse.vtk.org/uploads/default/original/2X/6/6541e27a94c758805d94023b65ffa48240b8571e.png)

---

<div class="post-metadata">

### Author: ![ben.boeckel](https://discourse.vtk.org/letter_avatar_proxy/v4/letter/b/ea5d25/32.png) [@ben.boeckel](https://discourse.vtk.org/u/ben.boeckel)
#### Post date: [November 17, 2023, 4:43am UTC](https://discourse.vtk.org/t/how-to-get-stack-trace-of-vtkdebugleaks-infos-on-windows/12729/2 "2023-11-17T04:43:11Z")

</div>

It looks like the `VTK_DEBUG_LEAKS_TRACE_CLASSES` environment variable should be set to a `,`-separated list of class names to track allocation locations for.

---

<div class="post-metadata">

### Author: ![TangLung-cn](https://discourse.vtk.org/user_avatar/discourse.vtk.org/tanglung-cn/32/8020_2.png) [@TangLung-cn](https://discourse.vtk.org/u/TangLung-cn)
#### Post date: [November 17, 2023, 6:03am UTC](https://discourse.vtk.org/t/how-to-get-stack-trace-of-vtkdebugleaks-infos-on-windows/12729/3 "2023-11-17T06:03:16Z")

</div>

Thank you for the advice, I had set the `VTK_DEBUG_LEAKS_TRACE_CLASSES` environment variable,but it doesn’t work. It seems that VTK8.1 do not support this method to get stack trace.  
I tried the VTK9.3.0 just now, It works！Is there any patch to let VTK8.1 work too?

---

<div class="post-metadata">

### Author: ![ben.boeckel](https://discourse.vtk.org/letter_avatar_proxy/v4/letter/b/ea5d25/32.png) [@ben.boeckel](https://discourse.vtk.org/u/ben.boeckel)
#### Post date: [November 17, 2023, 12:12pm UTC](https://discourse.vtk.org/t/how-to-get-stack-trace-of-vtkdebugleaks-infos-on-windows/12729/4 "2023-11-17T12:12:50Z")

</div>

You can try applying [commit 471cac6de3c8609738e97dfc0163fd3dee11fd3c](https://gitlab.kitware.com/vtk/vtk/-/commit/471cac6de3c8609738e97dfc0163fd3dee11fd3c). No idea how conflict-heavy it is.
