qemu: uncaught target signal 4 (Illegal instruction) - core dumped

See original GitHub issue

This is an issue with the apple M1 processor and was performed on a new MacBook Air.

Steps to reproduce

  1. Create a hello world app using sam init - below are the options I selected

         $ sam init
                 Which template source would you like to use?
                     1 - AWS Quick Start Templates
                 	2 - Custom Template Location
                 Choice: 1
                 What package type would you like to use?
                     1 - Zip (artifact is a zip uploaded to S3)	
        	         2 - Image (artifact is an image uploaded to an ECR image repository)
                 Package type: 1

        Which runtime would you like to use?
            1 - nodejs14.x
        	2 - python3.8
        	3 - ruby2.7
            4 - go1.x
        	5 - java11
            6 - dotnetcore3.1
        	7 - nodejs12.x
            8 - nodejs10.x
        	9 - python3.7
            10 - python3.6
        	11 - python2.7
            12 - ruby2.5
        	13 - java8.al2
            14 - java8
        	15 - dotnetcore2.1
        Runtime: 2

        Project name [sam-app]: 

        Cloning app templates from https://github.com/aws/aws-sam-cli-app-templates

        AWS quick start application templates:
            1 - Hello World Example
        	2 - EventBridge Hello World
            3 - EventBridge App from scratch (100+ Event Schemas)
        	4 - Step Functions Sample App (Stock Trader)
            5 - Elastic File System Sample App
        Template selection: 1

            -----------------------
            Generating application:
            -----------------------
            Name: sam-app
            Runtime: python3.8
            Dependency Manager: pip
            Application Template: hello-world
            Output Directory: .
   
            Next steps can be found in the README file at ./sam-app/README.md
  1. cd to sam-app
  2. add awswrangler to hello_world/requirements.txt
  3. add import awswrangler as wr to hello_world/app.py
  4. increase the timeout in template.yaml to 300
Globals:
        Function:
          Timeout: 300
  1. build with sam build --cached --parallel --use-container
  2. run locally sam local invoke HelloWorldFunction
$ sam local invoke HelloWorldFunction           
Invoking app.lambda_handler (python3.8)
Skip pulling image and use local one: amazon/aws-sam-cli-emulation-image-python3.8:rapid-1.22.0.

Mounting /Users/bartspedden/work/a/sam-app/.aws-sam/build/HelloWorldFunction as /var/task:ro,delegated inside runtime container
START RequestId: e7c8bbe4-ee64-4e67-a01b-2bbb43c7872c Version: $LATEST
qemu: uncaught target signal 4 (Illegal instruction) - core dumped
time="2021-04-14T19:39:38.787" level=error msg="Init failed" InvokeID= error="Runtime exited with error: signal: illegal instruction"
time="2021-04-14T19:39:38.794" level=error msg="INIT DONE failed: Runtime.ExitError"
  1. and then to validate that things work without awswrangler you can edit hello_world/app.py and remove the awswrangler import.
  2. build with sam build --cached --parallel --use-container
  3. run locally sam local invoke HelloWorldFunction
$ sam local invoke HelloWorldFunction           
Invoking app.lambda_handler (python3.8)
Skip pulling image and use local one: amazon/aws-sam-cli-emulation-image-python3.8:rapid-1.22.0.

Mounting /Users/bartspedden/work/a/sam-app/.aws-sam/build/HelloWorldFunction as /var/task:ro,delegated inside runtime container
START RequestId: 305c2ee9-6396-49cd-bf6a-a7a43da2ecd8 Version: $LATEST
END RequestId: 305c2ee9-6396-49cd-bf6a-a7a43da2ecd8
REPORT RequestId: 305c2ee9-6396-49cd-bf6a-a7a43da2ecd8	Init Duration: 1.51 ms	Duration: 416.29 ms	Billed Duration: 500 ms	Memory Size: 128 MB	Max Memory Used: 128 MB	
{"statusCode": 200, "body": "{\"message\": \"hello world\"}"}%    

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:8 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
bart-gcscommented, May 3, 2021

Thanks @jaidisido, this has resolved our issue!

1reaction
maxispeichercommented, Apr 23, 2021

Maybe also this issue goes a little bit more into the details about the Mac M1 processor. It seems to be somehow related to docker images which are not specifically build for arm.

Read more comments on GitHub >

github_iconTop Results From Across the Web

qemu: uncaught target signal 4 (Illegal instruction) - core ...
The solution is to build a docker container for ARM platform. 1 BroderickHigby reacted with rocket emoji.
Read more >
[Cross compilation] qemu: uncaught target signal 4 (Illegal ...
[Cross compilation] qemu: uncaught target signal 4 (Illegal instruction) - core dumped. Host environment. QEMU flavor: (mips64el-binfmt-P); QEMU ...
Read more >
Airflow 2.0 on AppleM1 Machine: `qemu: uncaught target ...
qemu : uncaught target signal 4 (Illegal Instructions) - core dumped. This is typically not an issue for users running Airflow 1.10.x.
Read more >
uncaught target signal 4 (Illegal instructio...” : Bugs : QEMU
I'm getting Illegal instruction (core dumped) when running the attached a.out_err binary in qemu, but when using Gdb to remote-debug the program ...
Read more >
qemu: uncaught target signal 4 (Illegal instruction) b
[Bug 1914021] Re: qemu: uncaught target signal 4 (Illegal instruction) b ... Bug description: I'm getting Illegal instruction (core dumped) ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found