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

jpype 1.4.1 on arm platform, coredump when calling byte[] clone method #1119

Open
burnup1900 opened this issue Mar 25, 2023 · 7 comments
Open

Comments

@burnup1900
Copy link

import jpype

def test_coredump():
    start_jvm() # write it by youself
    ByteArray = jpype.JArray(jpype.JByte)
    bytes = ByteArray(b"python_string")
    bytes.clone() # coredump

if __name__ == '__main__':
    test_coredump()
@burnup1900
Copy link
Author

@Thrameos

@Thrameos
Copy link
Contributor

This is odd. I could not replicate on my PC. There was a bug in 1.3 with arrays but that was corrected. The bug also makes not sense as once the byte array is in Java calling clone is just reflection call and it should in no way be connected to "python_string" as the memory would already be transferred. This case is certainly part of our testbench.

I would need a lot more information to make progress. The backtrack on the core dump and the Python version that you are using at minimum.

@burnup1900
Copy link
Author

This is odd. I could not replicate on my PC. There was a bug in 1.3 with arrays but that was corrected. The bug also makes not sense as once the byte array is in Java calling clone is just reflection call and it should in no way be connected to "python_string" as the memory would already be transferred. This case is certainly part of our testbench.

I would need a lot more information to make progress. The backtrack on the core dump and the Python version that you are using at minimum.

Python 3.9.11, openjdk 1.8.0。Are you tested on arm? x86 is ok, only coredump on arm platform

@Thrameos
Copy link
Contributor

I do not currently have access to arm. Did you happen to get a trace back on the core dump. The instructions are in the devel guide.

@burnup1900
Copy link
Author

I do not currently have access to arm. Did you happen to get a trace back on the core dump. The instructions are in the devel guide.

1.py(8):     print(1121)
1121
1.py(9):     bytes = ByteArray(b"python_string")
1.py(10):     print(1121)
1121
1.py(11):     bytes.clone() # coredump
 --- modulename: _jarray, funcname: clone
_jarray.py(125):         return _jpype.JClass("java.util.Arrays").copyOf(self, len(self))
 --- modulename: _jclass, funcname: __new__
_jclass.py(79):         if loader and isinstance(jc, str):
_jclass.py(83):         if isinstance(jc, str) and jc.endswith(">"):
_jclass.py(99):         return _jpype._getClass(jc)
 --- modulename: _jclass, funcname: _jclassPre
_jclass.py(122):     m = list(members.items())
_jclass.py(123):     for k, v in m:
_jclass.py(124):         k2 = pysafe(k)
 --- modulename: _pykeywords, funcname: pysafe
_pykeywords.py(32):     if s.startswith("__"):
_pykeywords.py(34):     if s in _KEYWORDS:
_pykeywords.py(36):     return s
_jclass.py(125):         if k2 != k:
_jclass.py(123):     for k, v in m:
_jclass.py(124):         k2 = pysafe(k)
 --- modulename: _pykeywords, funcname: pysafe
_pykeywords.py(32):     if s.startswith("__"):
_pykeywords.py(34):     if s in _KEYWORDS:
_pykeywords.py(36):     return s
_jclass.py(125):         if k2 != k:
_jclass.py(123):     for k, v in m:
_jclass.py(124):         k2 = pysafe(k)
 --- modulename: _pykeywords, funcname: pysafe
_pykeywords.py(32):     if s.startswith("__"):
_pykeywords.py(34):     if s in _KEYWORDS:

@Thrameos
Copy link
Contributor

This seems like a python referencing error, given the fault was not in JPype code. Does it work for Python 3.8?

@burnup1900
Copy link
Author

This seems like a python referencing error, given the fault was not in JPype code. Does it work for Python 3.8?

but jpype 1.2.1 is ok, just coredump in 1.4.1

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

No branches or pull requests

2 participants