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

Bug: JVM is crashing on startup #4550

Open
srinivas-badam opened this issue Nov 19, 2024 · 9 comments
Open

Bug: JVM is crashing on startup #4550

srinivas-badam opened this issue Nov 19, 2024 · 9 comments
Assignees
Labels
bug Something isn't working

Comments

@srinivas-badam
Copy link

srinivas-badam commented Nov 19, 2024

Kùzu version

version 0.7.0,0.6.0

What operating system are you using?

Windows 10

What happened?

Hi, I am using
Java: Zulu 11
Windows 10

JVM is crashing on database initialisation call, with msvcp140.dll error
EXCEPTION_ACCESS_VIOLATION

Are there known steps to reproduce?

No response

@srinivas-badam srinivas-badam added the bug Something isn't working label Nov 19, 2024
@mewim
Copy link
Member

mewim commented Nov 20, 2024

This seems to be a known OpenJDK issue due to that OpenJDK comes with a different version of msvcp140.dll from the one used to build Kùzu. adoptium/temurin-build#3927
Despite this issue is for Termurin, it seems to also exist in other variants of JDKs such as OpenJDK and Oracle JDK. The workaround is to rename the msvcp140.dll under JDK directory to something like _msvcp140.dll to prevent it from being used.

@srinivas-badam
Copy link
Author

This seems to be a known OpenJDK issue due to that OpenJDK comes with a different version of msvcp140.dll from the one used to build Kùzu. adoptium/temurin-build#3927 Despite this issue is for Termurin, it seems to also exist in other variants of JDKs such as OpenJDK and Oracle JDK. The workaround is to rename the msvcp140.dll under JDK directory to something like _msvcp140.dll to prevent it from being used.

@mewim tried, but no luck. Any possibility we can release new version which can work on azul jdk 11

@mewim
Copy link
Member

mewim commented Nov 22, 2024

This seems to be a known OpenJDK issue due to that OpenJDK comes with a different version of msvcp140.dll from the one used to build Kùzu. adoptium/temurin-build#3927 Despite this issue is for Termurin, it seems to also exist in other variants of JDKs such as OpenJDK and Oracle JDK. The workaround is to rename the msvcp140.dll under JDK directory to something like _msvcp140.dll to prevent it from being used.

@mewim tried, but no luck. Any possibility we can release new version which can work on azul jdk 11

I do not have a Windows setup right now. Will look into it later.

@domidodo
Copy link

domidodo commented Nov 27, 2024

I have the same problem.

#
# A fatal error has been detected by the Java Runtime Environment:
#
#  EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x00007ffbddef2f58, pid=17992, tid=60516
#
# JRE version: OpenJDK Runtime Environment (23.0.1+11) (build 23.0.1+11-39)
# Java VM: OpenJDK 64-Bit Server VM (23.0.1+11-39, mixed mode, sharing, tiered, compressed oops, compressed class ptrs, g1 gc, windows-amd64)
# Problematic frame:
# [thread 33768 also had an error]
[thread 30704 also had an error]
[thread 91372 also had an error]
[thread 59172 also had an error]
[thread 57228 also had an error]
C[thread 77616 also had an error]
[thread 67748 also had an error][thread 14900 also had an error]

[thread 25908 also had an error]
[thread 79188 also had an error]
[thread 56908 also had an error][thread 44172 also had an error]

[thread 80648 also had an error]
[thread 56164 also had an error]  [msvcp140.dll+0x12f58][thread 66840 also had an error]

[thread 94652 also had an error]
[thread 39304 also had an error]
[thread 38212 also had an error]
[thread 14328 also had an error]
[thread 5552 also had an error]

#
# No core dump will be written. Minidumps are not enabled by default on client versions of Windows
#
# An error report file with more information is saved as:
# C:\GIT\repos\spms\src\x\hs_err_pid17992.log
[1.391s][warning][os] Loading hsdis library failed
#
# 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.
#

Process finished with exit code 1

Renaming of the msvcp140.dll-file didn't work :(

@mewim
Copy link
Member

mewim commented Nov 29, 2024

We tried to reproduce the issue on our Windows 11 machine. The issue was reproducible, but the renaming workaround fixed it at our side for both Zulu and Temurin. Our guess is that the operating system you are using also comes with an older version of msvcp140.dll. Can you try to install the latest version here: https://learn.microsoft.com/en-us/cpp/windows/latest-supported-vc-redist?view=msvc-170#latest-microsoft-visual-c-redistributable-version and try again with the workaround?

@domidodo
Copy link

The renaming worked.
It was my mistake. I have multiple Java versions installed and renamed the wrong file. 😅

Is it planned to support the old version of the dll?
The average user of the resulting application usually doesn’t feel comfortable editing dll files.
And it's not so easy to assess what impact this might have on other applications.

@mewim
Copy link
Member

mewim commented Nov 29, 2024

The renaming worked. It was my mistake. I have multiple Java versions installed and renamed the wrong file. 😅

Is it planned to support the old version of the dll? The average user of the resulting application usually doesn’t feel comfortable editing dll files. And it's not so easy to assess what impact this might have on other applications.

It seems that kuzu does not work correctly with VS 2019 (see #4181) so we have to use VS2022, which uses the newest vc-redist package. If we are able to fix #4181 later, we can consider downgrading the toolchain on Windows. But note that Temurin has already included the newer version of DLLs that comes with JDK, and I’d expect other JDK variants to do the same some time, so the problem might be fixed by itself later.

@domidodo
Copy link

domidodo commented Dec 9, 2024

I contacted Azul's support.
They were able to reproduce the issue and are investigating an update for the DLL.

Currently, I am using "Temurin (jdk-11.0.25+9)" but even here, the JDK occasionally crashes, e.g., when I want to use the keyword 'IN' in a query.

Example:

conn.query("CREATE NODE TABLE IF NOT EXISTS Person  (" +
        "id STRING PRIMARY KEY, " +
        "name STRING)");

var nameList = new ArrayList<String>();
nameList.add("John Doe");
nameList.add("Jane Doe");

for(var name : nameList) {
    Map<String, Value> params = new HashMap<>();
    params.put("id", new Value(UUID.randomUUID().toString()));
    params.put("name", new Value(name));

    conn.execute("CREATE (p:Person {id: $id, name: $name})", params);
}

Map<String, Value> params = new HashMap<>();
params.put("names", new Value(nameList));

conn.execute("MATCH  (p:Person) WHERE p.name IN $names RETURN p.name", params);

Report:
hs_err_pid212340.log

The JDK also crashes when I use UUID as an attribute type. As soon as I try to create a node with a UUID. (But this is not as important as the issue with 'IN').

@mewim
Copy link
Member

mewim commented Dec 9, 2024

I contacted Azul's support. They were able to reproduce the issue and are investigating an update for the DLL.

Currently, I am using "Temurin (jdk-11.0.25+9)" but even here, the JDK occasionally crashes, e.g., when I want to use the keyword 'IN' in a query.

Example:

conn.query("CREATE NODE TABLE IF NOT EXISTS Person  (" +
        "id STRING PRIMARY KEY, " +
        "name STRING)");

var nameList = new ArrayList<String>();
nameList.add("John Doe");
nameList.add("Jane Doe");

for(var name : nameList) {
    Map<String, Value> params = new HashMap<>();
    params.put("id", new Value(UUID.randomUUID().toString()));
    params.put("name", new Value(name));

    conn.execute("CREATE (p:Person {id: $id, name: $name})", params);
}

Map<String, Value> params = new HashMap<>();
params.put("names", new Value(nameList));

conn.execute("MATCH  (p:Person) WHERE p.name IN $names RETURN p.name", params);

Report: hs_err_pid212340.log

The JDK also crashes when I use UUID as an attribute type. As soon as I try to create a node with a UUID. (But this is not as important as the issue with 'IN').

The crash due to use IN keyword and UUID type may be different from the JDK issue and likely due to a bug in kuzu core or the JNI binding. We will look into it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants