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

RIE crashes with null pointer dereference after logging AlreadyReserved error #131

Closed
valeneiko opened this issue Jul 19, 2024 · 1 comment

Comments

@valeneiko
Copy link

AWS Lambda runtime interface emulator crashes with null pointer dereference after logging AlreadyReserved error. I was not able to reproduce this locally, but it consistently crashes in our CI.

Here are the logs from the container:

START RequestId: ed9ab7c3-58ce-4bca-926-313ad04e10a2 Version: $LATEST
19 Jul 2024 13:55:28,399 [INFO] (rapid) INVOKE START(requestId: 8a4bf007-ab1b-4650-8773-f17bfaa0ab57)
START RequestId: 9970c39-0b00-4b40-a786-224952815d2a Version: $LATEST
19 Jul 2024 13:55:28,580 [INFO] (rapid) ReserveFailed: AlreadyReserved
panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x30 pc=0x6b3d9f]

goroutine 102 [running]:
go.amzn.com/lambda/rapidcore.(*Server).Invoke.func2()
  /LambdaRuntimeLocal/lambda/rapidcore/server.go:666 +0xdf
created by go.amzn.com/lambda/rapidcore.(*Server).Invoke in goroutine 113
  /LambdaRuntimeLocal/lambda/rapidcore/server.go:649 +0x1f1

Null pointer dereference happens here:

reserveResp, err := s.Reserve("", "", "")
if err != nil {
log.Infof("ReserveFailed: %s", err)
}
invoke.DeadlineNs = fmt.Sprintf("%d", metering.Monotime()+reserveResp.Token.FunctionTimeout.Nanoseconds())

s.Reserve() can return reserveResp = nil in case of an error returned from here:

if s.invokeCtx != nil {
return nil, ErrAlreadyReserved
}

@valeneiko
Copy link
Author

@valeneiko valeneiko closed this as not planned Won't fix, can't repro, duplicate, stale Jul 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant