Skip to content

Commit f9d4c7a

Browse files
committed
prevent panic cycle before libc is ready
1 parent 6bed2c5 commit f9d4c7a

1 file changed

Lines changed: 4 additions & 0 deletions

File tree

src/kernel/syscalls.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -124,6 +124,10 @@ extern kernel::ctor_t __plugin_ctors_end;
124124
if (kernel::panics() > 4) double_fault(why);
125125

126126
const int current_cpu = SMP::cpu_id();
127+
if (!kernel::libc_initialized()) {
128+
kprint("FATAL: panic before libc\n");
129+
panic_epilogue(why);
130+
}
127131

128132
#ifdef INCLUDEOS_SMP_ENABLE
129133
SMP::global_lock();

0 commit comments

Comments
 (0)