Skip to content
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

JVM crash on macOS. #112

Closed
alex-vas opened this issue Oct 22, 2017 · 5 comments · Fixed by #249
Closed

JVM crash on macOS. #112

alex-vas opened this issue Oct 22, 2017 · 5 comments · Fixed by #249

Comments

@alex-vas
Copy link

hs_err_pid59556.log

@alex-vas
Copy link
Author

alex-vas commented Oct 22, 2017

Seen it once. Other times works seemingly ok.

@pilhuhn
Copy link

pilhuhn commented Jan 3, 2018

I have seen a different crash

get_java_var: invalid file descriptor
#
# A fatal error has been detected by the Java Runtime Environment:
#
#  SIGSEGV (0xb) at pc=0x000000011420cb08, pid=45717, tid=0x0000000000005903
#
# JRE version: Java(TM) SE Runtime Environment (8.0_151-b12) (build 1.8.0_151-b12)
# Java VM: Java HotSpot(TM) 64-Bit Server VM (25.151-b12 mixed mode bsd-amd64 compressed oops)
# Problematic frame:
# C  [libNRJavaSerial.jnilib+0x5b08]  read_byte_array+0x58
#

@kaikreuzer
Copy link
Contributor

Just came across the very same:

get_java_var: invalid file descriptor
#
# A fatal error has been detected by the Java Runtime Environment:
#
#  SIGSEGV (0xb) at pc=0x0000000110690b08, pid=31464, tid=0x0000000000010d07
#
# JRE version: Java(TM) SE Runtime Environment (8.0_112-b16) (build 1.8.0_112-b16)
# Java VM: Java HotSpot(TM) 64-Bit Server VM (25.112-b16 mixed mode bsd-amd64 compressed oops)
# Problematic frame:
# C  [libNRJavaSerial.jnilib+0x5b08]  read_byte_array+0x58
#

@madhephaestus
Copy link
Member

Depends on #163

@madhephaestus
Copy link
Member

check new binaries in 5.0.0

claui pushed a commit to dbsystel/nrjavaserial that referenced this issue Jan 8, 2024
The `get_java_var_long` function returns 0 in several failure modes,
e.g. if a file descriptor is unavailable. [1]

However, one of the call sites is missing the result check, which causes
a JVM segfault if the return value is 0. The segfault occurs on
dereferencing the pointer: [2]

```c
eis->eventflags[SPE_DATA_AVAILABLE]
```

Add a result value check, throwing a proper IOException if it is 0.

See also similar issue NeuronRobotics#59. [3]

Fixes NeuronRobotics#112 [4], NeuronRobotics#136 [5] and NeuronRobotics#242 [6].

[1]: https://github.com/NeuronRobotics/nrjavaserial/blob/0df8b60485a56d7698b71183237b5615d02a8194/src/main/c/src/SerialImp.c#L5137-L5142
[2]: https://github.com/NeuronRobotics/nrjavaserial/blob/0df8b60485a56d7698b71183237b5615d02a8194/src/main/c/src/SerialImp.c#L3085
[3]: NeuronRobotics#59
[4]: NeuronRobotics#112
[5]: NeuronRobotics#136
[6]: NeuronRobotics#242

Reported-by: Alex Vasiliev <@alex-vas>
Reported-by: Łukasz Dywicki <luke@code-house.org>
Reported-by: Jose Pacelli <josepacelli@gmail.com>
Reported-by: Frank Hartwig <frank.fr.hartwig@deutschebahn.com>
claui pushed a commit to dbsystel/nrjavaserial that referenced this issue Jan 8, 2024
The `get_java_var_long` function returns 0 in several failure modes,
e.g. if a file descriptor is unavailable. [1]

However, one of the call sites is missing the result check, which causes
a JVM segfault if the return value is 0. The segfault occurs on
dereferencing the pointer: [2]

```c
eis->eventflags[SPE_DATA_AVAILABLE]
```

Add a result value check, throwing a proper IOException if it is 0.

See also similar issue NeuronRobotics#59. [3]

Fixes NeuronRobotics#112 [4], NeuronRobotics#136 [5] and NeuronRobotics#242 [6].

[1]: https://github.com/NeuronRobotics/nrjavaserial/blob/0df8b60485a56d7698b71183237b5615d02a8194/src/main/c/src/SerialImp.c#L5137-L5142
[2]: https://github.com/NeuronRobotics/nrjavaserial/blob/0df8b60485a56d7698b71183237b5615d02a8194/src/main/c/src/SerialImp.c#L3085
[3]: NeuronRobotics#59
[4]: NeuronRobotics#112
[5]: NeuronRobotics#136
[6]: NeuronRobotics#242

Reported-by: Alex Vasiliev <@alex-vas>
Reported-by: Łukasz Dywicki <luke@code-house.org>
Reported-by: Jose Pacelli <josepacelli@gmail.com>
Reported-by: Frank Hartwig <frank.fr.hartwig@deutschebahn.com>
claui pushed a commit to dbsystel/nrjavaserial that referenced this issue Feb 8, 2024
The `get_java_var_long` function returns 0 in several failure modes,
e.g. if a file descriptor is unavailable. [1]

However, one of the call sites is missing the result check, which causes
a JVM segfault if the return value is 0. The segfault occurs on
dereferencing the pointer: [2]

```c
eis->eventflags[SPE_DATA_AVAILABLE]
```

Add a result value check, throwing a proper IOException if it is 0.

See also similar issue NeuronRobotics#59. [3]

Fixes NeuronRobotics#112 [4], NeuronRobotics#136 [5] and NeuronRobotics#242 [6].

[1]: https://github.com/NeuronRobotics/nrjavaserial/blob/0df8b60485a56d7698b71183237b5615d02a8194/src/main/c/src/SerialImp.c#L5137-L5142
[2]: https://github.com/NeuronRobotics/nrjavaserial/blob/0df8b60485a56d7698b71183237b5615d02a8194/src/main/c/src/SerialImp.c#L3085
[3]: NeuronRobotics#59
[4]: NeuronRobotics#112
[5]: NeuronRobotics#136
[6]: NeuronRobotics#242

Reported-by: Alex Vasiliev <@alex-vas>
Reported-by: Łukasz Dywicki <luke@code-house.org>
Reported-by: Jose Pacelli <josepacelli@gmail.com>
Reported-by: Frank Hartwig <frank.fr.hartwig@deutschebahn.com>
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 a pull request may close this issue.

4 participants