Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Modular CLI]: segmentation fault in WSL #1057

Closed
sangshuduo opened this issue Oct 14, 2023 · 6 comments
Closed

[Modular CLI]: segmentation fault in WSL #1057

sangshuduo opened this issue Oct 14, 2023 · 6 comments
Labels
modular-cli modular tool issues mojo-repo Tag all issues with this label

Comments

@sangshuduo
Copy link

Issue description

run the command "modular install mojo" then modular CLI segfault.

Steps to reproduce

  • Include relevant code snippet that did not work as expected.
  • If applicable, add screenshots to help explain the problem.
  • Include anything else that might help us debug the issue.

$ modular auth mut_cbdd6b39a2564135bd0b19fab4XXXXXX && modular install mojo
loc("#M.target<triple = \22x86_64-unknown-linux\22, cpu = \22tigerlake\22, features = \22+64bit,+adx,+aes,+avx,+avx2,+avx512bitalg,+avx512bw,+avx512cd,+avx512dq,+avx512f,+avx512ifma,+avx512vbmi,+avx512vbmi2,+avx512vl,+avx512vnni,+avx512vp2intersect,+avx512vpopcntdq,+bmi,+bmi2,+clflushopt,+clwb,+cmov,+crc32,+cx16,+cx8,+f16c,+fma,+fsgsbase,+fxsr,+gfni,+invpcid,+kl,+lzcnt,+mmx,+movbe,+movdir64b,+movdiri,+pclmul,+pku,+popcnt,+prfchw,+rdpid,+rdrnd,+rdseed,+sahf,+sgx,+sha,+shstk,+sse,+sse2,+sse3,+sse4.1,+sse4.2,+ssse3,+vaes,+vpclmulqdq,+widekl,+x87,+xsave,+xsavec,+xsaveopt,+xsaves\22, data_layout = \22e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128\22, simd_bit_width = 512>":1:50): error: duplicate or unknown struct parameter name: cpu
[7048:7048:20231014,122042.380838:ERROR file_io_posix.cc:144] open /sys/devices/system/cpu/cpu0/cpufreq/scaling_cur_freq: No such file or directory (2)
[7048:7048:20231014,122042.380892:ERROR file_io_posix.cc:144] open /sys/devices/system/cpu/cpu0/cpufreq/scaling_max_freq: No such file or directory (2)
Please submit a bug report to https://github.com/modularml/mojo/issues and include the crash backtrace along with all the relevant source codes.
Stack dump:
0. Program arguments: modular install mojo
#0 0x00005624bdce8bb7 (/usr/bin/modular+0x4eebb7)
#1 0x00005624bdce686e (/usr/bin/modular+0x4ec86e)
#2 0x00005624bdce927f (/usr/bin/modular+0x4ef27f)
#3 0x00007fb663b35520 (/lib/x86_64-linux-gnu/libc.so.6+0x42520)
#4 0x00005624be0a6434 (/usr/bin/modular+0x8ac434)
#5 0x00005624be0a5abf (/usr/bin/modular+0x8ababf)
#6 0x00005624bdcadc22 (/usr/bin/modular+0x4b3c22)
#7 0x00005624bdcacd75 (/usr/bin/modular+0x4b2d75)
#8 0x00005624bdcaaec3 (/usr/bin/modular+0x4b0ec3)
#9 0x00007fb663b1cd90 (/lib/x86_64-linux-gnu/libc.so.6+0x29d90)
#10 0x00007fb663b1ce40 __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x29e40)
#11 0x00005624bdcaa55e (/usr/bin/modular+0x4b055e)
Segmentation fault

Version Info

- Provide Modular CLI version by pasting the output of `modular -v`
- What OS did you install modular CLI on ?

$ modular -v
modular 0.2.0 (355ea9c0)

$ cat /etc/issue
Ubuntu 22.04.3 LTS \n \l

$ uname -a
Linux shuduo-vaio 5.15.90.1-microsoft-standard-WSL2 #1 SMP Fri Jan 27 02:56:13 UTC 2023 x86_64 x86_64 x86_64 GNU/Linux
@ShuzhaoFeng
Copy link

ShuzhaoFeng commented Oct 16, 2023

Encountered the same issue when updating from 0.2.1 to 0.4.0.

Full stack trace:

modular install mojo
loc("#M.target<triple = \22x86_64-unknown-linux\22, cpu = \22alderlake\22, features = \22+64bit,+adx,+aes,+avx,+avx2,+avxvnni,+bmi,+bmi2,+cldemote,+clflushopt,+clwb,+cmov,+crc32,+cx16,+cx8,+f16c,+fma,+fsgsbase,+fxsr,+gfni,+hreset,+invpcid,+kl,+lzcnt,+mmx,+movbe,+movdir64b,+movdiri,+pclmul,+pconfig,+pku,+popcnt,+prfchw,+ptwrite,+rdpid,+rdrnd,+rdseed,+sahf,+serialize,+sgx,+sha,+shstk,+sse,+sse2,+sse3,+sse4.1,+sse4.2,+ssse3,+vaes,+vpclmulqdq,+waitpkg,+widekl,+x87,+xsave,+xsavec,+xsaveopt,+xsaves\22, data_layout = \22e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128\22, simd_bit_width = 256>":1:50): error: duplicate or unknown struct parameter name: cpu
[659:659:20231016,112644.385266:ERROR file_io_posix.cc:144] open /sys/devices/system/cpu/cpu0/cpufreq/scaling_cur_freq: No such file or directory (2)
[659:659:20231016,112644.385322:ERROR file_io_posix.cc:144] open /sys/devices/system/cpu/cpu0/cpufreq/scaling_max_freq: No such file or directory (2)
Please submit a bug report to https://github.com/modularml/mojo/issues and include the crash backtrace along with all the relevant source codes.
Stack dump:
0.      Program arguments: modular install mojo
 #0 0x000056471ba0cbb7 (/usr/bin/modular+0x4eebb7)
 #1 0x000056471ba0a86e (/usr/bin/modular+0x4ec86e)
 #2 0x000056471ba0d27f (/usr/bin/modular+0x4ef27f)
 #3 0x00007f3904996520 (/lib/x86_64-linux-gnu/libc.so.6+0x42520)
 #4 0x000056471bdca434 (/usr/bin/modular+0x8ac434)
 #5 0x000056471bdc9abf (/usr/bin/modular+0x8ababf)
 #6 0x000056471b9d1c22 (/usr/bin/modular+0x4b3c22)
 #7 0x000056471b9d0d75 (/usr/bin/modular+0x4b2d75)
 #8 0x000056471b9ceec3 (/usr/bin/modular+0x4b0ec3)
 #9 0x00007f390497dd90 (/lib/x86_64-linux-gnu/libc.so.6+0x29d90)
#10 0x00007f390497de40 __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x29e40)
#11 0x000056471b9ce55e (/usr/bin/modular+0x4b055e)
Segmentation fault

modular uninstall mojo will trigger the same error:

modular uninstall mojo
loc("#M.target<triple = \22x86_64-unknown-linux\22, cpu = \22alderlake\22, features = \22+64bit,+adx,+aes,+avx,+avx2,+avxvnni,+bmi,+bmi2,+cldemote,+clflushopt,+clwb,+cmov,+crc32,+cx16,+cx8,+f16c,+fma,+fsgsbase,+fxsr,+gfni,+hreset,+invpcid,+kl,+lzcnt,+mmx,+movbe,+movdir64b,+movdiri,+pclmul,+pconfig,+pku,+popcnt,+prfchw,+ptwrite,+rdpid,+rdrnd,+rdseed,+sahf,+serialize,+sgx,+sha,+shstk,+sse,+sse2,+sse3,+sse4.1,+sse4.2,+ssse3,+vaes,+vpclmulqdq,+waitpkg,+widekl,+x87,+xsave,+xsavec,+xsaveopt,+xsaves\22, data_layout = \22e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128\22, simd_bit_width = 256>":1:50): error: duplicate or unknown struct parameter name: cpu
[940:940:20231016,112756.714869:ERROR file_io_posix.cc:144] open /sys/devices/system/cpu/cpu0/cpufreq/scaling_cur_freq: No such file or directory (2)
[940:940:20231016,112756.714921:ERROR file_io_posix.cc:144] open /sys/devices/system/cpu/cpu0/cpufreq/scaling_max_freq: No such file or directory (2)
Please submit a bug report to https://github.com/modularml/mojo/issues and include the crash backtrace along with all the relevant source codes.
Stack dump:
0.      Program arguments: modular uninstall mojo
 #0 0x000055edbe84ebb7 (/usr/bin/modular+0x4eebb7)
 #1 0x000055edbe84c86e (/usr/bin/modular+0x4ec86e)
 #2 0x000055edbe84f27f (/usr/bin/modular+0x4ef27f)
 #3 0x00007f7befab4520 (/lib/x86_64-linux-gnu/libc.so.6+0x42520)
 #4 0x000055edbec0c434 (/usr/bin/modular+0x8ac434)
 #5 0x000055edbec0babf (/usr/bin/modular+0x8ababf)
 #6 0x000055edbe82381d (/usr/bin/modular+0x4c381d)
 #7 0x000055edbe810ec3 (/usr/bin/modular+0x4b0ec3)
 #8 0x00007f7befa9bd90 (/lib/x86_64-linux-gnu/libc.so.6+0x29d90)
 #9 0x00007f7befa9be40 __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x29e40)
#10 0x000055edbe81055e (/usr/bin/modular+0x4b055e)
Segmentation fault

Modular version: modular 0.2.0 (355ea9c0)
Mojo current version: mojo 0.2.1 (64d14e85)
Mojo target version: mojo 0.4.0
System Specs:

Distributor ID: Ubuntu
Description:    Ubuntu 22.04.2 LTS
Release:        22.04
Codename:       jammy

CPU specs:

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):                  16
  On-line CPU(s) list:   0-15
Vendor ID:               GenuineIntel
  Model name:            12th Gen Intel(R) Core(TM) i7-1270P
    CPU family:          6
    Model:               154
    Thread(s) per core:  2
    Core(s) per socket:  8
    Socket(s):           1
    Stepping:            3
    BogoMIPS:            4992.01
    Flags:               fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clfl
                         ush mmx fxsr sse sse2 ss ht syscall nx pdpe1gb rdtscp lm constant_tsc rep_go
                         od nopl xtopology tsc_reliable nonstop_tsc cpuid pni pclmulqdq vmx ssse3 fma
                          cx16 pcid sse4_1 sse4_2 x2apic movbe popcnt tsc_deadline_timer aes xsave av
                         x 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 smap clflushopt clwb sha_ni xsa
                         veopt 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:                   384 KiB (8 instances)
  L1i:                   256 KiB (8 instances)
  L2:                    10 MiB (8 instances)
  L3:                    18 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 seq
                         uence
  Srbds:                 Not affected
  Tsx async abort:       Not affected

Also tried uninstalling & reinstall modular, didn't work neither.

@jackos
Copy link
Collaborator

jackos commented Oct 18, 2023

Potentially related to: #1002

@smuniraj2018
Copy link

@sangshuduo - Please update to WSL2 and do a fresh install and let us know if you still see this

@sangshuduo
Copy link
Author

@sangshuduo - Please update to WSL2 and do a fresh install and let us know if you still see this

C:> wsl -l -v
NAME STATE VERSION

  • Ubuntu Running 2
    docker-desktop Stopped 2
    docker-desktop-data Stopped 2

Sorry, it's my primary work environment so I can't do a fresh install. Please let me know if any info I can provide for you to debug.

@ShuzhaoFeng
Copy link

@smuniraj2018 I have tried to fresh installed it and this time it works fine.

I didn't document my installation steps for the first installation where it crashes, but here's what I did for the second installation:

#!/bin/bash

password="assume password here"
auth="assume auth here"

# install python
echo "$password" | sudo -S apt update
echo "$password" | sudo -S apt install python3.10
echo "$password" | sudo -S apt install python3.10-venv

# install modular
curl https://get.modular.com | \
  MODULAR_AUTH=$auth \
  sh -
echo "$password" | sudo -S apt update
echo "$password" | sudo -S apt install modular

# install mojo
modular install mojo
echo 'export MODULAR_HOME="$HOME/.modular"' >> ~/.bashrc
echo 'export PATH="$MODULAR_HOME/pkg/packages.modular.com_mojo/bin:$PATH"' >> ~/.bashrc
source ~/.bashrc

# test your installation
# create a new hello world file
mkdir Mojo
cd Mojo
echo "fn main():
    print(\"Hello, World!\")" > hello.mojo

# run the file
mojo run hello.mojo

# and it worked

I didn't really "run" this script because this script I wrote would somehow skip the python-env installation (I'm not experienced enough to understand why), so I ran it manually, one or a few command at each time.

@sangshuduo
Copy link
Author

inspired by #1087 (comment) I removed ~/.modular directory and installed python3.10-venv, then used "modular auth XXXX && modular install mojo" now mojo 0.4.0 is installed.

@ematejska ematejska added the mojo-repo Tag all issues with this label label May 6, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
modular-cli modular tool issues mojo-repo Tag all issues with this label
Projects
None yet
Development

No branches or pull requests

5 participants