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

Load class error #1127

Open
for-just-we opened this issue Apr 22, 2023 · 3 comments
Open

Load class error #1127

for-just-we opened this issue Apr 22, 2023 · 3 comments

Comments

@for-just-we
Copy link

I try to load class from cpg, when I load its dependencies. For example

jpype.addClassPath("libs/slf4j-api-2.0.5-sources.jar")
jpype.addClassPath("libs/slf4j-api-2.0.5.jar")

jpype.addClassPath("libs/log4j-api-2.19.0.jar")
jpype.addClassPath("libs/log4j-core-2.19.0.jar")
jpype.addClassPath("libs/log4j-slf4j2-impl-2.19.0.jar")

jpype.addClassPath("libs/org.eclipse.equinox.common-3.17.0.jar")
jpype.addClassPath("libs/org.eclipse.core.runtime-3.26.0.jar")
jpype.addClassPath("libs/core-8.0.0.202211292120.jar")


LoggerFactory = jpype.JClass("org.slf4j.LoggerFactory")
String = jpype.JClass('java.lang.String')
# 调用 Java 方法
result = String('Hello, JPype!').toLowerCase()
# 打印结果
print(result)


GCCLanguage = jpype.JClass("org.eclipse.cdt.core.dom.ast.gnu.c.GCCLanguage")
dialect = GCCLanguage.getDefault()

Everything works fine. However, when I load a class from cpg,

jpype.addClassPath("libs/cpg-core-6.1.0.jar")
TranslationConfiguration = jpype.JClass("de.fraunhofer.aisec.cpg.TranslationConfiguration")

Error occured, the message is:

#
# A fatal error has been detected by the Java Runtime Environment:
#
#  EXCEPTION_UNCAUGHT_CXX_EXCEPTION (0xe06d7363) at pc=0x00007ffbb587cb69, pid=13456, tid=13752
#
# JRE version: OpenJDK Runtime Environment (17.0.2+8) (build 17.0.2+8-86)
# Java VM: OpenJDK 64-Bit Server VM (17.0.2+8-86, mixed mode, sharing, tiered, compressed oops, compressed class ptrs, g1 gc, windows-amd64)
# Problematic frame:
# C  [KERNELBASE.dll+0x2cb69]
#
# No core dump will be written. Minidumps are not enabled by default on client versions of Windows
#
# If you would like to submit a bug report, please visit:
#   https://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.
#

---------------  S U M M A R Y ------------

Command Line: 

Host: Intel(R) Core(TM) i7-9750H CPU @ 2.60GHz, 12 cores, 15G,  Windows 10 , 64 bit Build 19041 (10.0.19041.2788)
Time: Sat Apr 22 20:18:10 2023 �й���׼ʱ�� elapsed time: 0.934590 seconds (0d 0h 0m 0s)

How could I fix this? Are this correlated to the fact that lib cpg is built in java 17 and written in kotlin?

@Thrameos
Copy link
Contributor

Seems like the library has a native component and it didnt match the system. But that is only a guess.

@mei71
Copy link

mei71 commented Aug 5, 2023

Have you solved your problem? I have the same problem.

@for-just-we
Copy link
Author

Have you solved your problem? I have the same problem.

No, I still haven't found out.

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

3 participants