Skip to content

ports/unix: standard build crashes with segfaults often on Apple M1 (macOS Ventura 13.4) #11754

Closed

Description

@ned-pcs

I am unable to get micropython to work on my Mac Mini M1.

I get segfaults very often. 43% of the tests in make test fail.

I have done:

git pull
cd ports/unix
make clean submodules
make

Here's an easy test case:

[ned@Neds-mini [ (git)-[master]-] ports/unix] % build-standard/micropython
MicroPython v1.20.0-189-gfd277704c on 2023-06-10; darwin [GCC 4.2.1] version
Use Ctrl-D to exit, Ctrl-E for paste mode
>>> a = array()
zsh: segmentation fault  build-standard/micropython

I'm running an Apple Mac Mini (M1, 2020) under Ventura 13.4

git commit hash: fd27770
ports/unix
uname -a reports: Darwin Neds-mini 22.5.0 Darwin Kernel Version 22.5.0: Tue Apr 25 04:07:22 PDT 2023; root:xnu-8796.121.2~8/RELEASE_ARM64_T8103 arm64

make test reports almost 50% failed tests:

880 tests performed (28760 individual testcases)
494 tests passed
46 tests skipped: cmd_parsetree native_closure ...
386 tests failed: array1 array_micropython assign_expr_syntaxerror ...
[ned@Neds-mini [ (git)-[master]-] ports/unix] % clang --version
Apple clang version 14.0.3 (clang-1403.0.22.14.1)
Target: arm64-apple-darwin22.5.0
Thread model: posix
InstalledDir: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin

Activity

  1. dlech commented on Jun 11, 2023

    @dlech
    SponsorContributor

    I am able to reproduce the crash. I did a git bisect and traced the introduction of the bug to 2757acf.

    Example stack trace of the crash:

    * thread #1, queue = 'com.apple.main-thread', stop reason = EXC_BAD_ACCESS (code=1, address=0x4000000000300)
      * frame #0: 0x0000000000000300
        frame #1: 0x0000000000000300
        frame #2: 0x00000001001291f8 micropython`fun_bc_call(self_in=0x000000010800e260, n_args=0, n_kw=0, args=0x0000000000000000) at objfun.c:273:42
        frame #3: 0x00000001000a75cc micropython`mp_call_function_n_kw(fun_in=0x000000010800e260, n_args=0, n_kw=0, args=0x0000000000000000) at runtime.c:700:16
        frame #4: 0x00000001000a7554 micropython`mp_call_function_0(fun=0x000000010800e260) at runtime.c:674:12
        frame #5: 0x0000000100324f40 micropython`execute_from_lexer(source_kind=3, source=0x000000016fdff5ba, input_kind=MP_PARSE_FILE_INPUT, is_repl=false) at main.c:152:13
        frame #6: 0x0000000100324ae8 micropython`do_file(file="tests/basics/builtin_sorted.py") at main.c:301:12
        frame #7: 0x0000000100324390 micropython`main_(argc=2, argv=0x000000016fdff378) at main.c:717:19
        frame #8: 0x0000000100323a54 micropython`main(argc=2, argv=0x000000016fdff378) at main.c:468:12
        frame #9: 0x000000019a15ff28 dyld`start + 2236
    
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions