# Windows native build with ASan - Claude AI notes: ASan found a heap-use-after-free bug

**URL:** <https://swi-prolog.discourse.group/t/windows-native-build-with-asan-claude-ai-notes-asan-found-a-heap-use-after-free-bug/9500>\
**Category:** Help!\
**Created:** [January 29, 2026, 9:31am UTC](https://swi-prolog.discourse.group/t/windows-native-build-with-asan-claude-ai-notes-asan-found-a-heap-use-after-free-bug/9500 "2026-01-29T09:31:31Z")\
**Posts on this page:** 2\
**Page:** 4

<div class="post-metadata">

**Author:** ![jan](https://yyz2.discourse-cdn.com/free1/user_avatar/swi-prolog.discourse.group/jan/32/4_2.png) [@jan](https://swi-prolog.discourse.group/u/jan)\
**Post date:** [February 8, 2026, 3:25pm UTC](https://swi-prolog.discourse.group/t/windows-native-build-with-asan-claude-ai-notes-asan-found-a-heap-use-after-free-bug/9500/61 "2026-02-08T15:25:54Z")

</div>

> [@EricGT](#):
>
> The instructions for a Release version

But, I do not see `/EHsc` here. It may pass in Release build, but I think that is just luck. I’ll try to add that to the CMake setup.

---

<div class="post-metadata">

**Author:** ![EricGT](https://avatars.discourse-cdn.com/v4/letter/e/f1d935/32.png) [@EricGT](https://swi-prolog.discourse.group/u/EricGT)\
**Post date:** [February 9, 2026, 9:59am UTC](https://swi-prolog.discourse.group/t/windows-native-build-with-asan-claude-ai-notes-asan-found-a-heap-use-after-free-bug/9500/62 "2026-02-09T09:59:39Z")

</div>

FYI

Note: This could not have been accomplished without the help of Jan W.

Using commit

> <https://github.com/SWI-Prolog/swipl-devel/commit/fd522f14bbe1d64a2aaed64e6649e0544f4b2904>
>
> Thanks to Eric Tauber.

was able to build a Release version of SWI-Prolog on Windows 11 using CMake, MSVC and vcpkg.

```prolog
cmake .. -G "Visual Studio 18 2026" -A x64 -DCMAKE_TOOLCHAIN_FILE=C:/dev/vcpkg/scripts/buildsystems/vcpkg.cmake -DPython_EXECUTABLE="C:/Users/Eric/AppData/Local/Programs/Python/Python313/python.exe" -DBDB_LIBRARY=C:/dev/vcpkg/installed/x64-windows/lib/libdb48.lib 
cmake --build . --config Release
ctest -C Release --output-on-failure --timeout 300

```

CMake: `0 Error(s)`  
Ctest : `100% tests passed, 0 tests failed out of 89`

[Previous page](https://swi-prolog.discourse.group/t/windows-native-build-with-asan-claude-ai-notes-asan-found-a-heap-use-after-free-bug/9500.md?page=3)
