-
Notifications
You must be signed in to change notification settings - Fork 214
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
Messages bigger than 65535 utf code points crash the server #155
Comments
@ppalaga I think the removal of the utf8 encode/decode methods is the cause, so maybe we should revert this commit a71033c#diff-07780342186ffa696b0e9d532cb9e9cf11f62cae11d2980e44c7be22c0619892L332-L419. This is because the DataInputStream uses a 2-byte for the length, while the ones in message were using 4-bytes. |
Interesting! Thanks for the report, @michael-simons! |
Yeah, let me have a look what we can do about this. |
UTF-8 varies in length between 2 and 4. The 💩 emoji for example is a 4 byte utf character I used on various occasions to break things: The serializer looks actually sensible. |
No, I was talking about the length of the string. The DataOutputStream uses an unsigned short (2 bytes) so is limited to 64k. The DataOutputStream code code has the following https://github.com/openjdk-mirror/jdk7u-jdk/blob/master/src/share/classes/java/io/DataOutputStream.java#L363-L365:
|
common/Message
usesDataOutputStream#writeUTF
which throws an expiation if the string to write is longer than 65535 utf code pointshttps://github.com/mvndaemon/mvnd/blob/master/common/src/main/java/org/jboss/fuse/mvnd/common/Message.java#L302
I stumbled upon this while trying
mvnd
with Neo4j-OGM. It happens while our build triggers the Maven Java doc plugin.I was able to reproduce it with the following test:
Having such an output somewhere in the build - doesn't matter via plugin or code - will crash the server.
I wasn't able to reproduce it with exec maven or ant run plugins and the reason is simple: Those plugins redirect sys out line by line. The java doc plugin however collects all the log from the
javadoc
binary and passes it directly to the maven log.That's basically the same like I do in the example above.
I have attached a reproducer.
mvn clean package
works nicely with a lot of useless output,mvnd clean package
will end with:and attached logs.
Reproducer:
mvnd-test.zip
Logs:
logs.zip
The text was updated successfully, but these errors were encountered: