-
Notifications
You must be signed in to change notification settings - Fork 77
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
Fix start offset calculation in mmaped memory area #738
Fix start offset calculation in mmaped memory area #738
Conversation
…offset of mmaped memory
Are there any tests we can add to prevent a regression? |
I think the e2e tests for grpc and http are covering the case of regression espicialy this part which checks the client-server propagation: opentelemetry-go-instrumentation/internal/test/e2e/grpc/verify.bats Lines 48 to 52 in f18c1b2
The bug in this PR can happen approximately once every 50-100 client spans (since page size is 4096 bytes and we write ~40 bytes per request in gRPC for example) |
1-2% of the time isn't insignificant, but I don't think any of our tests are set up for that kind of scenario. Maybe as part of #93 we should update the tests to send more than one span (ideally enough to cross the page threshold). @RonFed just so I understand does this bug cause spans to get dropped by being overwritten in the map when the new address isn't taken into account? |
Right, it can cause spans to get dropped. Additionally in some case it caused invalid characters to override the trace parent header which resulted in a RST_STREAM code in the underlying http2 (in grpc). |
This PR fixes a relatively rare bug that can happen when a write operation to the mmaped area is moving between pages. We didn't take the page-aligned address into account when updating the start offset.