Skip to content

Instantly share code, notes, and snippets.

@musm
Last active March 10, 2020 21:25
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save musm/eaf154e54cd3f75331439965ef809208 to your computer and use it in GitHub Desktop.
Save musm/eaf154e54cd3f75331439965ef809208 to your computer and use it in GitHub Desktop.
Break Julia for fun (segfault/stackoverflows/etc.)
# credits: @TotalVerb, @oxinabox, @musm @mbauman @quinnj
julia --compile=no --precompiled=no
(x->@inbounds(x+=[0][x])+x)(9^9^9)
[@inbounds([][x])for x=9^9^9]
run(`1`)
ccall(:j0,Any,())
f(x,y) = f(x,y); f(1,1)
f()=f();f()
(f()=f())()
Libc.free(Ptr{1}(1))
cfunction(produce,Int,Int)
ccall(:fma,Any,())
addprocs(1);
remotecall_fetch(()->SharedArray(Int,2), 2)
julia> current_task().state=:a
julia> 2
julia> Base.:(+)(x::Int, y::Int) = time_ns() % 1000 == 0 ? x : Base.add_int(x, y)
julia> unsafe_load(convert(Ptr{Complex{Float64}}, C_NULL))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment