When constructing a VT::TerminalWidget with automatic_size_policy = false, it will result in an assertion fail.
This only seem to occur when the first Terminal window is launched after start, and not consistently.
Launching additional terminal windows afterwards will not fail.
While sprinkling dbgln's and trying to nail it down it would sometimes work on launch, but fail on the next rebuild, very inconsistent.
Steps to reproduce:
Shell(26:26): USERSPACE(26) ASSERTION FAILED: i < m_size
../.././AK/Vector.h:183
[#0 Shell(26:26)]: Terminating Shell(26) due to signal 6
[#0 Shell(26:26)]: Shell(26:26) Should already die
[#0 FinalizerTask(4:4)]: 0xdeadc0de Kernel::Processor::switch_context(Kernel::Thread*&, Kernel::Thread*&) +1537
0xdeadc0de Kernel::Scheduler::context_switch(Kernel::Thread*) +1038
0xdeadc0de Kernel::Scheduler::pick_next() +1059
0xdeadc0de Kernel::Processor::check_invoke_scheduler() +537
0xdeadc0de Kernel::Thread::die_if_needed() +492
0xdeadc0de syscall_handler +11325
0xdeadc0de Kernel::syscall_asm_entry_dummy() +49
0x0d81a165
0x0d8032d6
0x0d803e3b
0x4299b6b5
0x429a02ed
0x429a0584
0x16a67e03
0x16a68514
0x16a68974
0x16a691de
0x16a69e7b
0x2de4b2f4
0x2de4ba87
0x2de3cc23
0x2de3cac7
0x2de393a2
0x2de4486c
0x2de3892a
0x2de4aa88
0x2de4ba87
0x2de3a4aa
0x2de4aa88
0x2de4ba87
0x2dea8b93
0x2dea8d88
0x2deb441a
0x2deb5856
0x2de4ac02
0x2de4ba87
0x2dea7034
0x2dea8213
0x585ded4f
0x585ddd0d
0x585ddf88
0x09a0ebce
0x099de505
[#0 FinalizerTask(4:4)]: Generating coredump for pid: 26
[FinalizerTask(4:4)]: RTC: Year: 2021, month: 6, day: 4, hour: 12, minute: 47, second: 23
CrashDaemon(20:20): New coredump file: /tmp/coredump/Shell_26_1622810843
[#0 SyncTask(3:3)]: Ext2FS: Flushed 8 blocks to disk
Terminal(16:16): TerminalWidget: EOF on master pty, firing on_command_exit hook.
Terminal(16:16): Exiting terminal, updating utmp
utmpupdate(29:29): Updating utmp from UID=100 GID=100 EGID=5 PID=0
utmpupdate(29:29): Removing /dev/pts/0 from utmp
SystemServer(6:6): Service Terminal has exited with exit code 0
CrashDaemon(20:20): --- Backtrace for thread #0 (TID 26) ---
CrashDaemon(20:20): 0x3e1251ce: [libsystem.so] syscall2 +0xe (syscall.cpp:25)
CrashDaemon(20:20): 0x0d81a165: [libc.so] raise +0x25 (signal.cpp:21)
CrashDaemon(20:20): 0x0d8032d6: [libc.so] abort +0x2a (stdlib.cpp:233)
CrashDaemon(20:20): 0x0d803e3b: [libc.so] __assertion_failed +0xeb (Format.h:236)
CrashDaemon(20:20): 0x4299b6b5: [libline.so] Line::StringMetrics::lines_with_addition(Line::StringMetrics const&, unsigned long) const +0x95 (Vector.h:183)
CrashDaemon(20:20): 0x429a02ed: [libline.so] Line::Editor::reposition_cursor(bool) +0xbd (Editor.h:349)
CrashDaemon(20:20): 0x429a0584: [libline.so] Line::Editor::resized() +0x84 (OwnPtr.h:139)
CrashDaemon(20:20): 0x16a67e03: [libcore.so] Core::SignalHandlers::dispatch() [clone .localalias] +0xa3 (Atomic.h:206)
CrashDaemon(20:20): 0x16a68514: [libcore.so] Core::EventLoop::dispatch_signal(int) [clone .localalias] +0x144 (Atomic.h:246)
CrashDaemon(20:20): 0x16a68974: [libcore.so] Core::EventLoop::wait_for_event(Core::EventLoop::WaitMode) +0x304 (EventLoop.cpp:649)
CrashDaemon(20:20): 0x16a691de: [libcore.so] Core::EventLoop::pump(Core::EventLoop::WaitMode) [clone .localalias] +0x3e (NonnullOwnPtr.h:104)
CrashDaemon(20:20): 0x16a69e7b: [libcore.so] Core::EventLoop::exec() +0x5b (EventLoop.cpp:362)
CrashDaemon(20:20): 0x2de4b2f4: [libshell.so] Shell::AST::Execute::for_each_entry(AK::RefPtr<Shell::Shell, AK::RefPtrTraits<Shell::Shell> >, AK::Function<AK::IterationDecision (AK::NonnullRefPtr<Shell::AST::Value>)>) +0x9a4 (NonnullRefPtr.h:237)
CrashDaemon(20:20): 0x2de4ba87: [libshell.so] Shell::AST::Execute::run(AK::RefPtr<Shell::Shell, AK::RefPtrTraits<Shell::Shell> >) +0x127 (Atomic.h:246)
CrashDaemon(20:20): 0x2de3cc23: [libshell.so] Shell::AST::StringPartCompose::run(AK::RefPtr<Shell::Shell, AK::RefPtrTraits<Shell::Shell> >) +0x1e3 (Atomic.h:246)
CrashDaemon(20:20): 0x2de3cac7: [libshell.so] Shell::AST::StringPartCompose::run(AK::RefPtr<Shell::Shell, AK::RefPtrTraits<Shell::Shell> >) +0x87 (Atomic.h:246)
CrashDaemon(20:20): 0x2de393a2: [libshell.so] Shell::AST::DoubleQuotedString::run(AK::RefPtr<Shell::Shell, AK::RefPtrTraits<Shell::Shell> >) +0xa2 (Atomic.h:246)
CrashDaemon(20:20): 0x2de4486c: [libshell.so] Shell::AST::ListConcatenate::run(AK::RefPtr<Shell::Shell, AK::RefPtrTraits<Shell::Shell> >) +0x36c (Atomic.h:246)
CrashDaemon(20:20): 0x2de3892a: [libshell.so] Shell::AST::CastToCommand::run(AK::RefPtr<Shell::Shell, AK::RefPtrTraits<Shell::Shell> >) +0x8a (Atomic.h:246)
CrashDaemon(20:20): 0x2de4aa88: [libshell.so] Shell::AST::Execute::for_each_entry(AK::RefPtr<Shell::Shell, AK::RefPtrTraits<Shell::Shell> >, AK::Function<AK::IterationDecision (AK::NonnullRefPtr<Shell::AST::Value>)>) +0x138 (Atomic.h:246)
CrashDaemon(20:20): 0x2de4ba87: [libshell.so] Shell::AST::Execute::run(AK::RefPtr<Shell::Shell, AK::RefPtrTraits<Shell::Shell> >) +0x127 (Atomic.h:246)
CrashDaemon(20:20): 0x2de3a4aa: [libshell.so] Shell::AST::IfCond::run(AK::RefPtr<Shell::Shell, AK::RefPtrTraits<Shell::Shell> >) +0x6a (Atomic.h:246)
CrashDaemon(20:20): 0x2de4aa88: [libshell.so] Shell::AST::Execute::for_each_entry(AK::RefPtr<Shell::Shell, AK::RefPtrTraits<Shell::Shell> >, AK::Function<AK::IterationDecision (AK::NonnullRefPtr<Shell::AST::Value>)>) +0x138 (Atomic.h:246)
CrashDaemon(20:20): 0x2de4ba87: [libshell.so] Shell::AST::Execute::run(AK::RefPtr<Shell::Shell, AK::RefPtrTraits<Shell::Shell> >) +0x127 (Atomic.h:246)
CrashDaemon(20:20): 0x2dea8b93: [libshell.so] Shell::Shell::run_tail(Shell::AST::Command const&, Shell::AST::NodeWithAction const&, int)::{lambda()#1}::operator()() const +0x353 (Atomic.h:246)
CrashDaemon(20:20): 0x2dea8d88: [libshell.so] Shell::Shell::run_tail(Shell::AST::Command const&, Shell::AST::NodeWithAction const&, int) +0x88 (Shell.cpp:950)
CrashDaemon(20:20): 0x2deb441a: [libshell.so] Shell::Shell::run_command(Shell::AST::Command const&) [clone .localalias] +0x2da (Shell.cpp:593)
CrashDaemon(20:20): 0x2deb5856: [libshell.so] Shell::Shell::run_commands(AK::Vector<Shell::AST::Command, 0ul>&) +0x96 (Atomic.h:246)
CrashDaemon(20:20): 0x2de4ac02: [libshell.so] Shell::AST::Execute::for_each_entry(AK::RefPtr<Shell::Shell, AK::RefPtrTraits<Shell::Shell> >, AK::Function<AK::IterationDecision (AK::NonnullRefPtr<Shell::AST::Value>)>) +0x2b2 (Vector.h:165)
CrashDaemon(20:20): 0x2de4ba87: [libshell.so] Shell::AST::Execute::run(AK::RefPtr<Shell::Shell, AK::RefPtrTraits<Shell::Shell> >) +0x127 (Atomic.h:246)
CrashDaemon(20:20): 0x2dea7034: [libshell.so] Shell::Shell::run_command(AK::StringView const&, AK::Optional<Shell::Shell::SourcePosition>) [clone .localalias] +0x3c4 (Atomic.h:246)
CrashDaemon(20:20): 0x2dea8213: [libshell.so] Shell::Shell::run_file(AK::String const&, bool) +0x343 (Shell.cpp:1036)
CrashDaemon(20:20): 0x585ded4f: [/bin/Shell] auto main::{lambda(auto:1&)#7}::operator()<char const* const>(char const* const&) const [clone .isra.0] +0x9f (main.cpp:155)
CrashDaemon(20:20): 0x585ddd0d: [/bin/Shell] main +0xc3d (main.cpp:159)
CrashDaemon(20:20): 0x585ddf88: [/bin/Shell] _start +0x58 (crt0.cpp:39)
Pay now to fund the work behind this issue.
Get updates on progress being made.
Maintainer is rewarded once the issue is completed.
You're funding impactful open source efforts
You want to contribute to this effort
You want to get funding like this too