Open corbym opened 1 year ago
I can't really read the text in that video. Can you post the crash text and the code that reproduces this?
It's strange that it works for a while. This is tricky since I don't have a mac machine to test on, and this doesn't look like I'll be able to reproduce it in a unit test on CI.
Hey
The same crash text is in the hs_err log attached I think.
If that doesn't help I'll post it when I get back to my laptop tomorrow 👍
Ah, thanks, I missed that in the original post.
Does this crash only occur under Graal? Does it work on a regular JVM?
On the HotSpot JVM the crash is as follows:
#
# A fatal error has been detected by the Java Runtime Environment:
#
# SIGSEGV (0xb) at pc=0x000000014754ac14, pid=75088, tid=5635
#
# JRE version: Java(TM) SE Runtime Environment (17.0.6+9) (build 17.0.6+9-LTS-190)
# Java VM: Java HotSpot(TM) 64-Bit Server VM (17.0.6+9-LTS-190, mixed mode, sharing, tiered, compressed oops, compressed class ptrs, g1 gc, bsd-aarch64)
# Problematic frame:
# j jdk.proxy2.$Proxy2.ioctl(ILcom/sun/jna/NativeLong;Lcom/github/ajalt/mordant/internal/MacosLibC$winsize;)I+27 jdk.proxy2
#
# No core dump will be written. Core dumps have been disabled. To enable core dumping, try "ulimit -c unlimited" before starting Java again
#
# An error report file with more information is saved as:
# [redacted]/hs_err_pid75088.log
#
# If you would like to submit a bug report, please visit:
# https://bugreport.java.com/bugreport/crash.jsp
HotSpot hs_err_pid hs_err_pid75088.log
java details:
> java -version
java version "17.0.6" 2023-01-17 LTS
Java(TM) SE Runtime Environment (build 17.0.6+9-LTS-190)
Java HotSpot(TM) 64-Bit Server VM (build 17.0.6+9-LTS-190, mixed mode, sharing)
Possibly related? https://github.com/jline/jline3/issues/688 - there are several linked issues that might be worth reading about.
I do use JLine (v3.22.0), but not to discover or update anything regarding the size of the terminal.
@corbym great find! I implemented the ioctl from the linked issue in #87. Let me know if that fixes the crash.
Hello. I'm having a problem that may be related. I'm on M1 MacBook Pro running Ventura. Calling updateTerminalSize
does not crash in my machine but instead fails to detect the size of the terminal (it returns false). The size is left to 79 x 24, which makes all the tables and formatting in general too small. This problem only occurs with version 2.0.0-beta10 and 2.0.0-beta11. With 2.0.0-beta9 and earlier, the detection of the terminal size works fine.
Do you think it is related to this issue or is it a separate issue?
@nfsantos probably the same issue. Can you try the branch on #87 to see if it fixes your issue?
Sure, I can try. How should I do to try that branch? Is there a binary somewhere for that branch or do I have to build it locally?
I just merged the PR, so you can use the latest snapshot once it finishes building.
I have tried with the latest snapshot release and it still failed to detect the terminal size. It fails in the same way as with 2.0.0-beta11, that is, updateTerminalSize()
returns false. Shall I open a new issue? What additional information do you need to try to debug the issue?
$ ./gradew dependencies:
...
+--- com.github.ajalt.mordant:mordant:2.0.0-beta11.72-SNAPSHOT
| \--- com.github.ajalt.mordant:mordant-jvm:2.0.0-beta11.72-SNAPSHOT
| +--- org.jetbrains.kotlin:kotlin-stdlib-jdk8:1.8.0 (*)
| +--- com.github.ajalt.colormath:colormath:3.2.1
| | \--- com.github.ajalt.colormath:colormath-jvm:3.2.1
| | +--- org.jetbrains.kotlin:kotlin-stdlib-jdk8:1.7.10 -> 1.8.0 (*)
| | \--- org.jetbrains.kotlin:kotlin-stdlib-common:1.7.10 -> 1.8.0
| +--- org.jetbrains.kotlin:kotlin-stdlib-common:1.8.0
| +--- org.jetbrains:markdown:0.3.6
| | \--- org.jetbrains:markdown-jvm:0.3.6
| | +--- org.jetbrains.kotlin:kotlin-stdlib-common:1.5.31 -> 1.8.0
| | \--- org.jetbrains.kotlin:kotlin-stdlib:1.5.31 -> 1.8.0 (*)
| \--- net.java.dev.jna:jna:5.12.1
@ajalt Naive testing suggests that this has worked to fix the crash. However, changing the term size doesn't affect the numbers in the column. At least the size does not shrink to nothing any more :)
I just released a new version of Mordant that reverts to the old detectTerminalSize
implementation for now. I'm leaving this issue open until we can figure out how to get it working with jna. Let me know if it still doesn't work.
Firstly let me thank you for this amazing lib AND cliktcommand. They are super useful :)
However, apart from not really working (as you can see from the video, all the tables get squashed to nothing), the jvm
updateTerminalSize
function causes the JVM to crash on MacOs Ventura:hs_err_pid22892.log
replay_pid77535.log
Crash log on console out:
https://user-images.githubusercontent.com/21261837/215809290-46b5b510-2efc-4294-b787-9f843283e627.mov
All this command I'm running is calling the updateTerminalSize function in a CliktCommand underneath. I'm adapting the mordant terminal using the interfaces provided for Clikt, if you are wondering, and everything works fine in a linux docker environment.
Edit:
Second edit: added console crash message for GraalVm and replay log