-
Notifications
You must be signed in to change notification settings - Fork 99
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
Runtime error: invalid memory address or nil pointer dereference #97
Comments
Hey @tcmbilozub
|
Temporarily solved this problem by downgrading to a lower version.
|
Having same issue with simultaneous requests under python 3.8
|
I too am hitting this when making simultaneous requests. Is there any workaround other than downgrading to an old version? |
The offending code is here It checks if |
The permanent link for this code section is: aws-lambda-runtime-interface-emulator/lambda/rapidcore/server.go Lines 661 to 666 in d37e08c
I looked at this code, and I'm not sure as to what a good fix might be. One possibility would be to pull the aws-lambda-runtime-interface-emulator/lambda/rapidcore/server.go Lines 577 to 594 in a08886c
… but it seems undoing that would contravene the intent behind moving the AWS, can someone please comment on what your plans are for addressing this regression? |
Any updates on this? Makes testing locally impossible for some use cases. |
Thank you, @tcmbilozub , for this workaround. With the earlier version you identified at least the first request made can complete (tested with python 3.11). Given its effect on concurrency and the popularity of lambda, I'm surprised this regression hasn't garnered more attention by now. Someone once said "speed matters in business." AWS lambda team, please consider prioritizing this for your customers. |
As alluded to above, downgrading isn't really a solution, since it'll still error '[INFO] (rapid) ReserveFailed: AlreadyReserved', it just won't panic on it. The issue seems to be that aws-lambda-runtime-interface-emulator/lambda/rapidcore/server.go Lines 159 to 199 in 71388dd
but I'm not that familiar with Go, nevermind this project, and I don't know the solution. Are you able to comment @valerena? |
I believe I have a fix/workaround (?) in #133. |
The situation here is that for requests running in the Lambda service in the cloud, there will never be concurrent requests, because Lambda manages concurrent requests in different sandboxes/environments that don't interact with each other (therefore different instances of the Lambda Runtime API). This emulator package is a close representation of what's actually executed in the real Lambda hosts, and that's why the concurrent use case is not supported here either. About the proposed fix, it's modifying behavior that is coming from that internal functionality, and we try to not have deviations on that side. We will analyze it a bit more, to see if we can come up with a solution that works well for the local invocations, but without affecting the actual execution in the real Lambda environments. |
The following error occurs when executing several simultaneous requests:
19 Jun 2023 22:05:39,909 [INFO] (rapid) ReserveFailed: AlreadyReserved
panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x30 pc=0x68c30f]
goroutine 131 [running]:
go.amzn.com/lambda/rapidcore.(*Server).Invoke.func2()
/LambdaRuntimeLocal/lambda/rapidcore/server.go:653 +0xef
created by go.amzn.com/lambda/rapidcore.(*Server).Invoke
/LambdaRuntimeLocal/lambda/rapidcore/server.go:636 +0x23d
Docker image: public.ecr.aws/lambda/python:3.8
The text was updated successfully, but these errors were encountered: