mojo icon indicating copy to clipboard operation
mojo copied to clipboard

[BUG] crashes in github testing pipeline and unintelligible error messages

Open martinvuyk opened this issue 9 months ago • 0 comments

Bug description

Description

I'm trying to get a pretty big piece of code done, but it's hard with these error messages. I'm no compiler engineer...

Some previous errors as bizarre as these were solved by linking an alias directly to the struct instead of instantiating as a local function alias for methods in the struct. But now I have no clue where to even begin looking.

Link to code: PR #2623

Error in datetime/fast.mojo

******************** TEST 'Mojo Standard Library :: datetime/test_fast.mojo' FAILED ********************
Exit Code: 1

Command Output (stderr):
--
RUN: at line 13: mojo -debug-level full /Users/runner/work/mojo/mojo/stdlib/test/datetime/test_fast.mojo
+ mojo -debug-level full /Users/runner/work/mojo/mojo/stdlib/test/datetime/test_fast.mojo
<unknown>:0: error: failed to legalize operation 'kgen.param.constant' that was explicitly marked illegal
<unknown>:0: note: see current operation: %42 = "kgen.param.constant"() {value = #interp.store_to_mem<#kgen.struct<{ #kgen.variant<:struct<() memoryOnly> {  }, 0> }> : !kgen.struct<(struct<(variant<struct<() memoryOnly>, struct<(struct<(struct<(struct<(index, index, index, struct<(pointer<none>) memoryOnly>, struct<(pointer<none>, index, index) memoryOnly>) memoryOnly>) memoryOnly>, struct<(struct<(index, index, index, struct<(pointer<none>) memoryOnly>, struct<(pointer<none>, index, index) memoryOnly>) memoryOnly>) memoryOnly>)>) memoryOnly>>) memoryOnly>) memoryOnly>> : !kgen.pointer<struct<(struct<(variant<struct<() memoryOnly>, struct<(struct<(struct<(struct<(index, index, index, struct<(pointer<none>) memoryOnly>, struct<(pointer<none>, index, index) memoryOnly>) memoryOnly>) memoryOnly>, struct<(struct<(index, index, index, struct<(pointer<none>) memoryOnly>, struct<(pointer<none>, index, index) memoryOnly>) memoryOnly>) memoryOnly>)>) memoryOnly>>) memoryOnly>) memoryOnly>>} : () -> !kgen.pointer<struct<(struct<(variant<struct<() memoryOnly>, struct<(struct<(struct<(struct<(index, index, index, struct<(pointer<none>) memoryOnly>, struct<(pointer<none>, index, index) memoryOnly>) memoryOnly>) memoryOnly>, struct<(struct<(index, index, index, struct<(pointer<none>) memoryOnly>, struct<(pointer<none>, index, index) memoryOnly>) memoryOnly>) memoryOnly>)>) memoryOnly>>) memoryOnly>) memoryOnly>>
mojo: error: Failed to materialize symbols: { (exec, { _KGEN_EE_JIT_GlobalDestructor, _main, _KGEN_EE_JIT_GlobalConstructor }) } (from the layer: failed to lower module to LLVM IR for archive compilation)

--

Error in datetime/datetime.mojo

******************** TEST 'Mojo Standard Library :: datetime/test_datetime.mojo' FAILED ********************
Exit Code: 1

Command Output (stderr):
--
RUN: at line 13: mojo -debug-level full /Users/runner/work/mojo/mojo/stdlib/test/datetime/test_datetime.mojo
+ mojo -debug-level full /Users/runner/work/mojo/mojo/stdlib/test/datetime/test_datetime.mojo
/Users/runner/work/mojo/mojo/stdlib/src/builtin/_startup.mojo:136:4: error: function instantiation failed
fn __mojo_main_prototype(
   ^
/Users/runner/work/mojo/mojo/stdlib/src/builtin/_startup.mojo:136:4: note:   call expansion failed - no concrete specializations
fn __mojo_main_prototype(
   ^
/Users/runner/work/mojo/mojo/stdlib/src/builtin/_startup.mojo:91:4: note:     function instantiation failed
fn __wrap_and_execute_raising_main[
   ^
/Users/runner/work/mojo/mojo/stdlib/src/builtin/_startup.mojo:107:[18](https://github.com/modularml/mojo/actions/runs/9085390615/job/24968594003?pr=2623#step:9:19): note:       call expansion failed - no concrete specializations
        main_func()
                 ^
/Users/runner/work/mojo/mojo/stdlib/test/datetime/test_datetime.mojo:314:4: note:         function instantiation failed
fn main() raises:
   ^
/Users/runner/work/mojo/mojo/stdlib/test/datetime/test_datetime.mojo:321:14: note:           call expansion failed - no concrete specializations
    test_hash()
             ^
/Users/runner/work/mojo/mojo/stdlib/test/datetime/test_datetime.mojo:305:4: note:             function instantiation failed
fn test_hash() raises:
   ^
/Users/runner/work/mojo/mojo/stdlib/test/datetime/test_datetime.mojo:311:21: note:               call expansion failed - no concrete specializations
    assert_true(ref == parsed)
                    ^
/Users/runner/work/mojo/mojo/stdlib/src/datetime/datetime.mojo:748:8: note:                 function instantiation failed
    fn __eq__(self, other: Self) -> Bool:
       ^
/Users/runner/work/mojo/mojo/stdlib/src/datetime/datetime.mojo:761:29: note:                   call expansion failed - no concrete specializations
            o = other.to_utc()
                            ^
/Users/runner/work/mojo/mojo/stdlib/src/datetime/datetime.mojo:293:8: note:                     function instantiation failed
    fn to_utc(owned self) -> Self:
       ^
/Users/runner/work/mojo/mojo/stdlib/src/datetime/datetime.mojo:312:37: note:                       call expansion failed - no concrete specializations
            new_self = self.subtract(hours=of_h, minutes=of_m)
                                    ^
/Users/runner/work/mojo/mojo/stdlib/src/datetime/datetime.mojo:515:8: note:                         function instantiation failed
    fn subtract(
       ^
/Users/runner/work/mojo/mojo/stdlib/src/datetime/datetime.mojo:612:28: note:                           call expansion failed - no concrete specializations
            dt = dt.replace(n_second=maxnsec).subtract(
                           ^
/Users/runner/work/mojo/mojo/stdlib/src/datetime/datetime.mojo:221:8: note:                             function instantiation failed
    fn replace(
       ^
/Users/runner/work/mojo/mojo/stdlib/src/utils/variant.mojo:148:8: note:                               function instantiation failed
    fn __init__[T: CollectionElement](inout self, owned value: T):
       ^
/Users/runner/work/mojo/mojo/stdlib/src/utils/variant.mojo:160:49: note:                                 call expansion failed - no concrete specializations
        initialize_pointee_move(self._get_ptr[T](), value^)
                                                ^
/Users/runner/work/mojo/mojo/stdlib/src/utils/variant.mojo:[20](https://github.com/modularml/mojo/actions/runs/9085390615/job/24968594003?pr=2623#step:9:21)4:8: note:                                   function instantiation failed
    fn _get_ptr[T: CollectionElement](self) -> UnsafePointer[T]:
       ^
/Users/runner/work/mojo/mojo/stdlib/src/utils/variant.mojo:207:10: note:                                     constraint failed: not a union element type
        ]()
         ^
mojo: error: failed to run the pass manager

--

Error in datetime/date.mojo

******************** TEST 'Mojo Standard Library :: datetime/test_date.mojo' FAILED ********************
Exit Code: 132

Command Output (stderr):
--
RUN: at line 13: mojo -debug-level full /Users/runner/work/mojo/mojo/stdlib/test/datetime/test_date.mojo
+ mojo -debug-level full /Users/runner/work/mojo/mojo/stdlib/test/datetime/test_date.mojo
[7213:29881:20240514,195814.963894:WARNING crash_report_exception_handler.cc:257] UniversalExceptionRaise: (os/kern) failure (5)
/Users/runner/work/mojo/mojo/build/stdlib/datetime/Output/test_date.mojo.script: line 1:  7211 Illegal instruction: 4  mojo -debug-level full /Users/runner/work/mojo/mojo/stdlib/test/datetime/test_date.mojo

--

Steps to reproduce

  • Include relevant code snippet or link to code that did not work as expected. PR #2623
  • If applicable, add screenshots to help explain the problem.
  • If using the Playground, name the pre-existing notebook that failed and the steps that led to failure.
  • Include anything else that might help us debug the issue.

System information

- What OS did you do install Mojo on ?
On the pipelines for github tests
- Provide version information for Mojo by pasting the output of `mojo -v`
2024.5.1401
- Provide Modular CLI version by pasting the output of `modular -v`

martinvuyk avatar May 14 '24 20:05 martinvuyk