JuliaInterop / Cxx.jl

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

segfault on Julia 1.3.0-rc4 #444

Closed goretkin closed 4 years ago

goretkin commented 4 years ago

using Cxx#master, and after turning off precompilation

julia> versioninfo()
Julia Version 1.3.0-rc4.1
Commit 8c4656b97a (2019-10-15 14:08 UTC)
Platform Info:
  OS: macOS (x86_64-apple-darwin18.6.0)
  CPU: Intel(R) Core(TM) i7-4960HQ CPU @ 2.60GHz
  WORD_SIZE: 64
  LIBM: libopenlibm
  LLVM: libLLVM-6.0.1 (ORCJIT, haswell)
Environment:
  JULIA_BASE_PATH = /Applications/Julia-1.3rc4.app/Contents/Resources/julia/share/julia/base
  JULIA_STDLIB_PATH = /Applications/Julia-1.3rc4.app/Contents/Resources/julia/share/julia/stdlib

julia> using Cxx
[ Info: Precompiling Cxx [a0b5b9ef-44b7-5148-a2d1-f6db19f3c3d2]
[ Info: Skipping precompilation since __precompile__(false). Importing Cxx [a0b5b9ef-44b7-5148-a2d1-f6db19f3c3d2].

signal (11): Segmentation fault: 11
in expression starting at /Users/goretkin/.julia/dev/Cxx/src/Cxx.jl:178
_ZN4llvm19SmallPtrSetImplBase14insert_imp_bigEPKv at /Applications/Julia-1.3rc4.app/Contents/Resources/julia/lib/julia/libLLVM.dylib (unknown line)
_ZN4llvm11LLVMContext9addModuleEPNS_6ModuleE at /Applications/Julia-1.3rc4.app/Contents/Resources/julia/lib/julia/libLLVM.dylib (unknown line)
_ZL17finish_clang_initP11CxxInstancebPKcml at /Users/goretkin/.julia/dev/Cxx/deps/usr/lib/libcxxffi.dylib (unknown line)
init_clang_instance at /Users/goretkin/.julia/dev/Cxx/deps/usr/lib/libcxxffi.dylib (unknown line)
#setup_instance#20 at /Users/goretkin/.julia/dev/Cxx/src/initialization.jl:39
#setup_instance at ./none:0 [inlined]
__init__ at /Users/goretkin/.julia/dev/Cxx/src/initialization.jl:430
Gnimuc commented 4 years ago

did you apply this patch?

goretkin commented 4 years ago

I think you might have linked to the wrong page (it links to this page). Happy to try any patch!

Gnimuc commented 4 years ago

Oops! It's #407. It looks like Github cannot handle this format: [this patch](#407).

goretkin commented 4 years ago

I took a guess and just tried it out, I still get a segfault. The stacktrace doesn't print reliably, and I didn't run gdb, but from some print statements I had, it looks like it's the same issue.

oschulz commented 4 years ago

I get segfaults on CentOS-7, too, with Julia v1.3-RC4.

Gnimuc commented 4 years ago

434 might also be needed.

Is there a way to check whether a git commit is included in certain release branch?

chrisvwx commented 4 years ago

I get what looks like the same segfault on Julia 1.3. Whenever I want to use Cxx, I'm switching back to 1.2

GlenHenshaw commented 4 years ago

Getting the same error. Also using Julia 1.3.0

GlenHenshaw commented 4 years ago

Oops! It's #407. It looks like Github cannot handle this format: [this patch](#407).

It's entirely possible that I'm simply dense, but I'm going to ask this anyway. How does one go about applying this patch? I can dev Cxx and get the source. I can build the source. But the link takes me to a Github page that describes the patch but nowhere can I find an actual .patch file.

goretkin commented 4 years ago

How does one go about applying this patch?

You can try git cherry-pick 3c081e564256d5db22d045d47cd269dac19bdb99

in the Cxx Julia package directory (probably ~/dev/Cxx)

The hash is of the one commit on that PR. You can see all the commits here: https://github.com/JuliaInterop/Cxx.jl/pull/407/commits

If you want to generate a .patch file, there's a command to do that, too. Something like git diff hash1 hash2 with some arguments, if I recall, does it. The two hashes are e.g. the hash of the commit and the hash of the parent commit. You can then apply this .patch. But I recommend cherry-pick.

GlenHenshaw commented 4 years ago

I applied both 407 and 434. Still getting the same error.

Gnimuc commented 4 years ago

Did you build Julia from the source? I've merged 407 and 434 into master and submitted PR #450 for a fix.

alhirzel commented 4 years ago

I have tested Cxx.jl#master with #450 applied (which also applies #407 and #434) and still get this error on Julia 1.3.0 (official binary downloaded from julialang.org).

Gnimuc commented 4 years ago

@alhirzel you need to build Julia from source for now.

alhirzel commented 4 years ago

Ok, thank you for the info. Is there a place I can read more about why a Julia source build is needed?

Gnimuc commented 4 years ago

https://github.com/JuliaInterop/Cxx.jl/issues/441#issuecomment-560990589

No worries, I upgraded the build environment to the latest BB2 and successfully built libcxxffi for x86_linux this morning. It will take a couple of days to build&test other platforms before I submit a PR.

MaximeBouton commented 4 years ago

Does this mean that the building julia from source won't be needed if BB build works?

Gnimuc commented 4 years ago

yes, just like Julia 1.1 and 1.2.

Gnimuc commented 4 years ago

Binary-build for Julia 1.3 is ready for a test.

(v1.3) pkg> add Cxx#master
alhirzel commented 4 years ago

Thank you!

goretkin commented 4 years ago

@Gnimuc, thanks for fixing this. Is it possible to summarize what changed between Julia 1.2 and Julia 1.3 that gave rise to this issue?