question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Every time I call import jnius, java crashes and outputs this:

#
# A fatal error has been detected by the Java Runtime Environment:
#
#  SIGBUS (0x7) at pc=0x00007fc1d6823f02, pid=7, tid=0x00007fc1e9c5e700
#
# JRE version:  (8.0_131-b11) (build )
# Java VM: Java HotSpot(TM) 64-Bit Server VM (25.131-b11 mixed mode linux-amd64 compressed oops)
# Problematic frame:
# j  java.lang.Object.<clinit>()V+0
#
# Core dump written. Default location: /usr/src/app/core or core.7
#
# An error report file with more information is saved as:
# /usr/src/app/hs_err_pid7.log
#
# If you would like to submit a bug report, please visit:
#   http://bugreport.java.com/bugreport/crash.jsp
#
Aborted (core dumped)

This only happens on Linux (Ubuntu 16.04 and CentOS 7), it works on macOS. I built a Docker container to reproduce the issue:

FROM python:3.5

RUN wget --header "Cookie: oraclelicense=accept-securebackup-cookie" http://download.oracle.com/otn-pub/java/jdk/8u131-b11/d54c1d3a095b4ff2b6607d096fa80163/jdk-8u131-linux-x64.tar.gz

RUN mkdir /opt/jdk
RUN tar -zxf jdk-8u131-linux-x64.tar.gz -C /opt/jdk

RUN update-alternatives --install /usr/bin/java java /opt/jdk/jdk1.8.0_131/bin/java 100
RUN update-alternatives --install /usr/bin/javac javac /opt/jdk/jdk1.8.0_131/bin/javac 100

ENV JAVA_HOME /opt/jdk/jdk1.8.0_131

RUN pip install Cython
RUN pip install pyjnius

CMD python -c "import jnius"
docker build . -t jniusbug
docker run --rm jniusbug

Crashlog: hs_err_pid8.log.txt

<bountysource-plugin>

Want to back this issue? Post a bounty on it! We accept bounties via Bountysource. </bountysource-plugin>

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:5 (1 by maintainers)

github_iconTop GitHub Comments

1reaction
janselcommented, Jun 24, 2017

A workaround to make it work on newer kernels:

import jnius_config
jnius_config.add_options('-Xss1280k')
import jnius
0reactions
KeyWeeUsrcommented, Dec 15, 2018

Yup, that’s an upstream issue and is documented even on Cloudera Enterprise

If you cannot apply the kernel update, you can set the Java thread stack size to -Xss1280k for the affected services using the appropriate Java configuration option or the environment advanced configuration snippet, as detailed below.

Read more comments on GitHub >

github_iconTop Results From Across the Web

How to crash Linux - LinuxConfig.org
In this tutorial, we show several different methods that can be used to crash a Linux system. We also show how to prevent...
Read more >
crash(8) - Linux manual page - man7.org
Crash is a tool for interactively analyzing the state of the Linux system while it is running, or after a kernel crash has...
Read more >
How to troubleshoot kernel crashes, hangs, or reboots with ...
How to troubleshoot kernel crashes, hangs, or reboots with kdump on Red Hat Enterprise Linux. Solution Verified - Updated November 17 2022 ...
Read more >
Why does my linux keep crashing? - Unix Stack Exchange
I have noticed for some reason (and whether this is true or not, I'm not sure) that Linux is more sensitive to failing...
Read more >
Crash on Linux produces no core or truncated core - IBM
This document outlines what needs to be done to ensure that a full core file is produced on Linux if WebSphere Application Server...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found