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

Bigs cause segfaults when precompiled and inlined #18257

Closed
ChrisRackauckas opened this issue Aug 27, 2016 · 1 comment
Closed

Bigs cause segfaults when precompiled and inlined #18257

ChrisRackauckas opened this issue Aug 27, 2016 · 1 comment

Comments

@ChrisRackauckas
Copy link
Member

ChrisRackauckas commented Aug 27, 2016

I made a repo to show this problem. Here's a copy of the current README:

This is a Julia repository to share a segfaulting problem. It's pretty simple, to cause the segfault, just do

Pkg.clone("https://github.com/ChrisRackauckas/BigsSegfault.jl")
using BigsSegfault
f(1.0,2.0)

The problem looks like it comes from Bigs inlining in precompilation. The entire package is:

__precompile__() ## Required in order to segfault

module BigsSegfault
const α = parse(BigFloat,"1.01")
f = (t,u) ->*u)

function fmaker=1.0)
  f(t,u) = α*u
  return f
end
export f,α,fmaker
end # module

The reason I put this in a package is because the segfaults do not happen if precompilation is disabled, or if f is defined in a manner such that α does not inline [for example, using

function fmaker=1.0)
  f(t,u) = α*u
  return f
end

and then using the f developed from there will not segfault].

using BigsSegfault
f2 = fmaker()
f2(1.0,2.0) # No segfault

Note that this segfault also requires Juno to be restarted (not just killing the current process, but the window has to be closed and re-opened).

This segfault problem also happens with inlined Rational{BigInt}, generic functions, and more. For more examples, check out the tests which are commented out in DifferentialEquations.jl with the mention "Bigs problem". Another example of this issue can be found on julia-users.

@yuyichao
Copy link
Contributor

Dup of #15722

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

2 participants