Segfault in `libgmp.so` in `show`

I’m getting the following segfault.

               _
   _       _ _(_)_     |  A fresh approach to technical computing
  (_)     | (_) (_)    |  Documentation: https://docs.julialang.org
   _ _   _| |_  __ _   |  Type "?help" for help.
  | | | | | | |/ _` |  |
  | | |_| | | | (_| |  |  Version 0.6.1-pre.0 (2017-06-19 13:06 UTC)
 _/ |\__'_|_|_|\__'_|  |  Commit dcf39a1* (2 days old release-0.6)
|__/                   |  x86_64-linux-gnu

julia> using DiffEqProblemLibrary

julia> prob_ode_bigfloatlinear
DiffEqBase.ODEProblem with uType BigFloat and tType Float64. In-place: false
timespan: (0.0, 1.0)
u0: 
signal (11): Speicherzugriffsfehler
while loading no file, in expression starting on line 0
__gmpn_mul_basecase at /local_home/hendrik/julia06/usr/bin/../lib/libgmp.so (unknown line)
mpfr_get_str at /local_home/hendrik/julia06/deps/srccache/mpfr-3.1.5/src/get_str.c:2460
regular_eg at /local_home/hendrik/julia06/deps/srccache/mpfr-3.1.5/src/vasprintf.c:1082
partition_number at /local_home/hendrik/julia06/deps/srccache/mpfr-3.1.5/src/vasprintf.c:1640 [inlined]
sprnt_fp at /local_home/hendrik/julia06/deps/srccache/mpfr-3.1.5/src/vasprintf.c:1708 [inlined]
__gmpfr_vasprintf at /local_home/hendrik/julia06/deps/srccache/mpfr-3.1.5/src/vasprintf.c:2031
mpfr_snprintf at /local_home/hendrik/julia06/deps/srccache/mpfr-3.1.5/src/printf.c:169
string at ./mpfr.jl:895
show at ./mpfr.jl:907
show at /home/hendrik/.julia/v0.6/DiffEqBase/src/problems/problem_traits.jl:26
unknown function (ip: 0x7f9de80f7306)
jl_call_fptr_internal at /local_home/hendrik/julia06/src/julia_internal.h:339 [inlined]
jl_call_method_internal at /local_home/hendrik/julia06/src/julia_internal.h:358 [inlined]
jl_apply_generic at /local_home/hendrik/julia06/src/gf.c:1933
display at ./REPL.jl:122
unknown function (ip: 0x7f9de80f6dd6)
jl_call_fptr_internal at /local_home/hendrik/julia06/src/julia_internal.h:339 [inlined]
jl_call_method_internal at /local_home/hendrik/julia06/src/julia_internal.h:358 [inlined]
jl_apply_generic at /local_home/hendrik/julia06/src/gf.c:1933
display at ./REPL.jl:125
unknown function (ip: 0x7f9de80f6b16)
jl_call_fptr_internal at /local_home/hendrik/julia06/src/julia_internal.h:339 [inlined]
jl_call_method_internal at /local_home/hendrik/julia06/src/julia_internal.h:358 [inlined]
jl_apply_generic at /local_home/hendrik/julia06/src/gf.c:1933
display at ./multimedia.jl:194
hookless at /home/hendrik/.julia/v0.6/Media/src/compat.jl:14
render at /home/hendrik/.julia/v0.6/Media/src/compat.jl:27
unknown function (ip: 0x7f9de80f6666)
jl_call_fptr_internal at /local_home/hendrik/julia06/src/julia_internal.h:339 [inlined]
jl_call_method_internal at /local_home/hendrik/julia06/src/julia_internal.h:358 [inlined]
jl_apply_generic at /local_home/hendrik/julia06/src/gf.c:1933
display at /home/hendrik/.julia/v0.6/Media/src/compat.jl:9
unknown function (ip: 0x7f9de80f3e76)
jl_call_fptr_internal at /local_home/hendrik/julia06/src/julia_internal.h:339 [inlined]
jl_call_method_internal at /local_home/hendrik/julia06/src/julia_internal.h:358 [inlined]
jl_apply_generic at /local_home/hendrik/julia06/src/gf.c:1933
display at ./multimedia.jl:194
unknown function (ip: 0x7f9de80f3ce2)
jl_call_fptr_internal at /local_home/hendrik/julia06/src/julia_internal.h:339 [inlined]
jl_call_method_internal at /local_home/hendrik/julia06/src/julia_internal.h:358 [inlined]
jl_apply_generic at /local_home/hendrik/julia06/src/gf.c:1933
do_call at /local_home/hendrik/julia06/src/interpreter.c:75
eval at /local_home/hendrik/julia06/src/interpreter.c:242
eval_body at /local_home/hendrik/julia06/src/interpreter.c:539
jl_toplevel_eval_body at /local_home/hendrik/julia06/src/interpreter.c:511
jl_toplevel_eval_flex at /local_home/hendrik/julia06/src/toplevel.c:571 [inlined]
jl_toplevel_eval at /local_home/hendrik/julia06/src/toplevel.c:600
jl_toplevel_eval_in at /local_home/hendrik/julia06/src/builtins.c:496
eval at ./boot.jl:235
unknown function (ip: 0x7f9df785574f)
jl_call_fptr_internal at /local_home/hendrik/julia06/src/julia_internal.h:339 [inlined]
jl_call_method_internal at /local_home/hendrik/julia06/src/julia_internal.h:358 [inlined]
jl_apply_generic at /local_home/hendrik/julia06/src/gf.c:1933
print_response at ./REPL.jl:144
unknown function (ip: 0x7f9de80f32b8)
jl_call_fptr_internal at /local_home/hendrik/julia06/src/julia_internal.h:339 [inlined]
jl_call_method_internal at /local_home/hendrik/julia06/src/julia_internal.h:358 [inlined]
jl_apply_generic at /local_home/hendrik/julia06/src/gf.c:1933
print_response at ./REPL.jl:129
unknown function (ip: 0x7f9de80f2cc8)
jl_call_fptr_internal at /local_home/hendrik/julia06/src/julia_internal.h:339 [inlined]
jl_call_method_internal at /local_home/hendrik/julia06/src/julia_internal.h:358 [inlined]
jl_apply_generic at /local_home/hendrik/julia06/src/gf.c:1933
do_respond at ./REPL.jl:646
unknown function (ip: 0x7f9de80f1401)
jl_call_fptr_internal at /local_home/hendrik/julia06/src/julia_internal.h:339 [inlined]
jl_call_method_internal at /local_home/hendrik/julia06/src/julia_internal.h:358 [inlined]
jl_apply_generic at /local_home/hendrik/julia06/src/gf.c:1933
do_call at /local_home/hendrik/julia06/src/interpreter.c:75
eval at /local_home/hendrik/julia06/src/interpreter.c:242
eval_body at /local_home/hendrik/julia06/src/interpreter.c:539
jl_toplevel_eval_body at /local_home/hendrik/julia06/src/interpreter.c:511
jl_toplevel_eval_flex at /local_home/hendrik/julia06/src/toplevel.c:571 [inlined]
jl_toplevel_eval at /local_home/hendrik/julia06/src/toplevel.c:600
jl_toplevel_eval_in at /local_home/hendrik/julia06/src/builtins.c:496
eval at ./boot.jl:235
unknown function (ip: 0x7f9df785574f)
jl_call_fptr_internal at /local_home/hendrik/julia06/src/julia_internal.h:339 [inlined]
jl_call_method_internal at /local_home/hendrik/julia06/src/julia_internal.h:358 [inlined]
jl_apply_generic at /local_home/hendrik/julia06/src/gf.c:1933
run_interface at ./LineEdit.jl:1583
unknown function (ip: 0x7f9df78b9e2f)
jl_call_fptr_internal at /local_home/hendrik/julia06/src/julia_internal.h:339 [inlined]
jl_call_method_internal at /local_home/hendrik/julia06/src/julia_internal.h:358 [inlined]
jl_apply_generic at /local_home/hendrik/julia06/src/gf.c:1933
run_frontend at ./REPL.jl:945
run_repl at ./REPL.jl:180
unknown function (ip: 0x7f9de80de332)
jl_call_fptr_internal at /local_home/hendrik/julia06/src/julia_internal.h:339 [inlined]
jl_call_method_internal at /local_home/hendrik/julia06/src/julia_internal.h:358 [inlined]
jl_apply_generic at /local_home/hendrik/julia06/src/gf.c:1933
_start at ./client.jl:413
unknown function (ip: 0x7f9df7897bd8)
jl_call_fptr_internal at /local_home/hendrik/julia06/src/julia_internal.h:339 [inlined]
jl_call_method_internal at /local_home/hendrik/julia06/src/julia_internal.h:358 [inlined]
jl_apply_generic at /local_home/hendrik/julia06/src/gf.c:1933
jl_apply at /local_home/hendrik/julia06/ui/../src/julia.h:1424 [inlined]
true_main at /local_home/hendrik/julia06/ui/repl.c:127
main at /local_home/hendrik/julia06/ui/repl.c:264
__libc_start_main at /build/glibc-6V9RKT/glibc-2.19/csu/libc-start.c:287
unknown function (ip: 0x4015a9)
Allocations: 4694563 (Pool: 4692861; Big: 1702); GC: 7
Speicherzugriffsfehler

Is it already known or should I file an issue?

Commenting out __precompile__() at the top of DiffEqProblemLibrary.jl may fix for now. See:

https://github.com/JuliaLang/julia/issues/15722

Thanks a lot for your quick reply!

@ChrisRackauckas What do you think about this?

@ihnorton is spot on. Everything in JuliaDiffEq that has bigfloats is written in a special way to get around this. DiffEqProblemLibrary wasn’t compiled for a long time so I didn’t catch this, and I guess no library is using this exact problem in its tests (a few “recreate it”…).

The problem is that this line:

const linear_bigα = parse(BigFloat,"1.01")

is written in a special way (not big(1.01)) to try and get Julia to not inline the constant, because if it inlines the constant then it will fail by that issue. In v0.5 that trick worked. Now I’m going to have to find out a nice way to do this without mucking up the code…

But this shouldn’t effect user codes. Just use BigFloats as normal and as long as you’re not writing it in a precompiled module you don’t need to try your hardest to avoid precompiling pointers to them. This is just an issue because these example problems have BigFloats and are precompiled.

(@ihnorton do you know of a good way to handle this instance?)

I just wanted to run some tests of OrdinaryDiffEq by include("test/ode/ode_ssprk_tests.jl") and got this segfault. Everything is fine if the tests are called via Pkg.test("OrdinaryDiffEq").

I’m not sure, I tried your repro code on 0.6 and it doesn’t segfault (for me):

(the example here still crashes, understandably)