Skip to content

(::Type{T})(x::Int) where {T<:Integer} = println("crash") #25740

@vincent-picaud

Description

@vincent-picaud

A code example where Julia does not abort gracefully:

(::Type{T})(x::Int) where {T<:Integer} = println("crash")

entered in the REPL leads to:

crashcrashcrashcrashcrash
crash

crash

crash

corrupted double-linked list

signal (6): Aborted
while loading no file, in expression starting on line 0

A variation that leads to a sigsegv

(::Type{T})(x::Int) where {T<:Integer} = println(:crash)

prints

crashcrashcrashcrashcrash
crash

crash

crash

signal (11): Segmentation fault
while loading no file, in expression starting on line 0
unknown function (ip: 0x7ff958329554)
_ZN4llvm10AllocaInstC2EPNS_4TypeEPNS_5ValueEjRKNS_5TwineEPNS_11InstructionE at /home/picaud/ExternalSoftware/julia-d386e40c17/bin/../lib/julia/libLLVM-3.9.so (unknown line)
emit_function at /buildworker/worker/package_linux64/build/src/codegen.cpp:5643
....

My Julia version is:

Julia Version 0.6.2
Commit d386e40 (2017-12-13 18:08 UTC)
Platform Info:
OS: Linux (x86_64-pc-linux-gnu)
CPU: Intel(R) Xeon(R) CPU E5-2603 v3 @ 1.60GHz
WORD_SIZE: 64
BLAS: libopenblas (USE64BITINT DYNAMIC_ARCH NO_AFFINITY Haswell)
LAPACK: libopenblas64_
LIBM: libopenlibm
LLVM: libLLVM-3.9.1 (ORCJIT, haswell)

Obvioulsy this code is a non sense, the point is that Julia is really not happy with it.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions