JuliaInterop / Cxx.jl

The Julia C++ Interface
Other
757 stars 108 forks source link

RFC: Windows bugfixes #425

Open Gnimuc opened 5 years ago

Gnimuc commented 5 years ago

A majority of failure cases are caused by #409, still have no idea on how to fix that.

Now, a lot of everything works normally on Windows except exception handling.

gabrielfreire commented 5 years ago

This package is so powerful, thanks for putting the work, as a Windows User, i am sending you good energies so you can find a solution for those issues.

azurefx commented 5 years ago
(v1.2) pkg> st Cxx
    Status `C:\Users\Azure\.julia\environments\v1.2\Project.toml`
  [a0b5b9ef] Cxx v0.3.2 #gn-patch-crash (https://github.com/JuliaInterop/Cxx.jl)

julia> using Cxx

C++ > #include <string>
true

C++ > using namespace std
true

C++ > auto str="Hello"s
true

C++ > str
┌ Warning: The two argument form of `func_for_method_checked` is deprecated. Pass sparams in addition.
│   caller = get_llvmf_decl(::Type) at cxxstr.jl:105
└ @ Cxx.CxxCore C:\Users\Azure\.julia\packages\Cxx\nEJNc\src\cxxstr.jl:105

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 0x17919656 -- unknown function (ip: 0000000017919656)
in expression starting at REPL[2]:0
unknown function (ip: 0000000017919655)
unknown function (ip: 000000001791958A)
unknown function (ip: 00000000179194AD)
unknown function (ip: 000000001791940E)
unknown function (ip: 00000000179193CF)
macro expansion at C:\Users\Azure\.julia\packages\Cxx\nEJNc\src\cxxstr.jl:516 [inlined]
lambdacall at C:\Users\Azure\.julia\packages\Cxx\nEJNc\src\cxxstr.jl:516 [inlined]
#2 at .\none:2
unknown function (ip: 00000000179188FB)
unknown function (ip: 00000000179186E4)
unknown function (ip: 00000000179185EF)
macro expansion at C:\Users\Azure\.julia\packages\Cxx\nEJNc\src\cxxstr.jl:703 [inlined]
cxxstr_impl at C:\Users\Azure\.julia\packages\Cxx\nEJNc\src\cxxstr.jl:703 [inlined]
#s37#1 at C:\Users\Azure\.julia\packages\Cxx\nEJNc\src\show.jl:25 [inlined]
...
[lines deleted]
...
mainCRTStartup at /usr/src/debug/mingw64-x86_64-runtime-6.0.0-1/usr/src/debug/mingw64-x86_64-runtime-6.0.0-1/crt\crtexe.c:223
BaseThreadInitThunk at C:\WINDOWS\System32\KERNEL32.DLL (unknown line)
RtlUserThreadStart at C:\WINDOWS\SYSTEM32\ntdll.dll (unknown line)
Allocations: 16396429 (Pool: 16393521; Big: 2908); GC: 37

Julia v1.1 does not have depwarn but also crashes @Gnimuc any idea? 🌚

Gnimuc commented 5 years ago

looks like something wrong with the "show" method. there is no crash when adding a semicolon after str, not sure why this issue is Windows-only though.

C++ > str.c_str()
Ptr{UInt8} @0x0000000026230010

julia> icxx"str.c_str();" |> unsafe_string
"Hello"
MaximeBouton commented 4 years ago

Would this be worth merging even without the last fix?