Crystal crashed on a debug build

So, I have this small Crystal project that builds and works, and I wanted to try out debugging in VSCode, but when I did a debug build this is what I got:

Assertion failed: (Idx < NumElements && "Invalid element idx!"), function getElementOffset, file /var/cache/omnibus/src/llvm/llvm-10.0.0.src/include/llvm/IR/DataLayout.h, line 608.
/usr/local/bin/crystal: line 102:  3017 Abort trap: 6           "$INSTALL_DIR/embedded/bin/crystal" "$@"

and the quite lengthy dump from macOS:

Process:               crystal [3017]
Path:                  /opt/crystal/*/crystal
Identifier:            crystal
Version:               0
Code Type:             X86-64 (Native)
Parent Process:        ??? [3000]
Responsible:           crystal [3017]
User ID:               502

Date/Time:             2021-08-08 00:32:23.576 +0200
OS Version:            Mac OS X 10.11.6 (15G22010)
Report Version:        11


Time Awake Since Boot: 5900 seconds

System Integrity Protection: enabled

Crashed Thread:        0  Dispatch queue: com.apple.main-thread

Exception Type:        EXC_CRASH (SIGABRT)
Exception Codes:       0x0000000000000000, 0x0000000000000000
Exception Note:        EXC_CORPSE_NOTIFY

Application Specific Information:
Assertion failed: (Idx < NumElements && "Invalid element idx!"), function getElementOffset, file /var/cache/omnibus/src/llvm/llvm-10.0.0.src/include/llvm/IR/DataLayout.h, line 608.
 

Thread 0 Crashed:: Dispatch queue: com.apple.main-thread
0   libsystem_kernel.dylib        	0x00007fff9b828f06 __pthread_kill + 10
1   libsystem_pthread.dylib       	0x00007fff94b334ec pthread_kill + 90
2   libsystem_c.dylib             	0x00007fff998706df abort + 129
3   libsystem_c.dylib             	0x00007fff99837dd8 __assert_rtn + 321
4   crystal                       	0x000000010e24564d LLVMOffsetOfElement.cold.2 + 35
5   crystal                       	0x000000010d7e2b9e LLVMOffsetOfElement + 65
6   crystal                       	0x000000010ca06287 *Crystal::CodeGenVisitor#get_debug_type<Crystal::Type+, Crystal::Type+>:(LibLLVMExt::Metadata | Nil) + 15447
7   crystal                       	0x000000010ca061df *Crystal::CodeGenVisitor#get_debug_type<Crystal::Type+, Crystal::Type+>:(LibLLVMExt::Metadata | Nil) + 15279
8   crystal                       	0x000000010ca061df *Crystal::CodeGenVisitor#get_debug_type<Crystal::Type+, Crystal::Type+>:(LibLLVMExt::Metadata | Nil) + 15279
9   crystal                       	0x000000010ca061df *Crystal::CodeGenVisitor#get_debug_type<Crystal::Type+, Crystal::Type+>:(LibLLVMExt::Metadata | Nil) + 15279
10  crystal                       	0x000000010ca0e85f *Crystal::CodeGenVisitor#declare_variable<String, Crystal::Type+, LLVM::Value, Crystal::Location, LLVM::BasicBlock>:Bool + 431
11  crystal                       	0x000000010ca6a21a *Crystal::CodeGenVisitor#alloca_non_closured_vars<(Hash(String, Crystal::MetaVar)+ | Nil), Crystal::Block, Nil, Bool>:Nil + 1066
12  crystal                       	0x000000010ca59732 *Crystal::CodeGenVisitor#visit<Crystal::Call>:Bool + 2930
13  crystal                       	0x000000010ca364a4 *Crystal::ASTNode+@Crystal::ASTNode#accept<Crystal::CodeGenVisitor>:Nil + 14836
14  crystal                       	0x000000010ca4a2a3 *Crystal::CodeGenVisitor#codegen_fun<String, Crystal::Def+, Crystal::Type+, Bool, Crystal::CodeGenVisitor::ModuleInfo, Bool, Bool>:LLVM::Function + 4595
15  crystal                       	0x000000010ca66538 *Crystal::CodeGenVisitor#target_def_fun<Crystal::Def+, Crystal::Type+>:LLVM::Function + 2392
16  crystal                       	0x000000010ca5948c *Crystal::CodeGenVisitor#visit<Crystal::Call>:Bool + 2252
17  crystal                       	0x000000010ca364a4 *Crystal::ASTNode+@Crystal::ASTNode#accept<Crystal::CodeGenVisitor>:Nil + 14836
18  crystal                       	0x000000010ca791f7 *Crystal::CodeGenVisitor#visit<Crystal::Assign>:(Bool | Nil) + 311
19  crystal                       	0x000000010ca33089 *Crystal::ASTNode+@Crystal::ASTNode#accept<Crystal::CodeGenVisitor>:Nil + 1497
20  crystal                       	0x000000010ca3318c *Crystal::ASTNode+@Crystal::ASTNode#accept<Crystal::CodeGenVisitor>:Nil + 1756
21  crystal                       	0x000000010ca4a2a3 *Crystal::CodeGenVisitor#codegen_fun<String, Crystal::Def+, Crystal::Type+, Bool, Crystal::CodeGenVisitor::ModuleInfo, Bool, Bool>:LLVM::Function + 4595
22  crystal                       	0x000000010ca66538 *Crystal::CodeGenVisitor#target_def_fun<Crystal::Def+, Crystal::Type+>:LLVM::Function + 2392
23  crystal                       	0x000000010ca5948c *Crystal::CodeGenVisitor#visit<Crystal::Call>:Bool + 2252
24  crystal                       	0x000000010ca364a4 *Crystal::ASTNode+@Crystal::ASTNode#accept<Crystal::CodeGenVisitor>:Nil + 14836
25  crystal                       	0x000000010ca64737 *Crystal::CodeGenVisitor#prepare_call_args_non_external<Crystal::Call, Crystal::Def+, Crystal::Type+>:Tuple(Array(LLVM::Value), Bool) + 2007
26  crystal                       	0x000000010ca59143 *Crystal::CodeGenVisitor#visit<Crystal::Call>:Bool + 1411
27  crystal                       	0x000000010ca364a4 *Crystal::ASTNode+@Crystal::ASTNode#accept<Crystal::CodeGenVisitor>:Nil + 14836
28  crystal                       	0x000000010ca4a2a3 *Crystal::CodeGenVisitor#codegen_fun<String, Crystal::Def+, Crystal::Type+, Bool, Crystal::CodeGenVisitor::ModuleInfo, Bool, Bool>:LLVM::Function + 4595
29  crystal                       	0x000000010ca66538 *Crystal::CodeGenVisitor#target_def_fun<Crystal::Def+, Crystal::Type+>:LLVM::Function + 2392
30  crystal                       	0x000000010ca5948c *Crystal::CodeGenVisitor#visit<Crystal::Call>:Bool + 2252
31  crystal                       	0x000000010ca364a4 *Crystal::ASTNode+@Crystal::ASTNode#accept<Crystal::CodeGenVisitor>:Nil + 14836
32  crystal                       	0x000000010ca36845 *Crystal::ASTNode+@Crystal::ASTNode#accept<Crystal::CodeGenVisitor>:Nil + 15765
33  crystal                       	0x000000010ca791f7 *Crystal::CodeGenVisitor#visit<Crystal::Assign>:(Bool | Nil) + 311
34  crystal                       	0x000000010ca33089 *Crystal::ASTNode+@Crystal::ASTNode#accept<Crystal::CodeGenVisitor>:Nil + 1497
35  crystal                       	0x000000010ca3318c *Crystal::ASTNode+@Crystal::ASTNode#accept<Crystal::CodeGenVisitor>:Nil + 1756
36  crystal                       	0x000000010ca4a2a3 *Crystal::CodeGenVisitor#codegen_fun<String, Crystal::Def+, Crystal::Type+, Bool, Crystal::CodeGenVisitor::ModuleInfo, Bool, Bool>:LLVM::Function + 4595
37  crystal                       	0x000000010ca66538 *Crystal::CodeGenVisitor#target_def_fun<Crystal::Def+, Crystal::Type+>:LLVM::Function + 2392
38  crystal                       	0x000000010ca5948c *Crystal::CodeGenVisitor#visit<Crystal::Call>:Bool + 2252
39  crystal                       	0x000000010ca364a4 *Crystal::ASTNode+@Crystal::ASTNode#accept<Crystal::CodeGenVisitor>:Nil + 14836
40  crystal                       	0x000000010ca36845 *Crystal::ASTNode+@Crystal::ASTNode#accept<Crystal::CodeGenVisitor>:Nil + 15765
41  crystal                       	0x000000010ca368c2 *Crystal::ASTNode+@Crystal::ASTNode#accept<Crystal::CodeGenVisitor>:Nil + 15890
42  crystal                       	0x000000010ca3318c *Crystal::ASTNode+@Crystal::ASTNode#accept<Crystal::CodeGenVisitor>:Nil + 1756
43  crystal                       	0x000000010ca4a2a3 *Crystal::CodeGenVisitor#codegen_fun<String, Crystal::Def+, Crystal::Type+, Bool, Crystal::CodeGenVisitor::ModuleInfo, Bool, Bool>:LLVM::Function + 4595
44  crystal                       	0x000000010ca66538 *Crystal::CodeGenVisitor#target_def_fun<Crystal::Def+, Crystal::Type+>:LLVM::Function + 2392
45  crystal                       	0x000000010ca5948c *Crystal::CodeGenVisitor#visit<Crystal::Call>:Bool + 2252
46  crystal                       	0x000000010ca364a4 *Crystal::ASTNode+@Crystal::ASTNode#accept<Crystal::CodeGenVisitor>:Nil + 14836
47  crystal                       	0x000000010ca3318c *Crystal::ASTNode+@Crystal::ASTNode#accept<Crystal::CodeGenVisitor>:Nil + 1756
48  crystal                       	0x000000010c9d8781 *Crystal::Compiler#codegen<Crystal::Program, Crystal::ASTNode+, Array(Crystal::Compiler::Source), String>:(Tuple(Array(Crystal::Compiler::CompilationUnit), Array(String)) | Nil) + 193
49  crystal                       	0x000000010ce47777 *Crystal::Compiler#compile<Array(Crystal::Compiler::Source), String>:Crystal::Compiler::Result + 135
50  crystal                       	0x000000010ce34078 *Crystal::Command#run:(Bool | Nil) + 600
51  crystal                       	0x000000010c414501 __crystal_main + 17249

Thread 1:
0   libsystem_kernel.dylib        	0x00007fff9b828db6 __psynch_cvwait + 10
1   libsystem_pthread.dylib       	0x00007fff94b31728 _pthread_cond_wait + 767
2   crystal                       	0x000000010e02cc37 GC_wait_marker + 23
3   crystal                       	0x000000010e023435 GC_help_marker + 37
4   crystal                       	0x000000010e02aebf GC_mark_thread + 143
5   libsystem_pthread.dylib       	0x00007fff94b3099d _pthread_body + 131
6   libsystem_pthread.dylib       	0x00007fff94b3091a _pthread_start + 168
7   libsystem_pthread.dylib       	0x00007fff94b2e351 thread_start + 13

Thread 0 crashed with X86 Thread State (64-bit):
  rax: 0x0000000000000000  rbx: 0x0000000000000006  rcx: 0x00007fff537e8318  rdx: 0x0000000000000000
  rdi: 0x000000000000050f  rsi: 0x0000000000000006  rbp: 0x00007fff537e8340  rsp: 0x00007fff537e8318
   r8: 0x0000000000000000   r9: 0x0000000000000260  r10: 0x0000000008000000  r11: 0x0000000000000206
  r12: 0x000000010e793d69  r13: 0x000000011e079000  r14: 0x00007fff7a9ab000  r15: 0x000000010e793b3c
  rip: 0x00007fff9b828f06  rfl: 0x0000000000000206  cr2: 0x0000000129382000
  
Logical CPU:     0
Error Code:      0x02000131
Trap Number:     133


Binary Images:
       0x10c40e000 -        0x10e91bfff +crystal (0) <82C20D53-358D-3276-BCC9-50016DADD1CC> /opt/crystal/*/crystal
    0x7fff6d66d000 -     0x7fff6d6a4a47  dyld (360.22) <6B9CD3BA-2D60-3629-A0CB-AB810F55E8DD> /usr/lib/dyld
    0x7fff89436000 -     0x7fff89438ff7  libquarantine.dylib (80) <5B351BEC-27CC-3935-82F3-A065CC764255> /usr/lib/system/libquarantine.dylib
    0x7fff8a432000 -     0x7fff8a4a9feb  libcorecrypto.dylib (335.50.2) <4E339108-3997-39D3-BB58-C5A0340E3651> /usr/lib/system/libcorecrypto.dylib
    0x7fff8be5b000 -     0x7fff8be84ff7  libxpc.dylib (765.70.2) <7978B4D9-7970-3302-87FA-75709127DBD2> /usr/lib/system/libxpc.dylib
    0x7fff8c4dd000 -     0x7fff8c4e0ffb  libdyld.dylib (360.22) <E0CE4C3B-38DF-37FB-A74E-866938E1AF92> /usr/lib/system/libdyld.dylib
    0x7fff8e3bc000 -     0x7fff8e3c4ffb  libsystem_dnssd.dylib (625.60.5) <8BE2BAFE-B2A3-38FA-A960-F6884217F54D> /usr/lib/system/libsystem_dnssd.dylib
    0x7fff8e494000 -     0x7fff8e495fff  libsystem_blocks.dylib (65) <1244D9D5-F6AA-35BB-B307-86851C24B8E5> /usr/lib/system/libsystem_blocks.dylib
    0x7fff8e496000 -     0x7fff8e49afff  libcache.dylib (75) <9548AAE9-2AB7-3525-9ECE-A2A7C4688447> /usr/lib/system/libcache.dylib
    0x7fff8e49b000 -     0x7fff8e49dfff  libsystem_coreservices.dylib (19.2) <1B3F5AFC-FFCD-3ECB-8B9A-5538366FB20D> /usr/lib/system/libsystem_coreservices.dylib
    0x7fff8f531000 -     0x7fff8f534fff  libsystem_sandbox.dylib (460.60.4) <71D697CA-7339-37C7-8DAF-3BAA1D57B56A> /usr/lib/system/libsystem_sandbox.dylib
    0x7fff8f5e4000 -     0x7fff8f5ecfff  libcopyfile.dylib (127) <A48637BC-F3F2-34F2-BB68-4C65FD012832> /usr/lib/system/libcopyfile.dylib
    0x7fff8fe62000 -     0x7fff8fe67ff3  libunwind.dylib (35.3) <F6EB48E5-4D12-359A-AB54-C937FBBE9043> /usr/lib/system/libunwind.dylib
    0x7fff90249000 -     0x7fff90249ff7  libunc.dylib (29) <DDB1E947-C775-33B8-B461-63E5EB698F0E> /usr/lib/system/libunc.dylib
    0x7fff902d5000 -     0x7fff902ddfef  libsystem_platform.dylib (74.40.2) <29A905EF-6777-3C33-82B0-6C3A88C4BA15> /usr/lib/system/libsystem_platform.dylib
    0x7fff90dec000 -     0x7fff90e3fff7  libc++.1.dylib (120.1) <8FC3D139-8055-3498-9AC5-6467CB7F4D14> /usr/lib/libc++.1.dylib
    0x7fff91408000 -     0x7fff914f7ffb  libxml2.2.dylib (29.18) <021E7870-E3F8-30CB-B821-F8DAFB543104> /usr/lib/libxml2.2.dylib
    0x7fff914f8000 -     0x7fff91509ff7  libz.1.dylib (61.20.1) <B3EBB42F-48E3-3287-9F0D-308E04D407AC> /usr/lib/libz.1.dylib
    0x7fff91685000 -     0x7fff91686ffb  libremovefile.dylib (41) <552EF39E-14D7-363E-9059-4565AC2F894E> /usr/lib/system/libremovefile.dylib
    0x7fff9233e000 -     0x7fff927b4fff  com.apple.CoreFoundation (6.9 - 1259.22) <53EFA4A7-4614-383E-BEEE-B8B9D9D19FFA> /System/Library/Frameworks/CoreFoundation.framework/Versions/A/CoreFoundation
    0x7fff9385b000 -     0x7fff9385bff7  libkeymgr.dylib (28) <8371CE54-5FDD-3CE9-B3DF-E98C761B6FE0> /usr/lib/system/libkeymgr.dylib
    0x7fff94b2d000 -     0x7fff94b36ff7  libsystem_pthread.dylib (138.10.4) <62FC23B9-1DEE-3918-A30D-A58EC95A0720> /usr/lib/system/libsystem_pthread.dylib
    0x7fff94eda000 -     0x7fff94edcff7  libsystem_configuration.dylib (802.40.13) <B815C622-96EF-388A-823B-B02618E7F190> /usr/lib/system/libsystem_configuration.dylib
    0x7fff950f6000 -     0x7fff9510dff7  libsystem_asl.dylib (323.50.1) <41F8E11F-1BD0-3F1D-BA3A-AA1577ED98A9> /usr/lib/system/libsystem_asl.dylib
    0x7fff954ea000 -     0x7fff954eaff7  liblaunch.dylib (765.70.2) <4B800A8C-6C75-3279-92E0-FBA668812B55> /usr/lib/system/liblaunch.dylib
    0x7fff96ef8000 -     0x7fff96f03ff7  libcommonCrypto.dylib (60075.50.1) <E48A81E7-56B0-37F5-9611-E896B8E16B4D> /usr/lib/system/libcommonCrypto.dylib
    0x7fff97ca0000 -     0x7fff9800b657  libobjc.A.dylib (680) <D55D5807-1FBE-32A5-9105-44D7AFE68C27> /usr/lib/libobjc.A.dylib
    0x7fff98a38000 -     0x7fff98a62ff7  libc++abi.dylib (307.4) <D24E06BF-6522-3C4A-BD0C-11C42BA4D8E8> /usr/lib/libc++abi.dylib
    0x7fff98f03000 -     0x7fff98f49ff7  libauto.dylib (186) <999E610F-41FC-32A3-ADCA-5EC049B65DFB> /usr/lib/libauto.dylib
    0x7fff99292000 -     0x7fff992f8ff7  libsystem_network.dylib (583.50.1) <B52DAB73-92DC-3DA7-B9F4-B899D66445C1> /usr/lib/system/libsystem_network.dylib
    0x7fff993ba000 -     0x7fff993bbfff  libsystem_secinit.dylib (20) <32B1A8C6-DC84-3F4F-B8CE-9A52B47C3E6B> /usr/lib/system/libsystem_secinit.dylib
    0x7fff99812000 -     0x7fff9989ffef  libsystem_c.dylib (1082.60.1) <0F0C7ED5-3902-3427-9C1D-E2F130B528C5> /usr/lib/system/libsystem_c.dylib
    0x7fff9a207000 -     0x7fff9a218ff7  libsystem_trace.dylib (201.10.3) <0ED15BED-B1F8-3845-9EC1-CC0B54B6BF1B> /usr/lib/system/libsystem_trace.dylib
    0x7fff9abdd000 -     0x7fff9abe4ff7  libcompiler_rt.dylib (62) <A13ECF69-F59F-38AE-8609-7B731450FBCD> /usr/lib/system/libcompiler_rt.dylib
    0x7fff9b5dc000 -     0x7fff9b60bfc3  libsystem_m.dylib (3105) <8A645D53-92DD-3C2E-8AFA-F28BC63E3657> /usr/lib/system/libsystem_m.dylib
    0x7fff9b812000 -     0x7fff9b830ff7  libsystem_kernel.dylib (3248.73.11) <4810EB90-DEEB-3E89-9ACA-BECC351E72F0> /usr/lib/system/libsystem_kernel.dylib
    0x7fff9b86c000 -     0x7fff9b875ff3  libsystem_notify.dylib (150.40.1) <D48BDE34-0F7E-34CA-A0FF-C578E39987CC> /usr/lib/system/libsystem_notify.dylib
    0x7fff9ba0f000 -     0x7fff9ba10fff  libDiagnosticMessagesClient.dylib (100) <4243B6B4-21E9-355B-9C5A-95A216233B96> /usr/lib/libDiagnosticMessagesClient.dylib
    0x7fff9bad0000 -     0x7fff9baecff7  libsystem_malloc.dylib (67.40.1) <5748E8B2-F81C-34C6-8B13-456213127678> /usr/lib/system/libsystem_malloc.dylib
    0x7fff9c9b0000 -     0x7fff9caa2ff7  libiconv.2.dylib (44) <F05A0A5A-92A9-3668-8F20-F27CBDA26BE9> /usr/lib/libiconv.2.dylib
    0x7fff9cac1000 -     0x7fff9cac2ffb  libSystem.B.dylib (1226.10.1) <9A358336-F9EE-301B-A00D-D91C591BA684> /usr/lib/libSystem.B.dylib
    0x7fff9cac4000 -     0x7fff9cadbff7  libsystem_coretls.dylib (83.40.5) <C90DAE38-4082-381C-A185-2A6A8B677628> /usr/lib/system/libsystem_coretls.dylib
    0x7fff9cadc000 -     0x7fff9cb09fff  libdispatch.dylib (501.40.12) <C7499857-61A5-3D7D-A5EA-65DCC8C3DF92> /usr/lib/system/libdispatch.dylib
    0x7fff9db4e000 -     0x7fff9dd5bfff  libicucore.A.dylib (551.51.6) <142B2AD5-0A50-3382-8213-096E925863F7> /usr/lib/libicucore.A.dylib
    0x7fff9e3fc000 -     0x7fff9e425fff  libsystem_info.dylib (477.50.4) <FAA9226D-64DE-3769-A6D8-6CABA4B7FF4D> /usr/lib/system/libsystem_info.dylib
    0x7fff9e8fe000 -     0x7fff9e906fff  libsystem_networkextension.dylib (385.40.36) <66095DC7-6539-38F2-95EE-458F15F6D014> /usr/lib/system/libsystem_networkextension.dylib
    0x7fff9ea88000 -     0x7fff9ea8dff7  libmacho.dylib (875.1) <318264FA-58F1-39D8-8285-1F6254EE410E> /usr/lib/system/libmacho.dylib

External Modification Summary:
  Calls made by other processes targeting this process:
    task_for_pid: 1
    thread_create: 0
    thread_set_state: 0
  Calls made by this process:
    task_for_pid: 0
    thread_create: 0
    thread_set_state: 0
  Calls made by all processes on this machine:
    task_for_pid: 11379
    thread_create: 0
    thread_set_state: 0

VM Region Summary:
ReadOnly portion of Libraries: Total=164.9M resident=0K(0%) swapped_out_or_unallocated=164.9M(100%)
Writable regions: Total=347.6M written=0K(0%) resident=0K(0%) swapped_out=0K(0%) unallocated=347.6M(100%)
 
                                VIRTUAL   REGION 
REGION TYPE                        SIZE    COUNT (non-coalesced) 
===========                     =======  ======= 
Activity Tracing                  2048K        2 
Kernel Alloc Once                    4K        2 
MALLOC                           115.3M       21 
MALLOC guard page                   16K        4 
MALLOC_LARGE (reserved)            128K        2         reserved VM address space (unallocated)
Process Corpse Info               2048K        2 
STACK GUARD                       56.0M        3 
Stack                             8712K        3 
VM_ALLOCATE                      219.5M       16 
__DATA                            7096K       48 
__LINKEDIT                       111.8M        4 
__TEXT                            53.0M       48 
__UNICODE                          552K        2 
shared memory                        8K        3 
===========                     =======  ======= 
TOTAL                            575.8M      146 
TOTAL, minus reserved VM space   575.7M      146 

