Skip to content

[BUG][CRASH] kak -f / execute-keys crash given random sequence of keys #4472

Open
@kak-0

Description

@kak-0

Version of Kakoune

v2021.11.08-41-g6029ee98 (debug=yes)

Reproducer

kak -f crashes when given some random sequences of keys. For example:

kak -f 'o<esc><u><a-gt>U' </dev/null # Fatal error: assert failed "m_current_undo_group.empty()" at buffer.cc:310
kak -f 'o<esc><u><A>a<a-;>U' </dev/null # Fatal error: assert failed "m_current_undo_group.empty()" at buffer.cc:310
kak -f '2oK.k<c-n><ret><c-n>' </dev/null # Fatal error: assert failed "from >= 0 and from <= str_len" at string.hh:287
kak -f 'o/<c-n><up><c-n>' </dev/null # SIGSEGV
kak -f 'iab:a<c-p><home><c-p>' </dev/null # SIGSEGV
kak -f 'iab<space>a<c-p><a-;><a-h><c-n>' </dev/null # SIGSEGV
kak -f '+<a-)>iab$a<c-p><ret><c-p>' </dev/null # Fatal error: assert failed "from >= 0 and from <= str_len" at string.hh:287
kak -f 'i<tab><tab><esc><a-u>iw<esc><a-u>+@' </dev/null # Fatal error: assert failed "min >= last_min" at selection.cc:285

These key sequences (with the exception of the last one) crash execute-keys too, but they don't crash Kakoune when pressed interactively.

Outcome

Kakoune crashes.

Expectations

No response

Additional information

Kakoune must be built with debug=yes to enable assertions.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions