<p dir="auto">The following invalid code results in a segfault for me: <code class="notranslate">Set{Array{T}}() where {T&lt;:Float64}</code></p>
<p dir="auto">Full details:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="               _
   _       _ _(_)_     |  A fresh approach to technical computing
  (_)     | (_) (_)    |  Documentation: https://docs.julialang.org
   _ _   _| |_  __ _   |  Type &quot;?help&quot; for help.
  | | | | | | |/ _` |  |
  | | |_| | | | (_| |  |  Version 0.6.0 (2017-06-19 13:05 UTC)
 _/ |\__'_|_|_|\__'_|  |  
|__/                   |  x86_64-suse-linux

julia&gt; versioninfo()
Julia Version 0.6.0
Commit 903644385b* (2017-06-19 13:05 UTC)
Platform Info:
  OS: Linux (x86_64-suse-linux)
  CPU: Intel(R) Core(TM) i5-4200U CPU @ 1.60GHz
  WORD_SIZE: 64
  BLAS: libopenblas (DYNAMIC_ARCH Haswell)
  LAPACK: libopenblas_openmp.so.0
  LIBM: libopenlibm
  LLVM: libLLVM-3.9.1 (ORCJIT, haswell)

julia&gt; Set{Array{T}}() where {T&lt;:Float64}

signal (11): Segmentation fault
while loading no file, in expression starting on line 0
jl_new_structv at /home/abuild/rpmbuild/BUILD/julia-0.6.0/src/datatype.c:679
Type at ./dict.jl:104
jl_call_fptr_internal at /home/abuild/rpmbuild/BUILD/julia-0.6.0/src/julia_internal.h:339 [inlined]
jl_call_method_internal at /home/abuild/rpmbuild/BUILD/julia-0.6.0/src/julia_internal.h:358 [inlined]
jl_apply_generic at /home/abuild/rpmbuild/BUILD/julia-0.6.0/src/gf.c:1933
Type at ./set.jl:6
jl_call_fptr_internal at /home/abuild/rpmbuild/BUILD/julia-0.6.0/src/julia_internal.h:339 [inlined]
jl_call_method_internal at /home/abuild/rpmbuild/BUILD/julia-0.6.0/src/julia_internal.h:358 [inlined]
jl_apply_generic at /home/abuild/rpmbuild/BUILD/julia-0.6.0/src/gf.c:1933
do_call at /home/abuild/rpmbuild/BUILD/julia-0.6.0/src/interpreter.c:75
eval at /home/abuild/rpmbuild/BUILD/julia-0.6.0/src/interpreter.c:242
do_call at /home/abuild/rpmbuild/BUILD/julia-0.6.0/src/interpreter.c:74
eval at /home/abuild/rpmbuild/BUILD/julia-0.6.0/src/interpreter.c:242
eval_body at /home/abuild/rpmbuild/BUILD/julia-0.6.0/src/interpreter.c:539
jl_interpret_toplevel_thunk at /home/abuild/rpmbuild/BUILD/julia-0.6.0/src/interpreter.c:692
jl_toplevel_eval_flex at /home/abuild/rpmbuild/BUILD/julia-0.6.0/src/toplevel.c:592
jl_toplevel_eval_in at /home/abuild/rpmbuild/BUILD/julia-0.6.0/src/builtins.c:496
eval at ./boot.jl:235
unknown function (ip: 0x7f7dad6574ff)
jl_call_fptr_internal at /home/abuild/rpmbuild/BUILD/julia-0.6.0/src/julia_internal.h:339 [inlined]
jl_call_method_internal at /home/abuild/rpmbuild/BUILD/julia-0.6.0/src/julia_internal.h:358 [inlined]
jl_apply_generic at /home/abuild/rpmbuild/BUILD/julia-0.6.0/src/gf.c:1933
eval_user_input at ./REPL.jl:66
unknown function (ip: 0x7f7dad6ca0ef)
jl_call_fptr_internal at /home/abuild/rpmbuild/BUILD/julia-0.6.0/src/julia_internal.h:339 [inlined]
jl_call_method_internal at /home/abuild/rpmbuild/BUILD/julia-0.6.0/src/julia_internal.h:358 [inlined]
jl_apply_generic at /home/abuild/rpmbuild/BUILD/julia-0.6.0/src/gf.c:1933
macro expansion at ./REPL.jl:97 [inlined]
#1 at ./event.jl:73
unknown function (ip: 0x7f7d90e3155f)
jl_call_fptr_internal at /home/abuild/rpmbuild/BUILD/julia-0.6.0/src/julia_internal.h:339 [inlined]
jl_call_method_internal at /home/abuild/rpmbuild/BUILD/julia-0.6.0/src/julia_internal.h:358 [inlined]
jl_apply_generic at /home/abuild/rpmbuild/BUILD/julia-0.6.0/src/gf.c:1933
jl_apply at /home/abuild/rpmbuild/BUILD/julia-0.6.0/src/julia.h:1424 [inlined]
start_task at /home/abuild/rpmbuild/BUILD/julia-0.6.0/src/task.c:267
unknown function (ip: 0xffffffffffffffff)
Allocations: 3884938 (Pool: 3883572; Big: 1366); GC: 6
Segmentation fault (core dumped)
"><pre class="notranslate"><code class="notranslate">               _
   _       _ _(_)_     |  A fresh approach to technical computing
  (_)     | (_) (_)    |  Documentation: https://docs.julialang.org
   _ _   _| |_  __ _   |  Type "?help" for help.
  | | | | | | |/ _` |  |
  | | |_| | | | (_| |  |  Version 0.6.0 (2017-06-19 13:05 UTC)
 _/ |\__'_|_|_|\__'_|  |  
|__/                   |  x86_64-suse-linux

julia&gt; versioninfo()
Julia Version 0.6.0
Commit 903644385b* (2017-06-19 13:05 UTC)
Platform Info:
  OS: Linux (x86_64-suse-linux)
  CPU: Intel(R) Core(TM) i5-4200U CPU @ 1.60GHz
  WORD_SIZE: 64
  BLAS: libopenblas (DYNAMIC_ARCH Haswell)
  LAPACK: libopenblas_openmp.so.0
  LIBM: libopenlibm
  LLVM: libLLVM-3.9.1 (ORCJIT, haswell)

julia&gt; Set{Array{T}}() where {T&lt;:Float64}

signal (11): Segmentation fault
while loading no file, in expression starting on line 0
jl_new_structv at /home/abuild/rpmbuild/BUILD/julia-0.6.0/src/datatype.c:679
Type at ./dict.jl:104
jl_call_fptr_internal at /home/abuild/rpmbuild/BUILD/julia-0.6.0/src/julia_internal.h:339 [inlined]
jl_call_method_internal at /home/abuild/rpmbuild/BUILD/julia-0.6.0/src/julia_internal.h:358 [inlined]
jl_apply_generic at /home/abuild/rpmbuild/BUILD/julia-0.6.0/src/gf.c:1933
Type at ./set.jl:6
jl_call_fptr_internal at /home/abuild/rpmbuild/BUILD/julia-0.6.0/src/julia_internal.h:339 [inlined]
jl_call_method_internal at /home/abuild/rpmbuild/BUILD/julia-0.6.0/src/julia_internal.h:358 [inlined]
jl_apply_generic at /home/abuild/rpmbuild/BUILD/julia-0.6.0/src/gf.c:1933
do_call at /home/abuild/rpmbuild/BUILD/julia-0.6.0/src/interpreter.c:75
eval at /home/abuild/rpmbuild/BUILD/julia-0.6.0/src/interpreter.c:242
do_call at /home/abuild/rpmbuild/BUILD/julia-0.6.0/src/interpreter.c:74
eval at /home/abuild/rpmbuild/BUILD/julia-0.6.0/src/interpreter.c:242
eval_body at /home/abuild/rpmbuild/BUILD/julia-0.6.0/src/interpreter.c:539
jl_interpret_toplevel_thunk at /home/abuild/rpmbuild/BUILD/julia-0.6.0/src/interpreter.c:692
jl_toplevel_eval_flex at /home/abuild/rpmbuild/BUILD/julia-0.6.0/src/toplevel.c:592
jl_toplevel_eval_in at /home/abuild/rpmbuild/BUILD/julia-0.6.0/src/builtins.c:496
eval at ./boot.jl:235
unknown function (ip: 0x7f7dad6574ff)
jl_call_fptr_internal at /home/abuild/rpmbuild/BUILD/julia-0.6.0/src/julia_internal.h:339 [inlined]
jl_call_method_internal at /home/abuild/rpmbuild/BUILD/julia-0.6.0/src/julia_internal.h:358 [inlined]
jl_apply_generic at /home/abuild/rpmbuild/BUILD/julia-0.6.0/src/gf.c:1933
eval_user_input at ./REPL.jl:66
unknown function (ip: 0x7f7dad6ca0ef)
jl_call_fptr_internal at /home/abuild/rpmbuild/BUILD/julia-0.6.0/src/julia_internal.h:339 [inlined]
jl_call_method_internal at /home/abuild/rpmbuild/BUILD/julia-0.6.0/src/julia_internal.h:358 [inlined]
jl_apply_generic at /home/abuild/rpmbuild/BUILD/julia-0.6.0/src/gf.c:1933
macro expansion at ./REPL.jl:97 [inlined]
#1 at ./event.jl:73
unknown function (ip: 0x7f7d90e3155f)
jl_call_fptr_internal at /home/abuild/rpmbuild/BUILD/julia-0.6.0/src/julia_internal.h:339 [inlined]
jl_call_method_internal at /home/abuild/rpmbuild/BUILD/julia-0.6.0/src/julia_internal.h:358 [inlined]
jl_apply_generic at /home/abuild/rpmbuild/BUILD/julia-0.6.0/src/gf.c:1933
jl_apply at /home/abuild/rpmbuild/BUILD/julia-0.6.0/src/julia.h:1424 [inlined]
start_task at /home/abuild/rpmbuild/BUILD/julia-0.6.0/src/task.c:267
unknown function (ip: 0xffffffffffffffff)
Allocations: 3884938 (Pool: 3883572; Big: 1366); GC: 6
Segmentation fault (core dumped)

</code></pre></div>
<h2 dir="auto">background</h2>
<p dir="auto">Somebody in Chinese Julia community wants to <a href="http://discourse.juliacn.com/t/topic/717?u=woclass" rel="nofollow">implement a STMonad in Julia</a>, and he found this bug.</p>
<p dir="auto">And I found that this code in julia 0.6.4 only cause a error, Julia also suggest that this code use a deprecated syntax. But in Julia 1.0 this cause a crash.</p>
<h2 dir="auto">Error info</h2>
<h3 dir="auto">v 1.0.0</h3>
<p dir="auto">minimal reproducible example</p>
<div class="highlight highlight-source-julia notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="struct STMonad{A,B}
	function STMonad()
		new{S,Ref{S}}() where S
	end
end

STMonad()"><pre class="notranslate"><span class="pl-k">struct</span> STMonad{A,B}
	<span class="pl-k">function</span> <span class="pl-en">STMonad</span>()
		<span class="pl-c1">new</span><span class="pl-c1">{S,Ref{S}}</span>() <span class="pl-k">where</span> S
	<span class="pl-k">end</span>
<span class="pl-k">end</span>

<span class="pl-c1">STMonad</span>()</pre></div>
<p dir="auto">Julia info</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="julia&gt; versioninfo()
Julia Version 1.0.0
Commit 5d4eaca0c9 (2018-08-08 20:58 UTC)
Platform Info:
  OS: Windows (x86_64-w64-mingw32)
  CPU: Intel(R) Core(TM) i7-5600U CPU @ 2.60GHz
  WORD_SIZE: 64
  LIBM: libopenlibm
  LLVM: libLLVM-6.0.0 (ORCJIT, broadwell)"><pre class="notranslate"><code class="notranslate">julia&gt; versioninfo()
Julia Version 1.0.0
Commit 5d4eaca0c9 (2018-08-08 20:58 UTC)
Platform Info:
  OS: Windows (x86_64-w64-mingw32)
  CPU: Intel(R) Core(TM) i7-5600U CPU @ 2.60GHz
  WORD_SIZE: 64
  LIBM: libopenlibm
  LLVM: libLLVM-6.0.0 (ORCJIT, broadwell)
</code></pre></div>
<p dir="auto">output</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="PS C:\Users\woclass\Desktop\`del&gt; C:\Users\woclass\AppData\Local\Julia-1.0.0\bin\julia.exe .\STMonad.jl

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 0x6b5cf117 -- jl_new_structv at /home/Administrator/buildbot/worker/package_win64/build/src\datatype.c:774
in expression starting at C:\Users\woclass\Desktop\`del\STMonad.jl:7
jl_set_nth_field at /home/Administrator/buildbot/worker/package_win64/build/src\datatype.c:889 [inlined]
jl_new_structv at /home/Administrator/buildbot/worker/package_win64/build/src\datatype.c:781
Type at C:\Users\woclass\Desktop\`del\STMonad.jl:3
jl_fptr_trampoline at /home/Administrator/buildbot/worker/package_win64/build/src\gf.c:1829
jl_apply_generic at /home/Administrator/buildbot/worker/package_win64/build/src\gf.c:2182
do_call at /home/Administrator/buildbot/worker/package_win64/build/src\interpreter.c:324
eval_value at /home/Administrator/buildbot/worker/package_win64/build/src\interpreter.c:428
eval_stmt_value at /home/Administrator/buildbot/worker/package_win64/build/src\interpreter.c:363 [inlined]
eval_body at /home/Administrator/buildbot/worker/package_win64/build/src\interpreter.c:682
jl_interpret_toplevel_thunk_callback at /home/Administrator/buildbot/worker/package_win64/build/src\interpreter.c:799
unknown function (ip: FFFFFFFFFFFFFFFE)
unknown function (ip: 000000000EB4522F)
unknown function (ip: FFFFFFFFFFFFFFFF)
jl_toplevel_eval_flex at /home/Administrator/buildbot/worker/package_win64/build/src\toplevel.c:787
jl_parse_eval_all at /home/Administrator/buildbot/worker/package_win64/build/src\ast.c:838
jl_load at /home/Administrator/buildbot/worker/package_win64/build/src\toplevel.c:821 [inlined]
jl_load_ at /home/Administrator/buildbot/worker/package_win64/build/src\toplevel.c:828
include at .\boot.jl:317 [inlined]
include_relative at .\loading.jl:1038
include at .\sysimg.jl:29
jl_apply_generic at /home/Administrator/buildbot/worker/package_win64/build/src\gf.c:2182
exec_options at .\client.jl:229
_start at .\client.jl:421
jl_apply_generic at /home/Administrator/buildbot/worker/package_win64/build/src\gf.c:2182
jl_apply at /home/Administrator/buildbot/worker/package_win64/build/src\julia.h:1536 [inlined]
true_main at /home/Administrator/buildbot/worker/package_win64/build/ui\repl.c:112
wmain at /home/Administrator/buildbot/worker/package_win64/build/ui\repl.c:233
__tmainCRTStartup at /usr/src/debug/mingw64-x86_64-runtime-5.0.3-1/crt\crtexe.c:329
mainCRTStartup at /usr/src/debug/mingw64-x86_64-runtime-5.0.3-1/crt\crtexe.c:212
BaseThreadInitThunk at C:\WINDOWS\System32\KERNEL32.DLL (unknown line)
RtlUserThreadStart at C:\WINDOWS\SYSTEM32\ntdll.dll (unknown line)
Allocations: 5974 (Pool: 5964; Big: 10); GC: 0"><pre class="notranslate"><code class="notranslate">PS C:\Users\woclass\Desktop\`del&gt; C:\Users\woclass\AppData\Local\Julia-1.0.0\bin\julia.exe .\STMonad.jl

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 0x6b5cf117 -- jl_new_structv at /home/Administrator/buildbot/worker/package_win64/build/src\datatype.c:774
in expression starting at C:\Users\woclass\Desktop\`del\STMonad.jl:7
jl_set_nth_field at /home/Administrator/buildbot/worker/package_win64/build/src\datatype.c:889 [inlined]
jl_new_structv at /home/Administrator/buildbot/worker/package_win64/build/src\datatype.c:781
Type at C:\Users\woclass\Desktop\`del\STMonad.jl:3
jl_fptr_trampoline at /home/Administrator/buildbot/worker/package_win64/build/src\gf.c:1829
jl_apply_generic at /home/Administrator/buildbot/worker/package_win64/build/src\gf.c:2182
do_call at /home/Administrator/buildbot/worker/package_win64/build/src\interpreter.c:324
eval_value at /home/Administrator/buildbot/worker/package_win64/build/src\interpreter.c:428
eval_stmt_value at /home/Administrator/buildbot/worker/package_win64/build/src\interpreter.c:363 [inlined]
eval_body at /home/Administrator/buildbot/worker/package_win64/build/src\interpreter.c:682
jl_interpret_toplevel_thunk_callback at /home/Administrator/buildbot/worker/package_win64/build/src\interpreter.c:799
unknown function (ip: FFFFFFFFFFFFFFFE)
unknown function (ip: 000000000EB4522F)
unknown function (ip: FFFFFFFFFFFFFFFF)
jl_toplevel_eval_flex at /home/Administrator/buildbot/worker/package_win64/build/src\toplevel.c:787
jl_parse_eval_all at /home/Administrator/buildbot/worker/package_win64/build/src\ast.c:838
jl_load at /home/Administrator/buildbot/worker/package_win64/build/src\toplevel.c:821 [inlined]
jl_load_ at /home/Administrator/buildbot/worker/package_win64/build/src\toplevel.c:828
include at .\boot.jl:317 [inlined]
include_relative at .\loading.jl:1038
include at .\sysimg.jl:29
jl_apply_generic at /home/Administrator/buildbot/worker/package_win64/build/src\gf.c:2182
exec_options at .\client.jl:229
_start at .\client.jl:421
jl_apply_generic at /home/Administrator/buildbot/worker/package_win64/build/src\gf.c:2182
jl_apply at /home/Administrator/buildbot/worker/package_win64/build/src\julia.h:1536 [inlined]
true_main at /home/Administrator/buildbot/worker/package_win64/build/ui\repl.c:112
wmain at /home/Administrator/buildbot/worker/package_win64/build/ui\repl.c:233
__tmainCRTStartup at /usr/src/debug/mingw64-x86_64-runtime-5.0.3-1/crt\crtexe.c:329
mainCRTStartup at /usr/src/debug/mingw64-x86_64-runtime-5.0.3-1/crt\crtexe.c:212
BaseThreadInitThunk at C:\WINDOWS\System32\KERNEL32.DLL (unknown line)
RtlUserThreadStart at C:\WINDOWS\SYSTEM32\ntdll.dll (unknown line)
Allocations: 5974 (Pool: 5964; Big: 10); GC: 0
</code></pre></div>
<h3 dir="auto">v 0.6.4</h3>
<p dir="auto">And in Juliua 0.6.4 this code just cause a MethodError, not a crash.</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="julia&gt; struct STMonad{A, B}
           function STMonad()
               new{S, Ref{S}}() where S
           end
       end

WARNING: deprecated syntax &quot;inner constructor STMonad(...) around REPL[1]:3&quot;.
Use &quot;STMonad{A,B}(...) where {A,B}&quot; instead.

julia&gt; STMonad()
ERROR: MethodError: no method matching STMonad()"><pre class="notranslate"><code class="notranslate">julia&gt; struct STMonad{A, B}
           function STMonad()
               new{S, Ref{S}}() where S
           end
       end

WARNING: deprecated syntax "inner constructor STMonad(...) around REPL[1]:3".
Use "STMonad{A,B}(...) where {A,B}" instead.

julia&gt; STMonad()
ERROR: MethodError: no method matching STMonad()
</code></pre></div>