roc-lang / basic-cli

A basic Command-Line Interface platform
Universal Permissive License v1.0
80 stars 27 forks source link

http-get example crashes on compilation #42

Closed Ivo-Balbaert closed 1 year ago

Ivo-Balbaert commented 1 year ago

Hi all, with the latest nightly built from source on Ubuntu 20 (WSL), running this example hangs the Rust compiler:

$ roc http-get.roc
thread 'main' panicked at 'assertion failed: !self.not_reference_counted.contains(symbol)', crates/compiler/mono/src/inc_dec.rs:98:13
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
^C

It does this for : packages { pf: "https://github.com/roc-lang/basic-cli/releases/download/0.3.2/tE4xS_zLdmmxmHwHih9kHWQ7fsXtJr7W7h3425-eZFk.tar.br" }

as well as for this version: packages { pf: "../src/main.roc" }

Any idea what could be wrong here? Thanks!

Anton-4 commented 1 year ago

Hmm, I test all basic-cli examples on Ubuntu 20.04 every time a new nightly is released, so I suspect this may be a wsl specific issue. Can you share the output of the lscpu command (in Ubuntu)?

Ivo-Balbaert commented 1 year ago

Thanks for reacting so quickly. Here is the output: $ lscpu Architecture: x86_64 CPU op-mode(s): 32-bit, 64-bit Address sizes: 46 bits physical, 48 bits virtual Byte Order: Little Endian CPU(s): 24 On-line CPU(s) list: 0-23 Vendor ID: GenuineIntel Model name: 12th Gen Intel(R) Core(TM) i9-12900K CPU family: 6 Model: 151 Thread(s) per core: 2 Core(s) per socket: 12 Socket(s): 1 Stepping: 2 BogoMIPS: 6374.40 Flags: fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush mmx fxsr sse sse2 ss ht syscall nx pdpe1gb rdtscp lm constant_tsc rep_good nopl xtopolog y tsc_reliable nonstop_tsc cpuid pni pclmulqdq vmx ssse3 fma cx16 pcid sse4_1 sse4_2 x2apic movbe popcnt tsc_deadline_timer aes xsave avx f16c rdrand hypervisor lahf_lm abm 3dnowprefetch invpcid_single ssbd ibrs ibpb stibp ibrs_enhanced tpr_shadow vnmi ept vpid ept_ad fsgsbase tsc_adjust bmi1 avx2 smep bmi2 erms invpcid rdseed adx sma p clflushopt clwb sha_ni xsaveopt xsavec xgetbv1 xsaves avx_vnni umip waitpkg gfni vaes vpclmulqdq rdpid movdiri movdir64b fsrm serialize flush_l1d arch_capabilities Virtualization features: Virtualization: VT-x Hypervisor vendor: Microsoft Virtualization type: full Caches (sum of all): L1d: 576 KiB (12 instances) L1i: 384 KiB (12 instances) L2: 15 MiB (12 instances) L3: 30 MiB (1 instance) Vulnerabilities: Itlb multihit: Not affected L1tf: Not affected Mds: Not affected Meltdown: Not affected Mmio stale data: Not affected Retbleed: Mitigation; Enhanced IBRS Spec store bypass: Mitigation; Speculative Store Bypass disabled via prctl and seccomp Spectre v1: Mitigation; usercopy/swapgs barriers and __user pointer sanitization Spectre v2: Mitigation; Enhanced IBRS, IBPB conditional, RSB filling, PBRSB-eIBRS SW sequence Srbds: Not affected Tsx async abort: Not affected

Anton-4 commented 1 year ago

No red flags there, I'll try to reproduce this on WSL soon.

Anton-4 commented 1 year ago

I was not able to reproduce this with roc_nightly-linux_x86_64-2023-06-02-58067f9 on WSL with Ubuntu 20.04.6 LTS from the microsoft store.

I'll open an issue on roc-lang/roc and get in touch with the person who wrote the line crates/compiler/mono/src/inc_dec.rs:98 to discuss next steps.

Ivo-Balbaert commented 1 year ago

Issue is solved. I used 'cargo build' to build a Roc binary which still had debug_asserts in it, and one of them made the program crash. A Roc binary build with 'cargo build --release' works fine with this program.