chenBright opened a new pull request, #3703:
URL: https://github.com/apache/brpc/pull/3703
### What problem does this PR solve?
Issue Number: resolve #3014
Problem Summary:
The bundled Snappy implementation can return success with corrupted
decompressed data under
Clang 18 with `-O2`. Integer-pointer casts used for unaligned accesses
introduce undefined behavior,
allowing the compiler to reuse stale loads during overlapping copies.
### What is changed and the side effects?
Changed:
- Backport safe unaligned loads and stores from upstream
[041c608](https://github.com/google/snappy/commit/041c608).
- Adopt the temporary-buffer approach for overlapping copies from upstream
[3c706d2](https://github.com/google/snappy/commit/3c706d2),
retaining brpc's RISC-V aligned fast path.
Side effects:
- Performance effects: Fixed-size `memcpy` operations allow compiler
optimization. No comparative performance benchmark was performed.
- Breaking backward compatibility: None. Public APIs and the Snappy wire
format remain unchanged.
---
### Check List:
- Please make sure your changes are compilable.
- When providing us with a new feature, it is best to add related tests.
- Please follow [Contributor Covenant Code of
Conduct](https://github.com/apache/brpc/blob/master/CODE_OF_CONDUCT.md).
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]