-
Bug
-
Resolution: External
-
P4
-
None
-
19
-
x86_64
-
linux_ubuntu
ADDITIONAL SYSTEM INFORMATION :
$ java --version
openjdk 11.0.24 2024-07-16
OpenJDK Runtime Environment (build 11.0.24+8-post-Ubuntu-1ubuntu320.04)
OpenJDK 64-Bit Server VM (build 11.0.24+8-post-Ubuntu-1ubuntu320.04, mixed mode, sharing)
$ devbox version
0.13.5
$ nix-channel --list
https://nixos.org/channels/nixos-24.05
$ nix --version
nix (Nix) 2.18.1
$ neofetch:
OS: Ubuntu 20.04.6 LTS x86_64
Host: TensorBook (late 2021) 7.04
Kernel: 5.15.0-122-generic
Uptime: 20 days, 21 hours, 30 mins
Packages: 3492 (dpkg), 47 (nix-user), 6 (snap)
Shell: bash 5.2.15
Resolution: 2560x1440
DE: GNOME
WM: Mutter
WM Theme: Adwaita
Theme: Adwaita-dark [GTK2/3]
Icons: Yaru [GTK2/3]
Terminal: devbox
CPU: 11th Gen Intel i7-11800H (16) @ 4.600GHz
GPU: Intel Device 9a60
GPU: NVIDIA 01:00.0 NVIDIA Corporation Device 249c
Memory: 8119MiB / 64048MiB
A DESCRIPTION OF THE PROBLEM :
Using kotlin-native to compile hello world segfaults every time:
$ kotlinc-native hello.kt
#
# A fatal error has been detected by the Java Runtime Environment:
#
# SIGSEGV (0xb) at pc=0x00007eff660cd463, pid=1065494, tid=1065495
#
# JRE version: OpenJDK Runtime Environment (19.0.2+7) (build 19.0.2+7-nixos)
# Java VM: OpenJDK 64-Bit Server VM (19.0.2+7-nixos, mixed mode, emulated-client, sharing, tiered, compressed oops, compressed class ptrs, g1 gc, linux-amd64)
# Problematic frame:
# V [libjvm.so+0x560463] AccessInternal::PostRuntimeDispatch<G1BarrierSet::AccessBarrier<548964ul, G1BarrierSet>, (AccessInternal::BarrierType)0, 548964ul>::oop_access_barrier(void*, oopDesc*)+0x53
#
# Core dump will be written. Default location: Core dumps may be processed with "/usr/share/apport/apport -p%p -s%s -c%c -d%d -P%P -u%u -g%g -- %E" (or dumping to /home/sami/code/local_scratch/try-kotlin/core.1065494)
#
# An error report file with more information is saved as:
# /home/sami/code/local_scratch/try-kotlin/hs_err_pid1065494.log
#
# If you would like to submit a bug report, please visit:
# https://bugreport.java.com/bugreport/crash.jsp
#
/nix/store/h09gcvss0n9n1a3s5b8wfmn5sh878lss-kotlin-native-1.9.10/bin/.run_konan-wrapped: line 82: 1065494 Aborted (core dumped) LIBCLANG_DISABLE_CRASH_RECOVERY=1 $TIMECMD "$JAVACMD" "${java_opts[@]}" "${java_args[@]}" -cp "$KONAN_CLASSPATH" "$TOOL_CLASS" "$TOOL_NAME" "${konan_args[@]}"
=======
The file hello.kt:
// Hello world in Kotlin multiplatform
fun main(args: Array<String>) {
println("Hello world!")
}
This environment is devbox 0.13.5, a shell over Nix. Contents of devbox.json:
{
"$schema": "https://raw.githubusercontent.com/jetify-com/devbox/0.13.5/.schema/devbox.schema.json",
"packages": [
"kotlin-native"
],
"shell": {
"init_hook": [
"echo 'Welcome to devbox!' > /dev/null"
],
"scripts": {
"test": [
"echo \"Error: no test specified\" && exit 1"
]
}
}
}
STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
To repro:
1. Install devbox (curl -fsSL https://get.jetify.com/devbox | bash)
2. mkdir try-kotlin; cd try-kotlin
devbox init
vim devbox.json # change packages: [] to packages: ["kotlin-native"]
devbox shell
vim hello.kt
// Hello world in Kotlin multiplatform
fun main(args: Array<String>) {
println("Hello world!")
}
3. $ kotlinc-native hello.kt
# SIGSEGV (0xb) at pc=0x00007f79425d6463, pid=...
ACTUAL -
$ kotlinc-native hello.kt
#
# A fatal error has been detected by the Java Runtime Environment:
#
# SIGSEGV (0xb) at pc=0x00007eff660cd463, pid=1065494, tid=1065495
#
# JRE version: OpenJDK Runtime Environment (19.0.2+7) (build 19.0.2+7-nixos)
# Java VM: OpenJDK 64-Bit Server VM (19.0.2+7-nixos, mixed mode, emulated-client, sharing, tiered, compressed oops, compressed class ptrs, g1 gc, linux-amd64)
# Problematic frame:
# V [libjvm.so+0x560463] AccessInternal::PostRuntimeDispatch<G1BarrierSet::AccessBarrier<548964ul, G1BarrierSet>, (AccessInternal::BarrierType)0, 548964ul>::oop_access_barrier(void*, oopDesc*)+0x53
#
# Core dump will be written. Default location: Core dumps may be processed with "/usr/share/apport/apport -p%p -s%s -c%c -d%d -P%P -u%u -g%g -- %E" (or dumping to /home/sami/code/local_scratch/try-kotlin/core.1065494)
#
# An error report file with more information is saved as:
# /home/sami/code/local_scratch/try-kotlin/hs_err_pid1065494.log
#
# If you would like to submit a bug report, please visit:
# https://bugreport.java.com/bugreport/crash.jsp
#
/nix/store/h09gcvss0n9n1a3s5b8wfmn5sh878lss-kotlin-native-1.9.10/bin/.run_konan-wrapped: line 82: 1065494 Aborted (core dumped) LIBCLANG_DISABLE_CRASH_RECOVERY=1 $TIMECMD "$JAVACMD" "${java_opts[@]}" "${java_args[@]}" -cp "$KONAN_CLASSPATH" "$TOOL_CLASS" "$TOOL_NAME" "${konan_args[@]}"
---------- BEGIN SOURCE ----------
hello.kt:
// Hello world in Kotlin multiplatform
fun main(args: Array<String>) {
println("Hello world!")
}
---------- END SOURCE ----------
FREQUENCY : always
$ java --version
openjdk 11.0.24 2024-07-16
OpenJDK Runtime Environment (build 11.0.24+8-post-Ubuntu-1ubuntu320.04)
OpenJDK 64-Bit Server VM (build 11.0.24+8-post-Ubuntu-1ubuntu320.04, mixed mode, sharing)
$ devbox version
0.13.5
$ nix-channel --list
https://nixos.org/channels/nixos-24.05
$ nix --version
nix (Nix) 2.18.1
$ neofetch:
OS: Ubuntu 20.04.6 LTS x86_64
Host: TensorBook (late 2021) 7.04
Kernel: 5.15.0-122-generic
Uptime: 20 days, 21 hours, 30 mins
Packages: 3492 (dpkg), 47 (nix-user), 6 (snap)
Shell: bash 5.2.15
Resolution: 2560x1440
DE: GNOME
WM: Mutter
WM Theme: Adwaita
Theme: Adwaita-dark [GTK2/3]
Icons: Yaru [GTK2/3]
Terminal: devbox
CPU: 11th Gen Intel i7-11800H (16) @ 4.600GHz
GPU: Intel Device 9a60
GPU: NVIDIA 01:00.0 NVIDIA Corporation Device 249c
Memory: 8119MiB / 64048MiB
A DESCRIPTION OF THE PROBLEM :
Using kotlin-native to compile hello world segfaults every time:
$ kotlinc-native hello.kt
#
# A fatal error has been detected by the Java Runtime Environment:
#
# SIGSEGV (0xb) at pc=0x00007eff660cd463, pid=1065494, tid=1065495
#
# JRE version: OpenJDK Runtime Environment (19.0.2+7) (build 19.0.2+7-nixos)
# Java VM: OpenJDK 64-Bit Server VM (19.0.2+7-nixos, mixed mode, emulated-client, sharing, tiered, compressed oops, compressed class ptrs, g1 gc, linux-amd64)
# Problematic frame:
# V [libjvm.so+0x560463] AccessInternal::PostRuntimeDispatch<G1BarrierSet::AccessBarrier<548964ul, G1BarrierSet>, (AccessInternal::BarrierType)0, 548964ul>::oop_access_barrier(void*, oopDesc*)+0x53
#
# Core dump will be written. Default location: Core dumps may be processed with "/usr/share/apport/apport -p%p -s%s -c%c -d%d -P%P -u%u -g%g -- %E" (or dumping to /home/sami/code/local_scratch/try-kotlin/core.1065494)
#
# An error report file with more information is saved as:
# /home/sami/code/local_scratch/try-kotlin/hs_err_pid1065494.log
#
# If you would like to submit a bug report, please visit:
# https://bugreport.java.com/bugreport/crash.jsp
#
/nix/store/h09gcvss0n9n1a3s5b8wfmn5sh878lss-kotlin-native-1.9.10/bin/.run_konan-wrapped: line 82: 1065494 Aborted (core dumped) LIBCLANG_DISABLE_CRASH_RECOVERY=1 $TIMECMD "$JAVACMD" "${java_opts[@]}" "${java_args[@]}" -cp "$KONAN_CLASSPATH" "$TOOL_CLASS" "$TOOL_NAME" "${konan_args[@]}"
=======
The file hello.kt:
// Hello world in Kotlin multiplatform
fun main(args: Array<String>) {
println("Hello world!")
}
This environment is devbox 0.13.5, a shell over Nix. Contents of devbox.json:
{
"$schema": "https://raw.githubusercontent.com/jetify-com/devbox/0.13.5/.schema/devbox.schema.json",
"packages": [
"kotlin-native"
],
"shell": {
"init_hook": [
"echo 'Welcome to devbox!' > /dev/null"
],
"scripts": {
"test": [
"echo \"Error: no test specified\" && exit 1"
]
}
}
}
STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
To repro:
1. Install devbox (curl -fsSL https://get.jetify.com/devbox | bash)
2. mkdir try-kotlin; cd try-kotlin
devbox init
vim devbox.json # change packages: [] to packages: ["kotlin-native"]
devbox shell
vim hello.kt
// Hello world in Kotlin multiplatform
fun main(args: Array<String>) {
println("Hello world!")
}
3. $ kotlinc-native hello.kt
# SIGSEGV (0xb) at pc=0x00007f79425d6463, pid=...
ACTUAL -
$ kotlinc-native hello.kt
#
# A fatal error has been detected by the Java Runtime Environment:
#
# SIGSEGV (0xb) at pc=0x00007eff660cd463, pid=1065494, tid=1065495
#
# JRE version: OpenJDK Runtime Environment (19.0.2+7) (build 19.0.2+7-nixos)
# Java VM: OpenJDK 64-Bit Server VM (19.0.2+7-nixos, mixed mode, emulated-client, sharing, tiered, compressed oops, compressed class ptrs, g1 gc, linux-amd64)
# Problematic frame:
# V [libjvm.so+0x560463] AccessInternal::PostRuntimeDispatch<G1BarrierSet::AccessBarrier<548964ul, G1BarrierSet>, (AccessInternal::BarrierType)0, 548964ul>::oop_access_barrier(void*, oopDesc*)+0x53
#
# Core dump will be written. Default location: Core dumps may be processed with "/usr/share/apport/apport -p%p -s%s -c%c -d%d -P%P -u%u -g%g -- %E" (or dumping to /home/sami/code/local_scratch/try-kotlin/core.1065494)
#
# An error report file with more information is saved as:
# /home/sami/code/local_scratch/try-kotlin/hs_err_pid1065494.log
#
# If you would like to submit a bug report, please visit:
# https://bugreport.java.com/bugreport/crash.jsp
#
/nix/store/h09gcvss0n9n1a3s5b8wfmn5sh878lss-kotlin-native-1.9.10/bin/.run_konan-wrapped: line 82: 1065494 Aborted (core dumped) LIBCLANG_DISABLE_CRASH_RECOVERY=1 $TIMECMD "$JAVACMD" "${java_opts[@]}" "${java_args[@]}" -cp "$KONAN_CLASSPATH" "$TOOL_CLASS" "$TOOL_NAME" "${konan_args[@]}"
---------- BEGIN SOURCE ----------
hello.kt:
// Hello world in Kotlin multiplatform
fun main(args: Array<String>) {
println("Hello world!")
}
---------- END SOURCE ----------
FREQUENCY : always