DragonOS icon indicating copy to clipboard operation
DragonOS copied to clipboard

[BUG REPORT] #1128 之后,riscv64 分支容易爆栈

Open Samuka007 opened this issue 7 months ago • 3 comments

描述错误 #1128 PR 之后,riscv64 启动经常在不定位置爆栈

[ DEBUG ] (src/driver/char/virtio_console.rs:593)        virtio console: add_device: to init tty device
[ DEBUG ] (src/driver/tty/tty_driver.rs:312)     init_tty_device: create TtyCore
[ DEBUG ] (src/driver/tty/tty_driver.rs:315)     init_tty_device: to driver_install_tty
[ DEBUG ] (src/driver/base/device/mod.rs:573)    kobject parent: "tty"
[ INFO [ ERROR ] (src/debug/panic/mod.rs:42)     Kernel Panic Occurred.
Location:
        File: src/arch/riscv64/interrupt/handle.rs
        Line: 182, Column: 9
Message:
        riscv64_do_irq: do_trap_load_page_fault(kernel mode): epc: 0xffffffc001156fac, vaddr=0xfffffffffffffff1, cause=Scause { bits: 13 }
Panic Counter: 123, too many panics, halt.
QEMU: Terminated

Samuka007 avatar May 10 '25 02:05 Samuka007

是否可以为task的内核栈设置一个保护页,从而更快地检测到栈溢出错误?

Godones avatar May 11 '25 15:05 Godones

是否可以为task的内核栈设置一个保护页,从而更快地检测到栈溢出错误?

确实,我觉得是可行的。添加这样一个调试功能。编译的时候可以选择开启。

@Godones 你愿意设计&实现这样一个功能吗?我觉得会很有用!

fslongjin avatar May 12 '25 00:05 fslongjin

我可以试试看

Godones avatar May 12 '25 02:05 Godones