Apple M1: thread 'main' panicked at 'attempt to divide by zero'
See original GitHub issueDescription:
I experience this error: thread 'main' panicked at 'attempt to divide by zero'
when I try to access an endpoint on the function.
Steps to reproduce:
Run sam-beta-cdk local start-api -p <PORT> --skip-pull-image --warm-containers EAGER --debug
Observed result:
2021-08-20 09:00:27,794 | Found one Lambda function with name '<FUNCTION_NAME>'
2021-08-20 09:00:27,794 | Invoking Container created from <FUNCTION_NAME>
2021-08-20 09:00:27,794 | Environment variables overrides data is standard format
2021-08-20 09:00:27,814 | Reuse the created warm container for Lambda function '<FUNCTION_NAME>'
2021-08-20 09:00:27,821 | Lambda function '<FUNCTION_NAME>' is already running
2021-08-20 09:00:27,822 | Starting a timer for 10 seconds for function '<FUNCTION_NAME>'
START RequestId: <REQUEST_ID> Version: $LATEST
thread 'meter_probe' panicked at 'Unable to read /proc for agent process: InternalError(bug at /local/p4clients/pkgbuild-QP4Aq/workspace/build/AWSLogsLambdaInsights/AWSLogsLambdaInsights-1.0.115.0/AL2_x86_64/DEV.STD.PTHREAD/build/private/cargo-home/registry/src/-c477fb05a7ac3d62/procfs-0.7.9/src/process/stat.rs:300 (please report this procfs bug)
Internal Unwrap Error: Internal error: bug at /local/p4clients/pkgbuild-QP4Aq/workspace/build/AWSLogsLambdaInsights/AWSLogsLambdaInsights-1.0.115.0/AL2_x86_64/DEV.STD.PTHREAD/build/private/cargo-home/registry/src/-c477fb05a7ac3d62/procfs-0.7.9/src/lib.rs:285 (please report this procfs bug)
Internal Unwrap Error: NoneError)', src/inputs/memory.rs:59:39
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
thread 'main' panicked at 'attempt to divide by zero', src/inputs/memory.rs:44:32
Expected result:
Return appropriate result from the endpoint
Additional environment details (Ex: Windows, Mac, Amazon Linux etc)
- OS: Big Sur v11.5.1
sam --version
: SAM CLI, version 1.22.0.dev202107140310- AWS region: eu-central-1
Add --debug flag to command you are running
Issue Analytics
- State:
- Created 2 years ago
- Reactions:2
- Comments:7 (2 by maintainers)
Top Results From Across the Web
Apple M1: thread 'main' panicked at 'attempt to divide by zero'
CLI tool to build, test, debug, and deploy Serverless applications using AWS SAM - Apple M1: thread 'main' panicked at 'attempt to divide...
Read more >Macbook Air M1 - kernel panic - Apple Community
Macbook Air M1 - kernel panic. With a slightly higher CPU load (during the game), there are repeated restarts, pink stripes appear on...
Read more >How should I handle f64 division by zero panic elegantly? - help
The Vue "frontend" handles the state of the stack for calculation. Any calculator operations are passed to Rust through Wasm and handled there....
Read more >C++ Core Guidelines - GitHub Pages
0 : Don't panic! Take the time to understand the implications of a guideline rule on your program. These guidelines are designed according...
Read more >Reading a Panic Log in Catalina - The Eclectic Light Company
followed by series of backtrace details is of no use to regular users. Kernel Extensions in backtrace: com.apple.iokit.IOAcceleratorFamily2( ...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
@ssenchenko
This seem to happen across AWS lambda projects that include
LambdaInsightsExtension
. Also see this issue: https://github.com/aws/aws-sam-cli/issues/2469#issuecomment-985550710We have the same issue on M1 macOS and are working around it by detecting the dummy account
123456789012
and not including the insights layer on local incoke.Then
This happens when running:
Log:
I think this is the expected behaviour, if you’re on Apple M1 you should use the arm64 as it pulls the appropriate images to your docker engine, so the LayerVersionArn would be:
!Sub arn:aws:lambda:${AWS::Region}:580247275435:layer:LambdaInsightsExtension-Arm64:2
But then you would have to run your Lambda in arm64 as well