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

kotlin.RuntimeException: Error reading from console input: unexpected event type 16 #185

Closed
zyklone4096 opened this issue Jul 8, 2024 · 1 comment

Comments

@zyklone4096
Copy link

zyklone4096 commented Jul 8, 2024

in kotlin/native mingwX64 executable, appears when active window switched or running with double-click exe

when(
        term.interactiveSelectList {
            addEntry(ACTION_INSTALL_MODEL)  // 4 Chinese characters
            addEntry(ACTION_OPEN_DOWNLOAD_PAGE) // 8 Chinese characters
        }
    ) {
        ACTION_INSTALL_MODEL -> installModelAction() // Empty function
        ACTION_OPEN_DOWNLOAD_PAGE -> actionOpenDownloadPage() // Called ShellExecuteA to open an URL
        else -> {
            term.println(TextColors.red("无效操作"))
        }
    }

Error in debug executable

Uncaught Kotlin exception: kotlin.RuntimeException: Error reading from console input: unexpected event type 16
    at 0   ???                                 7ff60b7d4513       kfun:kotlin.Throwable#<init>(kotlin.String?){} + 115
    at 1   ???                                 7ff60b7cf4de       kfun:kotlin.Exception#<init>(kotlin.String?){} + 110
    at 2   ???                                 7ff60b7cf0fe       kfun:kotlin.RuntimeException#<init>(kotlin.String?){} + 110
    at 3   ???                                 7ff60b9d719c       kfun:com.github.ajalt.mordant.internal.syscalls.SyscallHandlerNativeWindows#readRawEvent(kotlin.Int){}com.github.ajalt.mordant.internal.syscalls.SyscallHandlerWindows.EventRecord + 3756
    at 4   ???                                 7ff60ba026a0       kfun:com.github.ajalt.mordant.internal.syscalls.SyscallHandlerWindows#readRawEvent(kotlin.Int){}com.github.ajalt.mordant.internal.syscalls.SyscallHandlerWindows.EventRecord-trampoline + 64
    at 5   ???                                 7ff60b9de065       kfun:com.github.ajalt.mordant.internal.syscalls.SyscallHandlerWindows#readInputEvent(kotlin.time.Duration;com.github.ajalt.mordant.input.MouseTracking){}com.github.ajalt.mordant.internal.syscalls.SysInputEvent + 373
    at 6   ???                                 7ff60b9ff71c       kfun:com.github.ajalt.mordant.internal.syscalls.SyscallHandler#readInputEvent(kotlin.time.Duration;com.github.ajalt.mordant.input.MouseTracking){}com.github.ajalt.mordant.internal.syscalls.SysInputEvent-trampoline + 92
    at 7   ???                                 7ff60b9dbad7       kfun:com.github.ajalt.mordant.input.RawModeScope#readEvent(kotlin.time.Duration){}com.github.ajalt.mordant.input.InputEvent + 487
    at 8   ???                                 7ff60b9dbd96       kfun:com.github.ajalt.mordant.input.RawModeScope#readEvent$default(kotlin.time.Duration;kotlin.Int){}com.github.ajalt.mordant.input.InputEvent + 246
    at 9   ???                                 7ff60b9dc254       kfun:com.github.ajalt.mordant.input#receiveEvents__at__com.github.ajalt.mordant.input.InputReceiver<0:0>(com.github.ajalt.mordant.input.MouseTracking){0§<kotlin.Any?>}0:0 + 676
    at 10  ???                                 7ff60b9dc61e       kfun:com.github.ajalt.mordant.input#receiveEvents$default__at__com.github.ajalt.mordant.input.InputReceiver<0:0>(com.github.ajalt.mordant.input.MouseTracking?;kotlin.Int){0§<kotlin.Any?>}0:0 + 286
    at 11  ???                                 7ff60b9e93c4       kfun:#main(kotlin.Array<out|kotlin.String>...){} + 884

    at 12  ???                                 7ff60b9e961c       Konan_start + 156
    at 13  ???                                 7ff60ba212f8       Init_and_run_start + 136
    at 14  ???                                 7ff60b7c13b4       __tmainCRTStartup + 564
    at 15  ???                                 7ff60b7c150b       mainCRTStartup + 27
    at 16  ???                                 7ffade7e26ad       _ZSt25__throw_bad_function_callv + 20717262381
    at 17  ???                                 7ffae094aa68       _ZSt25__throw_bad_function_callv + 20752292328

Error in release executable

Uncaught Kotlin exception: kotlin.RuntimeException: Error reading from console input: unexpected event type 16
    at 0   ???                                 7ff7914984d2       kfun:com.github.ajalt.mordant.internal.syscalls.SyscallHandlerNativeWindows#readRawEvent(kotlin.Int){}com.github.ajalt.mordant.internal.syscalls.SyscallHandlerWindows.EventRecord + 1282
    at 1   ???                                 7ff79149a2e3       kfun:com.github.ajalt.mordant.internal.syscalls.SyscallHandlerWindows#readInputEvent(kotlin.time.Duration;com.github.ajalt.mordant.input.MouseTracking){}com.github.ajalt.mordant.internal.syscalls.SysInputEvent + 579
    at 2   ???                                 7ff79149f87d       kfun:#main(kotlin.Array<out|kotlin.String>...){} + 2957
    at 3   ???                                 7ff7914a6045       Init_and_run_start + 261
    at 4   ???                                 7ff7914a620f       Konan_main + 15
    at 5   ???                                 7ff7913e13b4       __tmainCRTStartup + 564
    at 6   ???                                 7ff7913e150b       mainCRTStartup + 27
    at 7   ???                                 7ffade7e26ad       _ZSt25__throw_bad_function_callv + 14179951677
    at 8   ???                                 7ffae094aa68       _ZSt25__throw_bad_function_callv + 14214981624
@ajalt
Copy link
Owner

ajalt commented Jul 9, 2024

Thanks for the report! This is already fixed in #184, and will be included in the next release, or you can use a snapshot now to test it out.

@ajalt ajalt closed this as completed Jul 9, 2024
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