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]: (Aborted core dumped) mojo run <file.mojo> #1880

Closed
sneekyfoxx opened this issue Mar 4, 2024 · 1 comment
Closed

[BUG]: (Aborted core dumped) mojo run <file.mojo> #1880

sneekyfoxx opened this issue Mar 4, 2024 · 1 comment
Labels
bug Something isn't working mojo Issues that are related to mojo mojo-repo Tag all issues with this label

Comments

@sneekyfoxx
Copy link

sneekyfoxx commented Mar 4, 2024

Bug description

mojo: /__w/modular/modular/KGEN/lib/LITDialect/LITTypes.cpp:590: static M::KGEN::LIT::LifetimeType M::KGEN::LIT::LifetimeType::get(mlir::TypedAttr): Assertion `isMutable.getType().isSignlessInteger(1) && "isMutable bit should be i1"' failed.
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: mojo run main.mojo
[19729:19730:20240304,105804.634112:ERROR directory_reader_posix.cc:42] opendir /home/sneekyfoxx/.modular/crashdb/attachments/a81c4a39-e172-4b43-aee7-b90a20d5c743: No such file or directory (2)
#0 0x000061244330d4c7 llvm::sys::PrintStackTrace(llvm::raw_ostream&, int) (/home/sneekyfoxx/.modular/pkg/packages.modular.com_max/bin/mojo+0x6394c7)
#1 0x000061244330b09e llvm::sys::RunSignalHandlers() (/home/sneekyfoxx/.modular/pkg/packages.modular.com_max/bin/mojo+0x63709e)
#2 0x000061244330db9f SignalHandler(int) Signals.cpp:0:0
#3 0x000073d38e65a770 (/usr/lib/libc.so.6+0x3c770)
#4 0x000073d38e6ab32c (/usr/lib/libc.so.6+0x8d32c)
#5 0x000073d38e65a6c8 raise (/usr/lib/libc.so.6+0x3c6c8)
#6 0x000073d38e6424b8 abort (/usr/lib/libc.so.6+0x244b8)
#7 0x000073d38e6423dc (/usr/lib/libc.so.6+0x243dc)
#8 0x000073d38e652d46 (/usr/lib/libc.so.6+0x34d46)
#9 0x0000612444a9da37 (/home/sneekyfoxx/.modular/pkg/packages.modular.com_max/bin/mojo+0x1dc9a37)
#10 0x0000612444a5c7cd (anonymous namespace)::LITDialectBytecodeInterface::readType(mlir::DialectBytecodeReader&) const LITDialect.cpp:0:0
#11 0x00006124450387fc (anonymous namespace)::AttrTypeReader::resolveType(unsigned long) BytecodeReader.cpp:0:0
#12 0x0000612445037037 (anonymous namespace)::DialectReader::readType(mlir::Type&) BytecodeReader.cpp:0:0
#13 0x0000612444a5ec51 mlir::LogicalResult mlir::DialectBytecodeReader::readType<M::KGEN::LIT::LifetimeType>(M::KGEN::LIT::LifetimeType&) (/home/sneekyfoxx/.modular/pkg/packages.modular.com_max/bin/mojo+0x1d8ac51)
#14 0x0000612444a5bd5a (anonymous namespace)::LITDialectBytecodeInterface::readAttribute(mlir::DialectBytecodeReader&) const LITDialect.cpp:0:0
#15 0x0000612445037cec (anonymous namespace)::AttrTypeReader::resolveAttribute(unsigned long) BytecodeReader.cpp:0:0
#16 0x0000612445036f97 (anonymous namespace)::DialectReader::readAttribute(mlir::Attribute&) BytecodeReader.cpp:0:0
#17 0x0000612444a5d894 mlir::LogicalResult mlir::DialectBytecodeReader::readAttributemlir::TypedAttr(mlir::TypedAttr&) (/home/sneekyfoxx/.modular/pkg/packages.modular.com_max/bin/mojo+0x1d89894)
#18 0x00006124450ab889 (anonymous namespace)::KGENDialectBytecodeInterface::readAttribute(mlir::DialectBytecodeReader&) const KGENDialect.cpp:0:0
#19 0x0000612445037cec (anonymous namespace)::AttrTypeReader::resolveAttribute(unsigned long) BytecodeReader.cpp:0:0
#20 0x0000612445036f97 (anonymous namespace)::DialectReader::readAttribute(mlir::Attribute&) BytecodeReader.cpp:0:0
#21 0x0000612443928ffa (anonymous namespace)::BuiltinDialectBytecodeInterface::readAttribute(mlir::DialectBytecodeReader&) const BuiltinDialectBytecode.cpp:0:0
#22 0x0000612445037cec (anonymous namespace)::AttrTypeReader::resolveAttribute(unsigned long) BytecodeReader.cpp:0:0
#23 0x0000612445032c6d mlir::BytecodeReader::Impl::parseRegions(std::vector<mlir::BytecodeReader::Impl::RegionReadState, std::allocatormlir::BytecodeReader::Impl::RegionReadState>&, mlir::BytecodeReader::Impl::RegionReadState&) (/home/sneekyfoxx/.modular/pkg/packages.modular.com_max/bin/mojo+0x235ec6d)
#24 0x000061244503023b mlir::BytecodeReader::Impl::parseIRSection(llvm::ArrayRef, mlir::Block*) (/home/sneekyfoxx/.modular/pkg/packages.modular.com_max/bin/mojo+0x235c23b)
#25 0x000061244502d274 mlir::BytecodeReader::Impl::read(mlir::Block*, llvm::function_ref<bool (mlir::Operation*)>) (/home/sneekyfoxx/.modular/pkg/packages.modular.com_max/bin/mojo+0x2359274)
#26 0x00006124437677d6 M::KGEN::LIT::SharedState::createBinaryPackageState(llvm::SMLoc, mlir::StringAttr, llvm::StringRef, M::KGEN::LIT::SharedState::ModuleState&) (/home/sneekyfoxx/.modular/pkg/packages.modular.com_max/bin/mojo+0xa937d6)
#27 0x000061244376593a M::KGEN::LIT::SharedState::importSubModuleState(llvm::StringRef, M::KGEN::LIT::ASTDecl*, llvm::SMLoc) (/home/sneekyfoxx/.modular/pkg/packages.modular.com_max/bin/mojo+0xa9193a)
#28 0x00006124437647e4 M::KGEN::LIT::SharedState::importModuleState(llvm::StringRef, M::KGEN::LIT::ASTDecl*, llvm::SMLoc) (/home/sneekyfoxx/.modular/pkg/packages.modular.com_max/bin/mojo+0xa907e4)
#29 0x00006124437646df M::KGEN::LIT::SharedState::importModule(llvm::StringRef, M::KGEN::LIT::PackageOp, llvm::SMLoc) (/home/sneekyfoxx/.modular/pkg/packages.modular.com_max/bin/mojo+0xa906df)
#30 0x00006124437aad2b M::KGEN::LIT::DeclResolver::importDeclFromModule(M::KGEN::LIT::ASTDecl&, M::KGEN::LIT::PackageOp, mlir::StringAttr, mlir::StringAttr, mlir::StringAttr, llvm::SMLoc, llvm::SMLoc, llvm::SMLoc) (/home/sneekyfoxx/.modular/pkg/packages.modular.com_max/bin/mojo+0xad6d2b)
#31 0x000061244379e200 M::KGEN::LIT::DeclResolver::resolveSignature(M::KGEN::LIT::UnresolvedImportOp, M::KGEN::LIT::ASTDecl&) (/home/sneekyfoxx/.modular/pkg/packages.modular.com_max/bin/mojo+0xaca200)
#32 0x00006124437abdb0 M::KGEN::LIT::DeclResolver::resolve(M::KGEN::LIT::ASTDecl&, M::KGEN::LIT::DeclResolvedness, llvm::SMLoc) (/home/sneekyfoxx/.modular/pkg/packages.modular.com_max/bin/mojo+0xad7db0)
#33 0x00006124437ac198 M::KGEN::LIT::DeclResolver::resolveAllReferencedFrom(M::KGEN::LIT::ASTDecl&) (/home/sneekyfoxx/.modular/pkg/packages.modular.com_max/bin/mojo+0xad8198)
#34 0x0000612443759ecb importMojoImpl(llvm::StringRef, llvm::SourceMgr&, M::KGEN::LIT::SharedState&, mlir::TimingScope&, llvm::SmallVectorImpl<std::__cxx11::basic_string<char, std::char_traits, std::allocator>>, llvm::function_ref<M::KGEN::LIT::ASTDecl& (mlir::ModuleOp)>) EntryPoint.cpp:0:0
#35 0x000061244375a229 M::KGEN::LIT::importMojoFile(llvm::SourceMgr&, M::KGEN::LIT::ParserConfig&, mlir::TimingScope&, llvm::SmallVectorImpl<std::__cxx11::basic_string<char, std::char_traits, std::allocator>>
) (/home/sneekyfoxx/.modular/pkg/packages.modular.com_max/bin/mojo+0xa86229)
#36 0x00006124432d398f mlir::OwningOpRefmlir::ModuleOp llvm::function_ref<mlir::OwningOpRefmlir::ModuleOp (M::KGEN::LIT::ParserConfig&, mlir::TimingScope&)>::callback_fn<run(M::State const&)::$_3>(long, M::KGEN::LIT::ParserConfig&, mlir::TimingScope&) mojo-run.cpp:0:0
#37 0x00006124432b88bb M::invokeMojoParser(M::State const&, llvm::opt::InputArgList const&, M::KGEN::CompilationOptions&, mlir::MLIRContext*, M::LLCL::Runtime&, llvm::opt::OptSpecifier, llvm::opt::OptSpecifier, llvm::opt::OptSpecifier, llvm::function_ref<mlir::OwningOpRefmlir::ModuleOp (M::KGEN::LIT::ParserConfig&, mlir::TimingScope&)>) (/home/sneekyfoxx/.modular/pkg/packages.modular.com_max/bin/mojo+0x5e48bb)
#38 0x00006124432d2c20 run(M::State const&) mojo-run.cpp:0:0
#39 0x00006124432b1cbd main (/home/sneekyfoxx/.modular/pkg/packages.modular.com_max/bin/mojo+0x5ddcbd)
#40 0x000073d38e643cd0 (/usr/lib/libc.so.6+0x25cd0)
#41 0x000073d38e643d8a __libc_start_main (/usr/lib/libc.so.6+0x25d8a)
#42 0x00006124432b160e _start (/home/sneekyfoxx/.modular/pkg/packages.modular.com_max/bin/mojo+0x5dd60e)
Aborted (core dumped)

Steps to reproduce

Example from the Modular website: Modules and Packages

__init__.mojo
from .mymodule import MyPair
mymodule.mojo
struct MyPair:
    var first: Int
    var second: Int

    fn __init__(inout self, first: Int, second: Int):
        self.first = first
        self.second = second

    fn dump(self):
        print(self.first, self.second)
main.mojo
from mypack import MyPair

fn main():
    let mine = MyPair(2, 4)
    mine.dump()

This example also includes a .mojopkg as well

System information

- What OS did you do install Mojo on ?
    Archcraft x86_64: 6.7.8-arch1-1
- Provide version information for Mojo by pasting the output of `mojo -v`
    mojo 24.1.0 (c176f84d)
- Provide Modular CLI version by pasting the output of `modular -v`
    modular 0.5.1 (1b608e3d)
@sneekyfoxx sneekyfoxx added bug Something isn't working mojo Issues that are related to mojo labels Mar 4, 2024
@sneekyfoxx
Copy link
Author

The mypack.mojopkg was built with an older version of mojo and the let keyword should have been var instead. Everything works fine so I'm closing the issue. Sorry for the inconvenience.

@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
bug Something isn't working mojo Issues that are related to mojo mojo-repo Tag all issues with this label
Projects
None yet
Development

No branches or pull requests

2 participants