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]: (os/kern) failure (5) #1178

Closed
EmilyMcIver opened this issue Oct 28, 2023 · 2 comments
Closed

[BUG]: (os/kern) failure (5) #1178

EmilyMcIver opened this issue Oct 28, 2023 · 2 comments
Labels
bug Something isn't working crash mojo Issues that are related to mojo mojo-repo Tag all issues with this label mojo-stdlib Tag for issues related to standard library

Comments

@EmilyMcIver
Copy link

EmilyMcIver commented Oct 28, 2023

Bug description

Good Day. I'm trying to use python's list type in parallelized function and I have a lot of different bug reports and sometimes correct output.

My code:

from algorithm import parallelize
from python import Python
# from utils.vector import InlinedFixedVector, DynamicVector


fn main() raises:
    var i_a = A(10)
    let b = i_a.f_1()
    print(b)

struct A:
    var v_1: Int
    var bs: PythonObject
    var rnd: PythonObject

    fn __init__(inout self,v_1: Int) raises:
        self.v_1 = v_1
        self.bs = Python.import_module("builtins")
        self.rnd = Python.import_module("random")


    fn f_1(inout self) raises -> PythonObject:
        var v_1 = self.bs.list()
        for i in range(10):
            _ = v_1.append(0)
        print(v_1)
        @parameter
        fn f_2(indx: Int):
            try:
                print(v_1[indx])
                _ = v_1.__setitem__(indx, self.rnd.randint(0,10))
                pass
            except e:
                pass
            # print(self.a)
        parallelize[f_2](10, 2)
        return v_1

Sometimes it's working properly:

Properly output ex1:

[0, 0, 0, 0, 0, 0, 0, 0, 0, 0]
0
0
0
0
0
0
0
0
0
0
[10, 4, 10, 6, 0, 2, 9, 4, 1, 3]

Errors example (They are always different):

Error ex2:

[0, 0, 0, 0, 0, 0, 0, 0, 0, 0]
00

00

0
Please submit a bug report to https://github.com/modularml/mojo/issues and include the crash backtrace along with all the relevant source codes.
[15490:615973:20231028,131622.799452:WARNING crash_report_exception_handler.cc:257] UniversalExceptionRaise: (os/kern) failure (5)

Error ex3

[0, 0, 0, 0, 0, 0, 0, 0, 0, 0]
00

00

00

00

0
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 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                          0x000000010029d990 llvm::sys::PrintStackTrace(llvm::raw_ostream&, int) + 56
1  mojo                          0x000000010029baf0 llvm::sys::RunSignalHandlers() + 112
2  mojo                          0x000000010029e02c SignalHandler(int) + 344
3  libsystem_platform.dylib      0x000000019af7aa84 _sigtramp + 56
4  Python                        0x00000001100b2300 _PyObject_Malloc + 24
5  Python                        0x00000001100b2300 _PyObject_Malloc + 24
6  Python                        0x00000001100d5fe0 unicode_decode_utf8 + 116
7  Python                        0x00000001100b0600 PyObject_GetAttrString + 72
8  Python                        0x00000002800357fc PyObject_GetAttrString + 6173512260
9  libKGENCompilerRTShared.dylib 0x0000000107afe444 void* std::__1::__thread_proxy[abi:v15006]<std::__1::tuple<std::__1::unique_ptr<std::__1::__thread_struct, std::__1::default_delete<std::__1::__thread_struct>>, void ((anonymous namespace)::WorkQueueThread::*)(), (anonymous namespace)::WorkQueueThread*>>(void*) + 64
10 libsystem_pthread.dylib       0x000000019af4bfa8 _pthread_start + 148
11 libsystem_pthread.dylib       0x000000019af46da0 thread_start + 8
[15461:615773:20231028,131610.839231:WARNING crash_report_exception_handler.cc:257] UniversalExceptionRaise: (os/kern) failure (5)

System information

- MacOS Ventura 13.3.1 MacBook Pro 14 M1 Pro
- mojo 0.4.0 (9e33b013)
- modular 0.2.1 (5144fffe)
@EmilyMcIver EmilyMcIver added bug Something isn't working mojo Issues that are related to mojo labels Oct 28, 2023
@ematejska ematejska added the mojo-lang Tag for all issues related to language. label Oct 29, 2023
@Mogball Mogball added mojo-stdlib Tag for issues related to standard library and removed mojo-lang Tag for all issues related to language. labels Oct 30, 2023
@willghatch
Copy link
Contributor

Thanks for the bug report. I've reproduced this. We'll take a look.

@lattner
Copy link
Collaborator

lattner commented Apr 9, 2024

This works now with many recent changes, thanks!

@lattner lattner closed this as completed Apr 9, 2024
@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 crash mojo Issues that are related to mojo mojo-repo Tag all issues with this label mojo-stdlib Tag for issues related to standard library
Projects
None yet
Development

No branches or pull requests

5 participants