Skip to content
This repository has been archived by the owner on Aug 5, 2021. It is now read-only.

Calling jpy.get_type() too many times causes a memory access error #74

Closed
dpallison83 opened this issue Nov 9, 2016 · 4 comments
Closed

Comments

@dpallison83
Copy link

Running jpy 0.9, ran into this problem (running Windows):

Process finished with exit code -1073741819 (0xC0000005)

briefly googling, appears this is a memory access error code, which is easily reproducible like so

import jpy
for i in range(200):
    jpy.get_type("java.lang.String")

The number of iterations it takes to bring up the error varies by class. I'd try to fix it myself, but I'm no expert with C.

@forman forman added the bug label Nov 11, 2016
@forman
Copy link
Member

forman commented Nov 11, 2016

Thanks for reporting this. Hope to fix it ASAP.

@forman forman added the blocker label Nov 11, 2016
@voutilad
Copy link
Contributor

I can confirm it's an issue on macOS as well, so it's platform independent. Better error message, though:

Running /Users/dave/src/sisu-llc/jpy/src/test/python/jpy_gettype_test.py
....python(93039,0x7fffb94183c0) malloc: *** error for object 0x10f74a010: pointer being freed was not allocated
*** set a breakpoint in malloc_error_break to debug
setting environment variable 'PYTHONPATH' to None
1 Python unit test(s) failed. Installation is likely broken.

voutilad added a commit to voutilad/jpy that referenced this issue Feb 23, 2017
…d java type instances and trying to decrement their reference counts, but they were never incremented. Added calls to Py_INCREF before returning the java types.
voutilad added a commit to voutilad/jpy that referenced this issue Feb 23, 2017
…d java type instances and trying to decrement their reference counts, but they were never incremented. Added calls to Py_INCREF before returning the java types.
@voutilad
Copy link
Contributor

See PR. Looks like a reference counting issue. The joys of embedded Python!

forman added a commit that referenced this issue Mar 8, 2017
@bcdev
Copy link
Collaborator

bcdev commented May 3, 2017

Seems to be fixed now. Carefully closing it.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants