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

(WIP) improve error handling #145

Merged
merged 1 commit into from
Aug 13, 2020
Merged

(WIP) improve error handling #145

merged 1 commit into from
Aug 13, 2020

Conversation

jeehoonkang
Copy link
Member

이 PR을 적용시 다음과 같은 이상한 에러가 납니다:

$ make qemu 
cargo xbuild --manifest-path kernel-rs/Cargo.toml --target kernel-rs/riscv64gc-unknown-none-elfhf.json --release
   Compiling core v0.0.0 (/kaist-cp-home/jeehoon.kang/.rustup/toolchains/nightly-2020-06-12-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/src/libcore)
   Compiling compiler_builtins v0.1.32
   Compiling rustc-std-workspace-core v1.99.0 (/kaist-cp-home/jeehoon.kang/.rustup/toolchains/nightly-2020-06-12-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/src/tools/rustc-std-workspace-core)
   Compiling alloc v0.0.0 (/tmp/cargo-xbuild.McU5pMRsTKs6)
    Finished release [optimized + debuginfo] target(s) in 9.65s
   Compiling autocfg v1.0.0
   Compiling bitflags v1.2.1
   Compiling scopeguard v1.1.0
   Compiling num-traits v0.2.12
   Compiling num-integer v0.1.43
   Compiling num-iter v0.1.41
   Compiling rv6-kernel v0.1.0 (/kaist-cp-home/jeehoon.kang/Works/rv6/kernel-rs)
error: fixup value out of range

error: aborting due to previous error

error: could not compile `rv6-kernel`.

To learn more, run the command again with --verbose.
make: *** [Makefile:98: kernel-rs/target/riscv64gc-unknown-none-elfhf/release/librv6_kernel.a] Error 101

검색해보니 LLVM 버그를 밟은 것 같네요 Aㅏ... rust-lang/rust#74813
rust-lang/rust에서 해결해줄때까지 기다리겠습니다.

@coolofficials
Copy link
Collaborator

Aㅏ... commit 읽어보겠습니다!

@@ -63,14 +63,13 @@ pub unsafe fn start() {
/// which turns them into software interrupts for devintr() in trap.c.
unsafe fn timerinit() {
// each CPU has a separate source of timer interrupts.
let id: i32 = r_mhartid() as i32;
let id = r_mhartid();
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

교수님 id가 xv6에서 int type이라서 일단 놔둔 상태인데, xv6의 type을 따르는게 비효율적일 때 고치면 되나요?
그렇다면 #137 를 제 다음 issue로 삼겠습니다. #93#137 을 먼저 하면 더 편할 것 같습니다.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

이 경우는 효율보다도 id가 정말로 usize 타입이어야하기 때문입니다 (r_mhartid의 결과는 usize).

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

이런식으로 type unmatch한 parameter, local variable들 #137 에서 수정하겠습니다.

@jeehoonkang jeehoonkang marked this pull request as ready for review August 13, 2020 17:49
@jeehoonkang jeehoonkang merged commit 2b93847 into kaist-cp:riscv Aug 13, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants