[Pkg-julia-devel] Bug#977193: julia REPL crashes on simple function

Zoltan Barta zbartab at gmail.com
Sat Dec 12 10:44:48 GMT 2020


Package: julia
Version: 1.5.3+dfsg-2+b2
Severity: important
X-Debbugs-Cc: zbartab at gmail.com

Dear Maintainer,

   * What led up to the situation?

When I am running these in the REPL there is no problem.

julia> include("good.jl")
probak (generic function with 2 methods)

julia> c,f = probak()
([[1, 2, 3]], [1.0954451150103321])

On the other hand, running these crashes julia:

julia> include("bad.jl")
probak (generic function with 2 methods)

julia> c,f = probak()

The only difference between good.jl and bad.jl is this line (both attached):
randn() < 0.0 && return [4,5,6], 1.233
vs
randn() < 0.0 && return [4,5,6]

Runing at the command line, (e.g. julia bad.jl) runs without problems.

Many thanks for your effort,
Zoltan

>>> Content of bad.jl:

function proba(;α = 0.1)
	randn() < 0.0 && return [4,5,6]
	return [1,2,3], 1.2^α
end

function probak(α = 0.5)
	kont1 = Array{Array{Int,1},1}()
	kont2 = Array{Float64, 1}()
	k1, k2 = proba(α = α)
	push!(kont1, k1)
	push!(kont2, k2)
	return kont1, kont2
end

<<<

>>> Content of good.jl

function proba(;α = 0.1)
	randn() < 0.0 && return [4,5,6], 1.233
	return [1,2,3], 1.2^α
end

function probak(α = 0.5)
	kont1 = Array{Array{Int,1},1}()
	kont2 = Array{Float64, 1}()
	k1, k2 = proba(α = α)
	push!(kont1, k1)
	push!(kont2, k2)
	return kont1, kont2
end

<<<

   * What exactly did you do (or not do) that was effective (or ineffective)?

julia> include("bad.jl")
probak (generic function with 2 methods)

julia> c,f = probak()

   * What was the outcome of this action?

Illegal inttoptr
          %23 = ptrtoint %jl_value_t addrspace(10)* %20 to i64, !dbg !19
Illegal inttoptr
          %24 = inttoptr i64 %23 to i64 addrspace(13)*, !dbg !19

signal (6): Aborted
in expression starting at REPL[2]:1
gsignal at /lib/x86_64-linux-gnu/libc.so.6 (unknown line)
abort at /lib/x86_64-linux-gnu/libc.so.6 (unknown line)
unknown function (ip: 0x7f315d7872f0)
_ZN4llvm13FPPassManager13runOnFunctionERNS_8FunctionE at /usr/bin/../lib/x86_64-linux-gnu/libLLVM-10.so.1 (unknown line)
_ZN4llvm13FPPassManager11runOnModuleERNS_6ModuleE at /usr/bin/../lib/x86_64-linux-gnu/libLLVM-10.so.1 (unknown line)
_ZN4llvm6legacy15PassManagerImpl3runERNS_6ModuleE at /usr/bin/../lib/x86_64-linux-gnu/libLLVM-10.so.1 (unknown line)
unknown function (ip: 0x7f315d87a537)
unknown function (ip: 0x7f315d87d004)
unknown function (ip: 0x7f315d87dcce)
unknown function (ip: 0x7f315d87f12a)
unknown function (ip: 0x7f315d87fefd)
unknown function (ip: 0x7f315d880ec8)
unknown function (ip: 0x7f315d8100cb)
jl_apply_generic at /usr/bin/../lib/x86_64-linux-gnu/libjulia.so.1 (unknown line)
unknown function (ip: 0x7f315d824854)
unknown function (ip: 0x7f315d8244f5)
unknown function (ip: 0x7f315d825087)
unknown function (ip: 0x7f315d825b1e)
unknown function (ip: 0x7f315d83e028)
unknown function (ip: 0x7f315d83e5e8)
jl_toplevel_eval_in at /usr/bin/../lib/x86_64-linux-gnu/libjulia.so.1 (unknown line)
eval at ./boot.jl:331
eval_user_input at /build/julia-pTK15f/julia-1.5.3+dfsg/usr/share/julia/stdlib/v1.5/REPL/src/REPL.jl:134
repl_backend_loop at /build/julia-pTK15f/julia-1.5.3+dfsg/usr/share/julia/stdlib/v1.5/REPL/src/REPL.jl:195
start_repl_backend at /build/julia-pTK15f/julia-1.5.3+dfsg/usr/share/julia/stdlib/v1.5/REPL/src/REPL.jl:180
#run_repl#37 at /build/julia-pTK15f/julia-1.5.3+dfsg/usr/share/julia/stdlib/v1.5/REPL/src/REPL.jl:292
run_repl at /build/julia-pTK15f/julia-1.5.3+dfsg/usr/share/julia/stdlib/v1.5/REPL/src/REPL.jl:288
#807 at ./client.jl:399
jfptr_YY.807_56835.clone_1 at /usr/lib/x86_64-linux-gnu/julia/sys.so (unknown line)
unknown function (ip: 0x7f315d81ba8f)
jl_f__apply_latest at /usr/bin/../lib/x86_64-linux-gnu/libjulia.so.1 (unknown line)
#invokelatest#1 at ./essentials.jl:710 [inlined]
invokelatest at ./essentials.jl:709 [inlined]
run_main_repl at ./client.jl:383
exec_options at ./client.jl:313
_start at ./client.jl:506
jfptr__start_42866.clone_1 at /usr/lib/x86_64-linux-gnu/julia/sys.so (unknown line)
unknown function (ip: 0x5592d19e1755)
unknown function (ip: 0x5592d19e1332)
__libc_start_main at /lib/x86_64-linux-gnu/libc.so.6 (unknown line)
unknown function (ip: 0x5592d19e13d9)
Allocations: 771272 (Pool: 771185; Big: 87); GC: 1
Aborted

   * What outcome did you expect instead?

julia> include("good.jl")
probak (generic function with 2 methods)

julia> c,f = probak()
([[1, 2, 3]], [1.0954451150103321])


Julia versioninfo() output:
               _
   _       _ _(_)_     |  Documentation: https://docs.julialang.org
  (_)     | (_) (_)    |
   _ _   _| |_  __ _   |  Type "?" for help, "]?" for Pkg help.
  | | | | | | |/ _` |  |
  | | |_| | | | (_| |  |  Version 1.5.3
 _/ |\__'_|_|_|\__'_|  |  Debian ⛬  julia/1.5.3+dfsg-2+b2
|__/                   |

julia> using InteractiveUtils

julia> versioninfo()
Julia Version 1.5.3
Platform Info:
  OS: Linux (x86_64-linux-gnu)
  CPU: Intel(R) Core(TM) i7-6500U CPU @ 2.50GHz
  WORD_SIZE: 64
  LIBM: libopenlibm
  LLVM: libLLVM-10.0.1 (ORCJIT, skylake)


-- System Information:
Debian Release: bullseye/sid
  APT prefers testing
  APT policy: (500, 'testing')
Architecture: amd64 (x86_64)
Foreign Architectures: i386

Kernel: Linux 5.9.0-4-amd64 (SMP w/4 CPU threads)
Locale: LANG=en_GB.UTF-8, LC_CTYPE=en_GB.UTF-8 (charmap=UTF-8), LANGUAGE=en_GB:en
Shell: /bin/sh linked to /bin/dash
Init: systemd (via /run/systemd/system)
LSM: AppArmor: enabled

Versions of packages julia depends on:
ii  julia-common      1.5.3+dfsg-2
ii  libc6             2.31-5
ii  libcurl3-gnutls   7.72.0-1
ii  libdsfmt-19937-1  2.2.3+dfsg-4
ii  libgcc-s1         10.2.0-19
ii  libgfortran5      10.2.0-19
ii  libgit2-1.1       1.1.0+dfsg.1-2
ii  libgmp10          2:6.2.1+dfsg-1
ii  libjulia1         1.5.3+dfsg-2+b2
ii  libllvm10         1:10.0.1-8+b1
ii  libmbedcrypto3    2.16.5-1
ii  libmbedtls12      2.16.5-1
ii  libmbedx509-0     2.16.5-1
ii  libmpfr6          4.1.0-3
ii  libopenlibm3      0.7.0+dfsg-2
ii  libpcre2-8-0      10.35-2
ii  libquadmath0      10.2.0-19
ii  libssh2-1         1.8.0-2.1
ii  libunwind8        1.3.2-2
ii  libutf8proc2      2.5.0-1

Versions of packages julia recommends:
ii  git      1:2.29.2-1
ii  openssl  1.1.1h-1

Versions of packages julia suggests:
pn  ess        <none>
ii  julia-doc  1.5.3+dfsg-2
pn  vim-julia  <none>

-- no debconf information


More information about the Pkg-julia-devel mailing list