Skip to content

Mint Tea hangs when trying to render a TUI app #34

@chshersh

Description

@chshersh

I noticed that my Mint Tea app hangs on the start occasionally.

Sometimes the app is snappy but sometimes displays the initial screen and ignores all the future key events (or takes about 20 seconds to process a keyboard event).

When such a problem happens, I see that strace spams with errors:

clock_nanosleep(CLOCK_REALTIME, 0, {tv_sec=0, tv_nsec=10000}, NULL) = 0
futex(0x55aab30882a8, FUTEX_WAKE_PRIVATE, 1) = 1
futex(0x55aab503d8b0, FUTEX_WAIT_PRIVATE, 2, NULL) = -1 EAGAIN (Resource temporarily unavailable)
futex(0x55aab503d8b0, FUTEX_WAKE_PRIVATE, 1) = 0
futex(0x55aab503d8b0, FUTEX_WAIT_PRIVATE, 2, NULL) = -1 EAGAIN (Resource temporarily unavailable)
futex(0x55aab503d8b0, FUTEX_WAKE_PRIVATE, 1) = 0
futex(0x55aab503d8b0, FUTEX_WAIT_PRIVATE, 2, NULL) = -1 EAGAIN (Resource temporarily unavailable)
futex(0x55aab503d8b0, FUTEX_WAKE_PRIVATE, 1) = 0
futex(0x55aab503d8b0, FUTEX_WAIT_PRIVATE, 2, NULL) = -1 EAGAIN (Resource temporarily unavailable)
futex(0x55aab503d8b0, FUTEX_WAKE_PRIVATE, 1) = 0
futex(0x55aab30882a8, FUTEX_WAKE_PRIVATE, 1) = 1
futex(0x55aab503d8b0, FUTEX_WAIT_PRIVATE, 2, NULL) = -1 EAGAIN (Resource temporarily unavailable)
futex(0x55aab503d8b0, FUTEX_WAKE_PRIVATE, 1) = 0
futex(0x55aab503d8b0, FUTEX_WAIT_PRIVATE, 2, NULL) = -1 EAGAIN (Resource temporarily unavailable)
futex(0x55aab503d8b0, FUTEX_WAKE_PRIVATE, 1) = 0
futex(0x55aab503d8b0, FUTEX_WAIT_PRIVATE, 2, NULL) = -1 EAGAIN (Resource temporarily unavailable)
futex(0x55aab503d8b0, FUTEX_WAKE_PRIVATE, 1) = 0
futex(0x55aab503d8b0, FUTEX_WAIT_PRIVATE, 2, NULL) = -1 EAGAIN (Resource temporarily unavailable)
futex(0x55aab503d8b0, FUTEX_WAKE_PRIVATE, 1) = 0

I forked minttea and added some logging, and I observed that Mint Tea hangs on receiving and processing Frame events here:

You can try to reproduce the problem using the following project:

It uses OCaml 5.1.1 and pinned from GitHub versions of all Mint Tea ecosystem dependencies.

Run the project by executing dune exec bin/main.exe and try pressing numbers 1,2,3 or arrows or hjkl or q to quit.

Expected behaviour: The TUI app is immediately responsive and rerenders instantly

Actual behaviour: The TUI app sometimes hangs and stops responding to input key events

The error is flaky and is not always reproducible

I'm on Windows 11 and running my project through WSL2 and Ubuntu.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    Status

    Done

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions