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

[BUG] Compiler crash #3175

Open
thk686 opened this issue Jul 4, 2024 · 2 comments
Open

[BUG] Compiler crash #3175

thk686 opened this issue Jul 4, 2024 · 2 comments
Labels
bug Something isn't working mojo-repo Tag all issues with this label

Comments

@thk686
Copy link

thk686 commented Jul 4, 2024

Bug description

mojo crashed!
Please file a bug report.
[74988:472339:20240704,090451.090041:WARNING in_range_cast.h:38] value -634136515 out of range
[74988:472339:20240704,090451.093831:WARNING crash_report_exception_handler.cc:257] UniversalExceptionRaise: (os/kern) failure (5)
zsh: segmentation fault  '.modular/pkg/packages.modular.com_nightly_mojo/bin/mojo' 

If I had to guess, I'd say an unterminated loop that led to index overflow.

Steps to reproduce

Clone MojoSci (dynobs branch) and run this file. I often add a main at the bottom to quickly verify code changes. I left it uncommented in this branch for testing.

System information

Host Information
  ================

  Target Triple: aarch64-unknown-macosx
  CPU: apple-m2
  CPU Features: aes, bf16, complxnum, crc, dotprod, fp-armv8, fp16fml, fullfp16, i8mm, jsconv, lse, neon, pauth, ras, rcpc, rdm, sha2, sha3
Darwin cns-f-biokeittth 23.5.0 Darwin Kernel Version 23.5.0: Wed May  1 20:19:05 PDT 2024; root:xnu-10063.121.3~5/RELEASE_ARM64_T8112 arm64
mojo 2024.7.205 (c28defd8)
@thk686 thk686 added bug Something isn't working mojo-repo Tag all issues with this label labels Jul 4, 2024
@sam99dave
Copy link

sam99dave commented Jul 7, 2024

Also, facing the crash issue but mostly for a different reason

fn __mul__(inout self, inout other: Float32):
      var tmp = Value(other)
      var child = List[Value](self, tmp)
      var out = Value(self.data * tmp.data, child, '*')
      fn _backward() raises -> None:
          self.grad  = other.grad * out.grad    
          other.grad  = self.grad * out.grad
      out._backward = _backward
      return out`

Over here, I forgot to replace other.grad with tmp.grad. It just crashes in such cases.

@thk686
Copy link
Author

thk686 commented Jul 7, 2024

1.      Crash resolving decl body at loc("/Users/tkeitt/Desktop/MojoSci/src/diffeq/runga_kutta.mojo":31:8)
    >> struct RKFixedStepper[Strategy: ExplicitRK, Sys: DESys, n: Int](StateStepper):
              ^......................................................................
    >>     """Stepper for explicit Runga-Kutta strategies."""
    >>     alias StateType = ColVec[n]
    >> 
    >>     var state: Self.StateType
Stack dump without symbol names (ensure you have llvm-symbolizer in your PATH or set the environment var `LLVM_SYMBOLIZER_PATH` to point to it):
0  mojo                     0x00000001048781c0 llvm_strlcpy   55076
1  mojo                     0x0000000104876568 llvm_strlcpy   47820
2  mojo                     0x0000000104878860 llvm_strlcpy   56772
3  libsystem_platform.dylib 0x000000018a36f584 _sigtramp   56
4  mojo                     0x0000000104b2d520 __jit_debug_register_code   76912
5  mojo                     0x0000000104bcf0b4 __jit_debug_register_code   739332
6  mojo                     0x0000000104b433b8 __jit_debug_register_code   166664
7  mojo                     0x0000000104b4fb88 __jit_debug_register_code   217816
8  mojo                     0x0000000104b50054 __jit_debug_register_code   219044
9  mojo                     0x0000000104b597d0 __jit_debug_register_code   257824
10 mojo                     0x0000000104b59a08 __jit_debug_register_code   258392
11 mojo                     0x00000001047c4830
12 mojo                     0x00000001047d667c
13 mojo                     0x00000001047bf414
14 dyld                     0x0000000189fb60e0 start   2360
mojo crashed!
Please file a bug report.
[22014:1301381:20240707,133749.340650:WARNING in_range_cast.h:38] value -634136515 out of range
[22014:1301381:20240707,133749.346141:WARNING crash_report_exception_handler.cc:257] UniversalExceptionRaise: (os/kern) failure (5)
[22014:1301382:20240707,133749.347313:ERROR crash_report_database_mac.mm:753] open lock /Users/tkeitt/.modular/crashdb/pending/3ed57a29-c99b-4150-850c-03193ee79c00.dmp: Resource temporarily unavailable (35)
zsh: segmentation fault  '/Users/tkeitt/.modular/pkg/packages.modular.com_nightly_mojo/bin/mojo' 

mojo 2024.7.705 (3d1f7817)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working mojo-repo Tag all issues with this label
Projects
None yet
Development

No branches or pull requests

2 participants