Add a workaround for empty Slice copy SIGSEGV#12850
Add a workaround for empty Slice copy SIGSEGV#12850lukasz-stec wants to merge 1 commit intotrinodb:masterfrom
Conversation
Due to jvm bug, compiled code could fail with SIGSEGV when copying 0 bytes from an empty Slice. This change avoids copy attempt altogether, which additionally increases performance in empty Slice case.
|
|
|
This change may also be considered a performance improvement (avoiding unnecessary work) |
|
Per the Javadoc for Unsafe:
However, I can't see an argument that copying zero bytes should ever try to read from the source, so this does indeed seem like a bug in the JVM. |
|
#12841 is merged, so this workaround shouldn't be needed anymore. |
let's close it. |
|
@lukasz-stec could we keep the test case from this PR to detect this problem more easily in case it reoccurs in future ? |
@raunaqmorarka created #12927 |
Description
Due to jvm bug, compiled code could fail
with SIGSEGV when copying 0 bytes from an empty Slice.
This change avoids copy attempts altogether, which
additionally increases performance in empty Slice case.
fix
core query engine
Avoid worker process crash when using vulnerable JVM version
Related issues, pull requests, and links
SIGSEGVdue to union query #12821Documentation
( ) No documentation is needed.
( ) Sufficient documentation is included in this PR.
( ) Documentation PR is available with #prnumber.
( ) Documentation issue #issuenumber is filed, and can be handled later.
Release notes
( ) No release notes entries required.
( ) Release notes entries required with the following suggested text: