Fixed
Status Update
Comments
ap...@google.com <ap...@google.com> #2
Project: pigweed/pigweed
Branch: main
Author: Austin Foxley <
Link:
pw_rpc: Fix crash on call cleanup
Expand for full commit details
pw_rpc: Fix crash on call cleanup
The fix for b/371211198 exposed a potential invalid pointer access now
that call fields get properly reset on being reinitialized. Check that
endpoint_ was not cleared while HandlePayload was not holding rpc lock.
Bug: 371211198
Change-Id: I66a146b2e0db5f8c3b0ef50d049e0db342c99095
Reviewed-on: https://pigweed-review.googlesource.com/c/pigweed/pigweed/+/240138
Lint: Lint 🤖 <android-build-ayeaye@system.gserviceaccount.com>
Presubmit-Verified: CQ Bot Account <pigweed-scoped@luci-project-accounts.iam.gserviceaccount.com>
Commit-Queue: Austin Foxley <afoxley@google.com>
Docs-Not-Needed: Austin Foxley <afoxley@google.com>
Reviewed-by: Wyatt Hepler <hepler@google.com>
Files:
- M
pw_rpc/call.cc
Hash: 2e91930eff5ffa17a7f7f5d6a833362194bd1664
Date: Fri Oct 04 20:50:47 2024
ap...@google.com <ap...@google.com> #3
Project: pigweed/pigweed
Branch: main
Author: Austin Foxley <
Link:
pw_rpc: Fix Call not getting reset on default constructor assignment
Expand for full commit details
pw_rpc: Fix Call not getting reset on default constructor assignment
When trying to reinitialize an already used Call object to default,
the move constructor runs but ends up exiting early before actually
resetting the call internal state due to this conditional:
if (!other.active_locked()) {
return; // Nothing else to do; this call is already closed.
}
A default Call has state_ initialized to 0, so active_locked()
returns false so none of the assignments happen on `this`.
We fix this by letting the bulk of the move assignments happen
regardless of active state, except for those parts that apply
specifically to active calls.
Bug: 371211198
Change-Id: I8cb18d06bd91db41822937a57b31351049678222
Reviewed-on: https://pigweed-review.googlesource.com/c/pigweed/pigweed/+/239718
Docs-Not-Needed: Austin Foxley <afoxley@google.com>
Commit-Queue: Austin Foxley <afoxley@google.com>
Reviewed-by: Wyatt Hepler <hepler@google.com>
Lint: Lint 🤖 <android-build-ayeaye@system.gserviceaccount.com>
Files:
- M
pw_rpc/call.cc
- M
pw_rpc/call_test.cc
- M
pw_rpc/pw_rpc_private/fake_server_reader_writer.h
Hash: 05e93dadc080e45d624d92b80879297cfade417c
Date: Fri Oct 04 21:02:00 2024
Description
When trying to reinitialize an already used Call object to default ( this conditional:
call = {};
), the move constructor runs but ends up exiting early before actually resetting thecall
internal state due toA default Call has
state_
initialized to 0, soactive_locked()
returns false so none of the assignments happen onthis
.