Solved Java, frequent segfaults

tOsYZYny

Active Member

Reaction score: 7
Messages: 195

I have been noticing I am having frequent segfaults when I run a utility to format my java code. I am using a shell script that wraps google java format and runs 10 processes in parallel via xarg. I am guessing that by running 10 processes in parallel that use the same jar file, I am having this problem.

If the jar file is opened read-only, why would it matter if I'm accessing it 10 times in parallel? All of my java code formats are done on different files, so they shouldn't be interfering with one another.
Code:
#
# A fatal error has been detected by the Java Runtime Environment:
#
#  SIGSEGV (0xb) at pc=0x000000080118ddae, pid=22778, tid=993361
#
# JRE version: OpenJDK Runtime Environment (15.0.2+7) (build 15.0.2+7-1)
# Java VM: OpenJDK 64-Bit Server VM (15.0.2+7-1, mixed mode, sharing, tiered, compressed oops, g1 gc, bsd-amd64)
# Problematic frame:
# C  [libc.so.7+0xc8dae]  localeconv_l+0xbe
#
# No core dump will be written.
#
# An error report file with more information is saved as:
# <HOME_DIR>/projects/localhost/programming/java/parent/hs_err_pid22778.log

[error occurred during error reporting ((null)), id 0xb, SIGSEGV (0xb) at pc=0x000000080118ddae]
 

SirDice

Administrator
Staff member
Administrator
Moderator

Reaction score: 11,600
Messages: 37,927

If the jar file is opened read-only, why would it matter if I'm accessing it 10 times in parallel?
Because it might not be designed to run concurrently. You can run into all sorts of race or locking issues.
All of my java code formats are done on different files, so they shouldn't be interfering with one another.
Sure, but the code that does the parsing might keep track of various things in a way that makes it impossible to run concurrently. One process might be interfering with the data of another.
 
OP
T

tOsYZYny

Active Member

Reaction score: 7
Messages: 195

Good points, after thinking about it more, the limit will likely be disk I/O anyways so, multiple threads may not help anyways.
 

SirDice

Administrator
Staff member
Administrator
Moderator

Reaction score: 11,600
Messages: 37,927

Can you link to the code of that utility? It might still be interesting to see what exactly is causing it to crash. It might be easily fixable, or maybe not. But without looking at the actual code we can only guess what the problem might be. The issues I mentioned are common issues you might run into. It may not be the problem with this particular utility.
 

Jose

Daemon

Reaction score: 857
Messages: 1,033

Anything of interest in the hs_err_pid22778.log? The JVM should not segfault like that. You may have found a bug in it.
 
Top