Model: iMac8,1, BootROM IM81.00C1.B00, 2 processors, Intel Core 2 Duo, 2.66 GHz, 4 GB, SMC 1.29f1
Graphics: ATI Radeon HD 2600 Pro, ATI Radeon HD 2600 Pro, PCIe, 256 MB
Memory Module: BANK 0/DIMM0, 2 GB, DDR2 SDRAM, 800 MHz, 0x7F7F7F7F7F5D0000, 0x436F6D707553746F63782843535829000000
Memory Module: BANK 1/DIMM1, 2 GB, DDR2 SDRAM, 800 MHz, 0x7F7F7F7F7F5D0000, 0x436F6D707553746F63782843535829000000
AirPort: spairport_wireless_card_type_airport_extreme (0x14E4, 0x8C), Broadcom BCM43xx 1.0 (5.10.131.39.16)
Bluetooth: Version 4.4.6f4, 3 services, 27 devices, 1 incoming serial ports
Network Service: Ethernet, Ethernet, en0
Serial ATA Device: Hitachi HDP725032GLA380, 320.07 GB
Parallel ATA Device: PIONEER DVD-RW  DVR-K06A
USB Device: USB 2.0 Bus
USB Device: USB 2.0 Bus
USB Device: Built-in iSight
USB Device: USB2.0 Hub
USB Device: USB OPTICAL MOUSE
USB Device: HID compliant keyboard
USB Device: USB Bus
USB Device: BRCM2046 Hub
USB Device: Bluetooth USB Host Controller
USB Device: USB Bus
USB Device: USB Bus
USB Device: USB Bus
USB Device: USB Bus
USB Device: IR Receiver
Thunderbolt Bus: 

I could not find another project triggering this error.
I could not yet determine what exactly in my code triggers this problem.
I found the offending commit but it will take me some time before I get what’s going on.
I’ll see if I can reproduce the issue with minimal code, not sure about it though.
(Where did I read about a “bisect” tool that would try to take care of that?)

I ask if it rings a bell and some advice to find out what I’m doing wrong.

This is almost certainly either a compiler bug and/or LLVM codegen bug. (I also run into it in debug on a project of mine with LLVM 10 builds) What method are you using to obtain Crystal (e.g. Homebrew, the distribution bundle, etc.)? If the distribution bundle, I would try getting it from Homebrew, which uses LLVM 11 I believe, and seeing if its still an issue.

Got the .pkg distribution from the website. Sorry I forgot to post Crystal version. Yes it’s LLVM 10:

Crystal 1.1.1 [6d9a1d583] (2021-07-26)

LLVM: 10.0.0
Default target: x86_64-apple-macosx
rant As for Homebrew, no. I have macOS 10.11.6 and it hates old systems with a passion. I've been happy with it until last year or so, but recently if I upgrade or install anything (which means upgrade something else in practice) it almost consistently clobbers some previously functioning packages, and they say it's by design, so... good bye m*ssing package manager.

It would indeed use LLVM 11 though.

The bright side is, I’ll have to find out what the problem is… or wait next release, whichever comes first.

No problem anyway, some well placed p!s are good enough in most cases.

I think historically the LLVM version has been bumped rarely on the macOS builds since it’s most often just used for bootstrapping the compiler from source for either Homebrew or Nix builds or compiler development (though this seems like a real bug that might warrant a jump if possible), so I wouldn’t necessarily hold out for that

I’m not sure what the macOS version support is for Nix, but perhaps 10.11 is still supported? You could give the Nix builds ago and have a better shot at regular LLVM updates with it. See here to get started: crystal/shell.nix at master · crystal-lang/crystal · GitHub

1 Like

Thanks for pointing me to Nix, looks impressive. I’m still perusing the documentation before going on.
Actually I’ve heard of it before, but for some reason I thought it was only the package manager for the NixOS distro and just bookmarked it in the “maybe will look at this one day” dustbin.
That said, it seems to me that the linked nix script would use LLVM 10.
But if crystal builds with 11 that’s not a problem, I see there are packages for 11 and 12 too.

yep, it should build with 11 okay at this point. I think all the major-showstoppers were fixed, but it looks like the nix script just hasn’t been updated. 12 should be okay on master, but wasn’t merged before 1.1.0 was released, so if you’re building a tagged release it probably won’t work. That being said, since you’re on 10.11, you could also probably pretty safely use all the way back to LLVM 6 no problem.

One thing though: LLVM 11 is only good on Homebrew, and LLVM 12 will not be supported. The reason is that LLVM 11 and 12 are shipped with a bug that prevent Crystal from working properly. The patch exists, but only landed for LLVM 13. The exception is Homebrew’s LLVM 11 because @bcardiff requested HB to add the patch.

3 Likes