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.

Windows 10 Home 64bit: Tests as well as minimum example fail with fatal JRE error

See original GitHub issue

I am not very familiar with windows but in order to distribute a python package that depends on PyJNIus on all major OSes (Windows, OSX, Linux) I tried to build PyJNIus on a Windows 10 Home Edition 64 bit machine.

I obtained python 3 through conda and followed (roughly) these steps:

 - Install conda
 - Install PyJNIus dependencies through conda and/or pip
 - Install OpenJDK `1.8.0_131`
 - install Apache ant
 - install visual cpp build tools
 - Instead of make run commands in Makefile by hand
   - `ant all`
   - `python setup.py build_ext --inplace -f`
   - for tests:
     - `cd tests`
     - `set CLASSPATH=..\build\test-classes;..\build\classes`
     - `set PYTHONPATH=..`
     - `nosetests -v > nosetests.log 2>&1` (compare nosetests.log in this gist)

The last command (nosetests) triggers this error message (I skipped the nosetests output but you can find that here:

#
# A fatal error has been detected by the Java Runtime Environment:
#
#  EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x00007fff4facdff4, pid=13156, tid=0x0000000000002f84
#
# JRE version: Java(TM) SE Runtime Environment (8.0_131-b11) (build 1.8.0_131-b11)
# Java VM: Java HotSpot(TM) 64-Bit Server VM (25.131-b11 mixed mode windows-amd64 compressed oops)
# Problematic frame:
# C  [jnius.cp36-win_amd64.pyd+0x1dff4]
#
# Failed to write core dump. Minidumps are not enabled by default on client versions of Windows
#
# An error report file with more information is saved as:
# C:\Users\Zottel\Downloads\pyjnius-master\pyjnius-master\tests\hs_err_pid13156.log
#
# If you would like to submit a bug report, please visit:
#   http://bugreport.java.com/bugreport/crash.jsp
# The crash happened outside the Java Virtual Machine in native code.
# See problematic frame for where to report the bug.
#

Similarly, when I try to implement a Java interface in Python and pass it to a Java method like this:

# See fail.log for error message
import jnius_config
jnius_config.add_classpath(r'C:\Users\Zottel\git\pyjnius\build\pyjnius.jar')
from jnius import PythonJavaClass, java_method, autoclass
class AddOne( PythonJavaClass ):
    __javainterfaces__ = ['java/util/function/IntUnaryOperator']
    def __init__(self):
        super( AddOne, self ).__init__()
    @java_method('(I)I')
    def applyAsInt( self, operand ):
        return operand + 1
    
stream = autoclass('java.util.stream.IntStream').range( 0, 10 )
ao = AddOne()
stream.map( ao ).toArray()

I see this failure mode:

#
# A fatal error has been detected by the Java Runtime Environment:
#
#  EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x00007fff4a2adff4, pid=10772, tid=0x0000000000000ff4
#
# JRE version: Java(TM) SE Runtime Environment (8.0_131-b11) (build 1.8.0_131-b11)
# Java VM: Java HotSpot(TM) 64-Bit Server VM (25.131-b11 mixed mode windows-amd64 compressed oops)
# Problematic frame:
# C  [jnius.cp36-win_amd64.pyd+0x1dff4]
#
# Failed to write core dump. Minidumps are not enabled by default on client versions of Windows
#
# An error report file with more information is saved as:
# C:\Users\Zottel\hs_err_pid10772.log
#
# If you would like to submit a bug report, please visit:
#   http://bugreport.java.com/bugreport/crash.jsp
# The crash happened outside the Java Virtual Machine in native code.
# See problematic frame for where to report the bug.
#

I collected all of the above in a gist: https://gist.github.com/hanslovsky/69ab3d007c09749ce400b678829eea18

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Reactions:1
  • Comments:7 (3 by maintainers)

github_iconTop GitHub Comments

2reactions
madhawavcommented, Jul 7, 2017

+1 having the same issue on Windows 10 Pro 64 bit with Python 3.6 and JDK 8.

2reactions
hanslovskycommented, Jul 3, 2017

One and a half weeks ago, @skalarproduktraum helped me debugging this issue a little more and we were able to narrow it down and I assume now that these lines in jnius/jnius_proxy.pxi and these lines in jnius/jnius_conversion.pxi cause the issue. Unfortunately, I do not have a windows machine, so I do not know when I will be able to follow up on this.

Could you comment on whether or not this is an issue that is relevant for the kivy core developers? If I am not mistaken, pyjnius was developed with Android/Unix in mind so Windows support might be limited.

Read more comments on GitHub >

github_iconTop Results From Across the Web

A fatal error has been detected by the Java ... - Stack Overflow
1.Set the following Environment Property on your active Shell. - open bash terminal and type in: $ export LD_BIND_NOW=1. Re-Run the Jar or...
Read more >
A fatal error has been detected by the Java Runtime ...
It says that this browser in windows 10 will not run java. use internet explorer 11 or fire fox. I'm using windows edge,...
Read more >
Known Issues for JDK 8 - Oracle
The workaround is to uninstall the existing 32-bit JRE and install it again. The "Enable Java Access Bridge" check box will appear after...
Read more >
How to Resolve Java Crashes and Java Out of Memory Errors ...
Navigate to the JRE download site at http://www.oracle.com/technetwork/java/javase/downloads/jre8-downloads-2133155.html. Accept the licensing agreement and ...
Read more >
Anypoint Studio Crashing - When Opening Template or ...
But for every one of us (whether using Windows 7 or Windows 10), ... "Open an Example Project" or "Open Template", the Anypoint...
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