Skip to content

FIX flaky segmentation fault case in CLD2#4

Open
drudim wants to merge 1 commit intocromulentg:masterfrom
tubular:fix/segmentation-fault
Open

FIX flaky segmentation fault case in CLD2#4
drudim wants to merge 1 commit intocromulentg:masterfrom
tubular:fix/segmentation-fault

Conversation

@drudim
Copy link

@drudim drudim commented Jul 16, 2018

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 proves this theory.
I haven't added this check to CLD2Test, because tests aren't deterministic.

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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant