Repository navigation
Conversation
Signed-off-by: Jaehong Park <[email protected]>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #1036.
MessageBuffer.putByteBuffercan copy the wrong bytes from a sliced heap source, overwrite bytes before a sliced heap destination when reading a read-only source, or repeatedly overwrite the first destination byte when copying a read-only heap source into direct storage.Include the source/destination array offsets and advance the direct destination address for each byte. Add a 64-case regression matrix across heap/direct storage, read-only sources, source/destination slices, and empty/partial copies. The assertions also cover untouched destination bytes and source position, limit, and mark. Ten cases fail before the fix; all pass afterward with both the default and universal buffer implementations.
Validation:
./sbt -batch scalafmtCheckAll jcheckStyleand./sbt -batch 'msgpack-core/testFull'passed (257 tests, 1 existing pending test).TEST_JAVA_HOMEset to the Java 8 installation and the session settingset msgpackCore / javacOptions ++= Seq("-bootclasspath", "<jdk8>/jre/lib/rt.jar"). Without this setting, the build reused production classes linked against Java 9+ covariant NIO methods and failed withNoSuchMethodErroron Java 8.JAVA_TOOL_OPTIONS=-Dmsgpack.universal-buffer=true): all 64 new cases passed. The full core suite had one existingDirectBufferAccessTestinitialization error becauseMessageBuffer.unsafeis null; an isolated initialization probe fails identically against the original and patched classes.MessageBufferclass: the shared fixture uses JUnit 4 lifecycle annotations while the affected tests use Jupiter annotations.No build settings or unrelated test fixtures are changed in this PR.