Open docelic opened 11 months ago
Looks related to #10518
For reference, on 1.13.1 the same code from the initial report still crashes.
Also, it doesn't seem affected by the p x
line, crash always happens:
crystal test5.cr
0..20
#<VTime:0x732d607f7d80 @year=[Invalid memory access (signal 11) at address 0x4
[0x613036fa4de6] *Exception::CallStack::print_backtrace:Nil +118 in /.cache/crystal/crystal-run-test5.tmp
[0x613036f93776] ~procProc(Int32, Pointer(LibC::SiginfoT), Pointer(Void), Nil) +310 in /.cache/crystal/crystal-run-test5.tmp
[0x732d60933050] ?? +126638730981456 in /lib/x86_64-linux-gnu/libc.so.6
[0x61303704bedc] *Array(Int32) +412 in /.cache/crystal/crystal-run-test5.tmp
[0x61303704bd36] *Array(Int32) +6 in /.cache/crystal/crystal-run-test5.tmp
[0x61303704b6ca] *VTime +922 in /.cache/crystal/crystal-run-test5.tmp
[0x613036f94386] *p<VTime>:VTime +22 in /.cache/crystal/crystal-run-test5.tmp
[0x613036f83cae] __crystal_main +1134 in /.cache/crystal/crystal-run-test5.tmp
[0x613036fe0826] *Crystal::main_user_code<Int32, Pointer(Pointer(UInt8))>:Nil +6 in /.cache/crystal/crystal-run-test5.tmp
[0x613036fe079a] *Crystal::main<Int32, Pointer(Pointer(UInt8))>:Int32 +58 in /.cache/crystal/crystal-run-test5.tmp
[0x613036f911b6] main +6 in /.cache/crystal/crystal-run-test5.tmp
[0x732d6091e24a] ?? +126638730895946 in /lib/x86_64-linux-gnu/libc.so.6
[0x732d6091e305] __libc_start_main +133 in /lib/x86_64-linux-gnu/libc.so.6
[0x613036f83771] _start +33 in /.cache/crystal/crystal-run-test5.tmp
[0x0] ???
Bug Report
The following code crashes:
(Code on play: https://play.crystal-lang.org/#/r/g6c0)
Output from running this code:
t.year
, then it doesn't crash:(Note: originally my
alias Virtual
had more types than the shortened example shown above. With more types, adding/removingp x
was making a difference between working/crashing. After I reduced the alias to justNil | Enumerable(Int32)
, thep x
no longer had effect - it always crashes.)If
-Dpreview_mt
is specified, the behavior is slightly different, but the same. (With-Dpreview_mt
it crashes on more than 2 properties, not just more than one).The code doesn't crash in any combination if it is run in release mode:
Enumerable(Int)
. If I use e.g.Range(Int,Int)
instead of that, then it doesn't crash.