Hello everyone,
I narrowed down the issue to a small example. Check out this repo which
causes the segfault in just a few lines.
<https://github.com/ChrisRackauckas/BigsSegfault.jl> An issue for it has
been posted on JuliaLang. <https://github.com/JuliaLang/julia/issues/18257>
On Saturday, August 20, 2016 at 9:57:28 AM UTC-7, Chris Rackauckas wrote:
>
> I was implementing a bunch of Runge-Kutta tableaus and ran into an issue.
> Specific tableaus which are defined inside of a function inside of
> DifferentialEquations.jl cause segfaults, but those exact same functions
> will not segfault when not inside the package. For example, the code (on
> master):
>
> using DifferentialEquations
> constructVern6()
>
> causes segfaults (the Windows and Linux versions at the bottom of the
> post) (tested on v0.5 and v0.6). However, I can take that same function:
>
> function constructVern6(T::Type = Float64)
> c1 =T(3//50)
> c2 =T(1439//15000)
> c3 =T(1439//10000)
> c4 =T(4973//10000)
> c5 =T(389//400)
> c6 =T(1999//2000)
> a21 =T(3//50)
> a31 =T(519479//27000000)
> a32 =T(2070721//27000000)
> a41 =T(1439//40000)
> a43 =T(4317//40000)
> a51 =T(109225017611//82828840000)
> a53 =T(-417627820623//82828840000)
> a54 =T(43699198143//10353605000)
> a61 =T(-8036815292643907349452552172369//191934985946683241245914401600)
> a63 =T(246134619571490020064824665//1543816496655405117602368)
> a64 =T(-13880495956885686234074067279//113663489566254201783474344)
> a65 =T(755005057777788994734129//136485922925633667082436)
> a71
>
> =T(-1663299841566102097180506666498880934230261//30558424506156170307020957791311384232000)
> a73
> =T(130838124195285491799043628811093033//631862949514135618861563657970240)
> a74
>
> =T(-3287100453856023634160618787153901962873//20724314915376755629135711026851409200)
> a75
> =T(2771826790140332140865242520369241//396438716042723436917079980147600)
> a76 =T(-1799166916139193//96743806114007800)
> a81
>
> =T(-832144750039369683895428386437986853923637763//15222974550069600748763651844667619945204887)
> a83
> =T(818622075710363565982285196611368750//3936576237903728151856072395343129)
> a84
>
> =T(-9818985165491658464841194581385463434793741875//61642597962658994069869370923196463581866011)
> a85
>
> =T(31796692141848558720425711042548134769375//4530254033500045975557858016006308628092)
> a86 =T(-14064542118843830075//766928748264306853644)
> a87 =T(-1424670304836288125//2782839104764768088217)
> a91 =T(382735282417//11129397249634)
> a94 =T(5535620703125000//21434089949505429)
> a95 =T(13867056347656250//32943296570459319)
> a96 =T(626271188750//142160006043)
> a97 =T(-51160788125000//289890548217)
> a98 =T(163193540017//946795234)
> b1 =T(124310637869885675646798613//2890072468789466426596827670)
> b4 =T(265863151737164990361330921875//1113197271463372303940319369579)
> b5 =T(3075493557174030806536302953125//6843749922042323876546949699876)
> b6 =T(67798000008733879813263055//29532792147666737550036372)
> b7 =T(-1099436585155390846238326375//15055706496446408859196167)
> b8 =T(26171252653086373181571802//368794478890732346033505)
> b9 =T(1//30)
>
> return
> c1,c2,c3,c4,c5,c6,a21,a31,a32,a41,a43,a51,a53,a54,a61,a63,a64,a65,a71,a73,a74,a75,a76,a81,a83,a84,a85,a86,a87,a91,a94,a95,a96,a97,a98,b1,b4,b5,b6,b7,b8,b9
> end
>
> put it in a script, run it, and call the function without segfaulting. I
> can even put that in a module without segfaulting!
>
> I have been able to pin down the issue to be due to methods which look
> like this and include items that would be parsed as Rational{BigInt}. Any
> tableaus which are parsed to BigFloats or Rational{Int} don't have this
> issue. So it has something to do with the giant rationals (I have a few
> more examples if needed). @Ismael-VC noted that when he deleted his lib and
> v0.6 folders and re-installed, the error went away for him (that did not
> work for me). Thus I am thinking it may have to do with precompilation?
> Note that my precompiling hinting file does not hint these functions since
> they are brand new.
>
> I will likely file an issue on the julialang issue if I can pinpoint the
> example to something which doesn't require installing
> DifferentialEquations.jl (because it is a large package). However, as I
> previously noted, I cannot re-create this outside of the package for some
> reason! Any help would be great!
>
> P.S. For those that are curious, DifferentialEquations.jl does contain
> over 100 ODE solver algorithms now
> <http://chrisrackauckas.github.io/DifferentialEquations.jl/latest/solvers/ode_solve/>,
>
> with each having convergence tests (except for the handful with this
> segfault problem)!
>
> -------------------------------------------------------------------------
>
> Linux Segfault Message:
>
> signal (11): Segmentation fault
> while loading console, in expression starting on line 1
> gcd at ./gmp.jl:256 [inlined]
> Type at ./rational.jl:9
> constructVern6 at
> /home/crackauc/.julia/v0.5/DifferentialEquations/src/ode/ode_tableaus.jl:1604
> constructVern6 at
> /home/crackauc/.julia/v0.5/DifferentialEquations/src/ode/ode_tableaus.jl:1586
> #99 at /home/crackauc/.julia/v0.5/Atom/src/eval.jl:39
> withpath at /home/crackauc/.julia/v0.5/Requires/src/require.jl:37
> withpath at /home/crackauc/.julia/v0.5/Atom/src/eval.jl:45
> macro expansion at /home/crackauc/.julia/v0.5/Atom/src/eval.jl:107
> [inlined]
> #98 at ./task.jl:54
> unknown function (ip: 0xffffffffffffffff)
> Allocations: 36331487 (Pool: 36324167; Big: 7320); GC: 38
>
> Windows Segfault Message:
>
> Please submit a bug report with steps to reproduce this fault, and any
> error messages that follow (in their entirety). Thanks.
> Exception: EXCEPTION_ACCESS_VIOLATION at 0xcbd6e8 -- while loading
> console, in expression starting on line 1
> gcd at .\gmp.jl:256 [inlined]
> Type at .\rational.jl:9
> constructVern6 at
> C:\Users\Chris\.julia\v0.6\DifferentialEquations\src\ode\ode_tableaus.jl:1604
> constructVern6 at
> C:\Users\Chris\.julia\v0.6\DifferentialEquations\src\ode\ode_tableaus.jl:1586
> jl_call_method_internal at
> /home/Administrator/buildbot/slave/package_win6_2-x64/build/src/home/Administrator/buildbot/slave/package_win6_2-x64/build/src\julia_internal.h:192
>
> [inlined]
> jl_apply_generic at
> /home/Administrator/buildbot/slave/package_win6_2-x64/build/src/home/Administrator/buildbot/slave/package_win6_2-x64/build/src\gf.c:1930
> do_call at
> /home/Administrator/buildbot/slave/package_win6_2-x64/build/src/home/Administrator/buildbot/slave/package_win6_2-x64/build/src\interpreter.c:66
> eval at
> /home/Administrator/buildbot/slave/package_win6_2-x64/build/src/home/Administrator/buildbot/slave/package_win6_2-x64/build/src\interpreter.c:190
> jl_toplevel_eval_flex at
> /home/Administrator/buildbot/slave/package_win6_2-x64/build/src/home/Administrator/buildbot/slave/package_win6_2-x64/build/src\toplevel.c:558
> jl_parse_eval_all at
> /home/Administrator/buildbot/slave/package_win6_2-x64/build/src/home/Administrator/buildbot/slave/package_win6_2-x64/build/src\ast.c:717
> include_string at .\loading.jl:380
> jl_call_method_internal at
> /home/Administrator/buildbot/slave/package_win6_2-x64/build/src/home/Administrator/buildbot/slave/package_win6_2-x64/build/src\julia_internal.h:192
>
> [inlined]
> jl_apply_generic at
> /home/Administrator/buildbot/slave/package_win6_2-x64/build/src/home/Administrator/buildbot/slave/package_win6_2-x64/build/src\gf.c:1930
> do_call at
> /home/Administrator/buildbot/slave/package_win6_2-x64/build/src/home/Administrator/buildbot/slave/package_win6_2-x64/build/src\interpreter.c:66
> eval at
> /home/Administrator/buildbot/slave/package_win6_2-x64/build/src/home/Administrator/buildbot/slave/package_win6_2-x64/build/src\interpreter.c:190
> eval_body at
> /home/Administrator/buildbot/slave/package_win6_2-x64/build/src/home/Administrator/buildbot/slave/package_win6_2-x64/build/src\interpreter.c:469
> jl_interpret_call at
> /home/Administrator/buildbot/slave/package_win6_2-x64/build/src/home/Administrator/buildbot/slave/package_win6_2-x64/build/src\interpreter.c:573
> jl_toplevel_eval_flex at
> /home/Administrator/buildbot/slave/package_win6_2-x64/build/src/home/Administrator/buildbot/slave/package_win6_2-x64/build/src\toplevel.c:572
>
> [inlined]
> jl_toplevel_eval at
> /home/Administrator/buildbot/slave/package_win6_2-x64/build/src/home/Administrator/buildbot/slave/package_win6_2-x64/build/src\toplevel.c:580
> jl_toplevel_eval_in_warn at
> /home/Administrator/buildbot/slave/package_win6_2-x64/build/src/home/Administrator/buildbot/slave/package_win6_2-x64/build/src\builtins.c:576
> eval at .\boot.jl:234
> jl_call_method_internal at
> /home/Administrator/buildbot/slave/package_win6_2-x64/build/src/home/Administrator/buildbot/slave/package_win6_2-x64/build/src\julia_internal.h:192
>
> [inlined]
> jl_apply_generic at
> /home/Administrator/buildbot/slave/package_win6_2-x64/build/src/home/Administrator/buildbot/slave/package_win6_2-x64/build/src\gf.c:1930
> #99 at C:\Users\Chris\.julia\v0.6\Atom\src\eval.jl:39
> withpath at C:\Users\Chris\.julia\v0.6\Requires\src\require.jl:37
> jl_call_method_internal at
> /home/Administrator/buildbot/slave/package_win6_2-x64/build/src/home/Administrator/buildbot/slave/package_win6_2-x64/build/src\julia_internal.h:192
>
> [inlined]
> jl_apply_generic at
> /home/Administrator/buildbot/slave/package_win6_2-x64/build/src/home/Administrator/buildbot/slave/package_win6_2-x64/build/src\gf.c:1930
> withpath at C:\Users\Chris\.julia\v0.6\Atom\src\eval.jl:45
> macro expansion at C:\Users\Chris\.julia\v0.6\Atom\src\eval.jl:107
> [inlined]
> #98 at .\task.jl:54
> jl_call_method_internal at
> /home/Administrator/buildbot/slave/package_win6_2-x64/build/src/home/Administrator/buildbot/slave/package_win6_2-x64/build/src\julia_internal.h:192
>
> [inlined]
> jl_apply_generic at
> /home/Administrator/buildbot/slave/package_win6_2-x64/build/src/home/Administrator/buildbot/slave/package_win6_2-x64/build/src\gf.c:1930
> jl_apply at
> /home/Administrator/buildbot/slave/package_win6_2-x64/build/src/home/Administrator/buildbot/slave/package_win6_2-x64/build/src\julia.h:1392
>
> [inlined]
> start_task at
> /home/Administrator/buildbot/slave/package_win6_2-x64/build/src/home/Administrator/buildbot/slave/package_win6_2-x64/build/src\task.c:253
> Allocations: 40695853 (Pool: 40684045; Big: 11808); GC: 53
>
>
>
>
>