Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

page fault after upgrading asm! to llvm_asm! #13

Closed
wyfcyx opened this issue Jul 10, 2020 · 4 comments
Closed

page fault after upgrading asm! to llvm_asm! #13

wyfcyx opened this issue Jul 10, 2020 · 4 comments
Assignees
Labels
bug Something isn't working

Comments

@wyfcyx
Copy link
Collaborator

wyfcyx commented Jul 10, 2020

make run on master branch, and it panicked with:

Exception(StorePageFault) va = 0xffffffffffffffe8 instruction = 0x1acfe
panicked at 'page fault!', src/interrupt.rs:76:5
  • rust-toolchain = nightly-2020-06-04
  • riscv = 21e32ee
    In the meanwhile, multicore branch worked normally 15 days ago, but now it failed with page fault too. Given that the only change of it in the last two weeks was the update of riscv crate, so I think there maybe some bugs in it. Actually, I made it work again by rolling back the riscv version to c62af46.
@wyfcyx wyfcyx added the bug Something isn't working label Jul 10, 2020
@jiegec
Copy link
Member

jiegec commented Jul 10, 2020

No idea.

@nappingman
Copy link

problem solve yet ?

@KiritoHugh
Copy link

same error, same rust-toolchain version, same risv version, and rolling back the riscv version to c62af46 does not work for me.

Exception(LoadPageFault) va = 0xffffffff00080000 instruction = 0x1ab1a
panicked at 'page fault!', src/interrupt.rs:76:5

@QQxiaoming
Copy link

相同的错误、相同的 rust-toolchain 版本、相同的 risv 版本以及将 riscv 版本回滚到 c62af46 对我不起作用。

Exception(LoadPageFault) va = 0xffffffff00080000 instruction = 0x1ab1a
panicked at 'page fault!', src/interrupt.rs:76:5

我找到了这个page fault的原因在:
在os/src/memory/memory_set/area.rs:50的
pub fn page_copy(&self, pt: &mut PageTableImpl, src: usize, length: usize)函数内,
page会做4K对齐,则进行数据拷贝时,会导致elf起始数据段为非对齐时这个段数据没有正确的写入,进而直接导致用户进程跑飞引起不可预测的错误。这个位置我进行了修改确认能解决该问题,但鉴于官方好像已经重构了这个项目并且此处代码完全重构了,因此就没有提PR了。

QQxiaoming pushed a commit to QQxiaoming/rCore_tutorial that referenced this issue Jun 7, 2021

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
@jiegec jiegec closed this as completed Jun 3, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

5 participants