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

Stackoverflow segfault from reload #23126

Closed
quinnj opened this issue Aug 4, 2017 · 4 comments
Closed

Stackoverflow segfault from reload #23126

quinnj opened this issue Aug 4, 2017 · 4 comments

Comments

@quinnj
Copy link
Member

quinnj commented Aug 4, 2017

I made a package named Segfault.jl and put this in it:

module Segfault

struct Bar
    id::String
    Bar() = new()
    Bar(nm::String) = new(nm)
end

Bar(; kwargs...) = (b = Bar(); b.nm = kargs[1]; return b)

const DEFAULT_BAR = Bar()

end # module

Then calling reload("Segfault") from the repl resulted in a segfault. If the code is loaded interactively at the repl, an appropriate StackOverflowError is reported.

julia> versioninfo()
Julia Version 0.7.0-DEV.1172
Commit 88b3137b32* (2017-07-30 03:30 UTC)
Platform Info:
  OS: macOS (x86_64-apple-darwin16.7.0)
  CPU: Intel(R) Core(TM) i7-4870HQ CPU @ 2.50GHz
  WORD_SIZE: 64
  BLAS: libopenblas (USE64BITINT DYNAMIC_ARCH NO_AFFINITY Haswell)
  LAPACK: libopenblas64_
  LIBM: libopenlibm
  LLVM: libLLVM-3.9.1 (ORCJIT, haswell)
@musm
Copy link
Contributor

musm commented Aug 4, 2017

Even simpler

julia> g() = nothing
g (generic function with 1 method)

julia> g(;x=nothing) = (g(); nothing)
g (generic function with 1 method)

julia> g()
ERROR: StackOverflowError:

@tkelman
Copy link
Contributor

tkelman commented Aug 4, 2017

segfaulting instead of stack overflow on mac has been reported many times: #14284, #17109, #17280, #19285, #21072, #21258, #22853

I wonder if using llvm's unwinder on mac would be any more reliable here than our osxunwind fork.

@Roger-luo
Copy link
Contributor

Roger-luo commented Feb 17, 2019

Err, is #31096 the same with this one? @KristofferC

@musm 's example works fine on 1.1. no seg faults.

NVM, I got a Stackoverflow error on Ubuntu.

@KristofferC
Copy link
Member

It might not be the exact same thing, but crashing instead of stackoverflow on macOS is known (as the comment above shows, e.g. #17109).

Roger-luo added a commit to QuantumBFS/BitBasis.jl that referenced this issue Feb 17, 2019
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

6 participants