# Line number info missing when Windows DLL gets EXCEPTION\_ACCESS\_VIOLATION

**URL:** <https://discourse.julialang.org/t/line-number-info-missing-when-windows-dll-gets-exception-access-violation/108353>\
**Category:** General Usage\
**Tags:** ccall, c, cxxwrap\
**Created:** [January 4, 2024, 5:58pm UTC](https://discourse.julialang.org/t/line-number-info-missing-when-windows-dll-gets-exception-access-violation/108353 "2024-01-04T17:58:56Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Kirby\_Zhang](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/kirby_zhang/32/36204_2.png) [@Kirby\_Zhang](https://discourse.julialang.org/u/Kirby_Zhang)\
**Post date:** [January 4, 2024, 5:58pm UTC](https://discourse.julialang.org/t/line-number-info-missing-when-windows-dll-gets-exception-access-violation/108353/1 "2024-01-04T17:58:56Z")

</div>

The DLL was compiled using MSVC toolchain with debug configuration. A .pdb file was generated alongside the .dll file. But it seems line number information is not being made available to Julia’s access violation handler:

```julia
Please submit a bug report with steps to reproduce this fault, and any error messages that follow (in their entirety). Thanks.
Exception: EXCEPTION_ACCESS_VIOLATION at 0x7fffc435ed0e -- testCPPClient at C:\Users\kirby\MyDrive\Documents\TWS_API\build\Debug\TestCppClientLib.dll (unknown line)
in expression starting at none:0
testCPPClient at C:\Users\kirby\MyDrive\Documents\TWS_API\build\Debug\TestCppClientLib.dll (unknown line)
testCPPClient at C:\Users\kirby\MyDrive\Documents\TWS_API\build\Debug\TestCppClientLib.dll (unknown line)
testCPPClient at C:\Users\kirby\MyDrive\Documents\TWS_API\build\Debug\TestCppClientLib.dll (unknown line)
testCPPClient at C:\Users\kirby\MyDrive\Documents\TWS_API\build\Debug\TestCppClientLib.dll (unknown line)
testCPPClient at C:\Users\kirby\MyDrive\Documents\TWS_API\build\Debug\TestCppClientLib.dll (unknown line)
testCPPClient at C:\Users\kirby\MyDrive\Documents\TWS_API\build\Debug\TestCppClientLib.dll (unknown line)
testCPPClient at C:\Users\kirby\MyDrive\Documents\TWS_API\build\Debug\TestCppClientLib.dll (unknown line)
reqHistoricalData at C:\Users\kirby\.julia\packages\CxxWrap\VnssN\src\CxxWrap.jl:624
unknown function (ip: 0000027df9f3910a)
send at c:\Users\kirby\MyDrive\Documents\fourthwave\pkg\TwsApi\src\eventqueue.jl:217
unknown function (ip: 0000027df9f38c36)
receive at c:\Users\kirby\MyDrive\Documents\fourthwave\pkg\TwsApi\src\eventqueue.jl:267
unknown function (ip: 0000027df9f32142)
#6 at c:\Users\kirby\MyDrive\Documents\fourthwave\pkg\TwsApi\src\eventqueue.jl:302
#627 at .\channels.jl:134
unknown function (ip: 0000027df9f279f3)
jl_apply at C:/workdir/src\julia.h:1879 [inlined]
start_task at C:/workdir/src\task.c:1092
Allocations: 8437371 (Pool: 8432131; Big: 5240); GC: 12

```

I see that other people who have used DLL’s do get line number info. I’m using Julia 1.9.2 and CxxWrap.jl. Any pointers on how to report the line numbers?

Thanks!

---

<div class="post-metadata">

**Author:** ![mkitti](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/mkitti/32/12459_2.png) [@mkitti](https://discourse.julialang.org/u/mkitti)\
**Post date:** [January 4, 2024, 6:25pm UTC](https://discourse.julialang.org/t/line-number-info-missing-when-windows-dll-gets-exception-access-violation/108353/2 "2024-01-04T18:25:37Z")

</div>

Have you tried compiling with MinGW? For Visual Studio see the following on how to set that up.

> **[Using MinGW and Cygwin with Visual C++ and Open Folder - C++ Team Blog](https://devblogs.microsoft.com/cppblog/using-mingw-and-cygwin-with-visual-cpp-and-open-folder/)**
>
> Building cross-platform C and C++ code is easier than ever with Visual Studio 15.3 Preview 4.  The latest preview improves support for alternative compilers and build environments such as MinGW and Cygwin.  MinGW (Minimalist GNU for...

Also you can try Clang:

> **[Clang/LLVM support in Visual Studio projects](https://learn.microsoft.com/en-us/cpp/build/clang-support-msbuild?view=msvc-170)**
>
> Learn more about: Clang/LLVM support in Visual Studio projects

---

<div class="post-metadata">

**Author:** ![Kirby\_Zhang](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/kirby_zhang/32/36204_2.png) [@Kirby\_Zhang](https://discourse.julialang.org/u/Kirby_Zhang)\
**Post date:** [January 4, 2024, 6:32pm UTC](https://discourse.julialang.org/t/line-number-info-missing-when-windows-dll-gets-exception-access-violation/108353/3 "2024-01-04T18:32:53Z")

</div>

Haven’t tried that yet. I do see some people have had their DLL’s with MinGW environment and they got the line numbers. I wonder if it’s a MSVC compiler flag that happened to go with the MinGW environment? Thanks for your tip.
