Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

RFC: Windows bugfixes #425

Open
wants to merge 8 commits into
base: master
Choose a base branch
from
Open

RFC: Windows bugfixes #425

wants to merge 8 commits into from

Conversation

Gnimuc
Copy link
Member

@Gnimuc Gnimuc commented Jun 5, 2019

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.

  • fix a crash issue caused by function signature mismatch in specialize_template_clang
  • port dlsym(RTLD_DEFAULT, "julia_type_to_llvm") using dlfcn-win32
  • program used external function '_ZNK5clang10RecordDecl11field_beginEv' which could not be resolved!
  • program used external function __gxx_personality_v0 which could not be resolved!
  • Julia crashes on exception related tests (to remind myself: we need to reimplement this in Cxx)

@Gnimuc Gnimuc changed the title Fix a type mismatch bug in specialize_template_clang and enable tests on Windows WIP: Windows bugfixes Jun 5, 2019
@gabrielfreire
Copy link

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.

@Gnimuc Gnimuc changed the title WIP: Windows bugfixes RFC: Windows bugfixes Jul 5, 2019
@Gnimuc Gnimuc mentioned this pull request Jul 5, 2019
@Gnimuc Gnimuc requested review from Keno and ararslan July 5, 2019 02:34
@azurefx
Copy link

azurefx commented Jul 6, 2019

(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
Copy link
Member Author

Gnimuc commented Jul 6, 2019

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
Copy link

Would this be worth merging even without the last fix?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants