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

segfault after importing CSV and Images, PyPlot from a separate module #402

Open
MaxandreJ opened this issue Oct 18, 2018 · 6 comments
Open

Comments

@MaxandreJ
Copy link

Hi,

I get the following segfault

signal (11): Segmentation fault: 11
in expression starting at /MyProjectDirectory/Test.jl:4
_platform_strcmp at /usr/lib/system/libsystem_platform.dylib (unknown line)

when I run /MyProjectDirectory/Test.jl which contains the code

push!(LOAD_PATH, "/MyProjectDirectory")
import CSV
using MyModule

that uses /MyProjectDirectory/MyModule.jl which contains the code

module MyModule
using Images
import PyPlot
end

I don't know if this is an issue to do with CSV, Images, PyPlot or Julia itself. This is a minimal working example. I'm using Julia 1.0.1 on MacOS Mojave. The segfault goes away if I don't load any one of these three packages. There is still a segault if I start Julia with --check-bounds=yes.

I hope this can be resolved soon! Segfaults are frightening...

These are the versions of the packages in question + important dependencies

Images v0.16.0
PyCall v1.18.5+ #Master (https://github.com/JuliaPy/PyCall.jl.git)
PyPlot v2.6.3
CSV v0.4.1

I have also posted this issue on the Images.jl github and the CSV.jl github.

Best,
Max

@tkf
Copy link
Member

tkf commented Oct 19, 2018

I can't reproduce the issue:

$ cat MyModule.jl
module MyModule
using Images
import PyPlot
end

$ cat Test.jl
push!(LOAD_PATH, @__DIR__)
import CSV
using MyModule

$ julia-1.0.1 --startup-file=no
               _
   _       _ _(_)_     |  Documentation: https://docs.julialang.org
  (_)     | (_) (_)    |
   _ _   _| |_  __ _   |  Type "?" for help, "]?" for Pkg help.
  | | | | | | |/ _` |  |
  | | |_| | | | (_| |  |  Version 1.0.1 (2018-09-29)
 _/ |\__'_|_|_|\__'_|  |  Official https://julialang.org/ release
|__/                   |

julia> include("Test.jl")
[ Info: Recompiling stale cache file /home/takafumi/.julia/compiled/v1.0/CSV/HHBkp.ji for CSV [336ed68f-0bac-5ca0-87d4-7b16caf5d00b]
WARNING: Method definition intern(Type{WeakRefStrings.WeakRefString{UInt8}}, Tuple{Ptr{UInt8}, Int64}) in module Parsers at /home/takafumi/.julia/packages/Parsers/kL0P9/src/strings.jl:17 overwritten in module CSV at /home/takafumi/.julia/packages/CSV/uLyo0/src/CSV.jl:5.
[ Info: Recompiling stale cache file /home/takafumi/.julia/compiled/v1.0/MyModule.ji for MyModule [top-level]

julia> MyModule
MyModule

julia> CSV
CSV

(v1.0) pkg> st
    Status `~/.julia/environments/v1.0/Project.toml`
  ...
  [336ed68f] CSV v0.4.1
  [916415d5] Images v0.16.1
  [438e738f] PyCall v1.18.5+ [`~/.julia/dev/PyCall`]
  [d330b81b] PyPlot v2.6.3

FYI, There is a documentation on how to analyze segfaults:
https://docs.julialang.org/en/latest/devdocs/backtraces/#Segfaults-when-running-a-script-1

(But I just noticed that julia-debug is missing from Linux binary distribution. If it's not in your installation, you need to compile Julia from scratch, which is not so bad)

@MaxandreJ
Copy link
Author

Thanks for trying @tkf !
I tried to build julia from source but after an evening of trying and running into multiple errors (MacOS Mojave) I'm done. So I won't be able to give the segfault analysis.

@tkf
Copy link
Member

tkf commented Oct 20, 2018

Yeah, it looks like Mac users have some trouble building Julia now... JuliaLang/julia#29433

@tkf
Copy link
Member

tkf commented Oct 20, 2018

JuliaLang/julia#29734

@MaxandreJ
Copy link
Author

Too bad!

@johnnychen94
Copy link

FWIW, I no longer see this by trying #402 (comment) in Julia 1.6.0 with macOS BigSur

julia> versioninfo()
Julia Version 1.6.0
Commit f9720dc2eb (2021-03-24 12:55 UTC)
Platform Info:
  OS: macOS (x86_64-apple-darwin19.6.0)
  CPU: Intel(R) Core(TM) i9-9880H CPU @ 2.30GHz
  WORD_SIZE: 64
  LIBM: libopenlibm
  LLVM: libLLVM-11.0.1 (ORCJIT, skylake)

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

No branches or pull requests

3 participants