FIX flaky segmentation fault case in CLD2#4
Open
drudim wants to merge 1 commit intocromulentg:masterfrom
Open
Conversation
We catch the next error using `CLD2.detect` on large datasets:
```
A fatal error has been detected by the Java Runtime Environment:
SIGSEGV (0xb) at pc=0x00007f744dc563d3, pid=7, tid=0x00007f749f8f8700
JRE version: Java(TM) SE Runtime Environment (8.0_161-b12) (build 1.8.0_161-b12)
Java VM: Java HotSpot(TM) 64-Bit Server VM (25.161-b12 mixed mode linux-amd64 )
Problematic frame:
C [jni-linux.amd64.so+0x2d3d3]
CLD2::UTF8GenericPropertyTwoByte(CLD2::UTF8StateMachineObj_2 const*, unsigned char const**, int*)+0x103
```
`gdb` shows that we catch some additional noise together with a string passed from Java:
```
buffer=buffer@entry=0x7f940805efc0 "콘 피자랑 큐브 피자.... 대단하시네요... 생각도 못해봤는데... 많이 배우고 갑니다 ㅇㅅㅇb5\002",
```
Note `5\002` sequence in the end.
My best guess - it's caused by missing null terminator.
Local testing prove this theory.
I didn't add this check to `CLD2Test`, because tests aren't determenistic.
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.
We catch the next error using
CLD2.detecton large datasets:gdbshows that we catch some additional noise together with a string passed from Java:Note
5\002sequence in the end.My best guess - it's caused by missing null terminator.
Local testing proves this theory.
I haven't added this check to
CLD2Test, because tests aren't deterministic.