rcore-os / rCore

Rust version of THU uCore OS. Linux compatible.
MIT License
3.48k stars 376 forks source link

coredump in Ubuntu20.04/x86-64 #55

Closed prettykernel closed 4 years ago

prettykernel commented 4 years ago

how to reproduce?

step 1, rustup component add rust-src llvm-tools-preview

step 2, run the command in https://github.com/rcore-os/rCore#how-to-run:

$ git clone https://github.com/rcore-os/rCore.git --recursive It workks well

$ cd rCore/user $ make sfsimg prebuilt=1 arch=x86_64 It workks well too

$ cd ../kernel $ make run ARCH=x86_64 LOG=trace // ... warning: unused import: lazy_static::* --> src/memory.rs:24:5 24 use lazy_static::*; ^^^^^^^^^^^^^^

= note: #[warn(unused_imports)] on by default

warning: unnecessary parentheses around if condition --> src/sync/mutex.rs:150:12 150 if (initialization == 2) { ^^^^^^^^^^^^^^^^^^^^^ help: remove these parentheses
= note: `#[warn(unused_parens)]` on by default
warning: unnecessary parentheses around if condition --> src/sync/mutex.rs:153:12 153 if (initialization == 1 ____^ 154 self 155 .support_initialization 156 .compare_and_swap(0, 1, Ordering::Acquire) 157 != 0) _____^
help: remove these parentheses 153 if initialization == 1 154 self 155 .support_initialization 156 .compare_and_swap(0, 1, Ordering::Acquire) 157 != 0
warning: use of deprecated item 'sync::condvar::Condvar::_wait': this may leads to lost wakeup problem. please use wait instead. --> src/sync/mutex.rs:318:14 318 self._wait(); ^^^^^
= note: `#[warn(deprecated)]` on by default

// ...

error: "/root/.rustup/toolchains/nightly-2020-04-06-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/Cargo.lock" does not exist, unable to build with the standard library, try: rustup component add rust-src make: * [Makefile:301: kernel] Error 101 // ... make[1]: 离开目录“/root/桌面/rCore/rboot” qemu-system-x86_64: -device ide-drive,drive=sfsimg,bus=ahci0.0: warning: 'ide-drive' is deprecated, please use 'ide-hd' or 'ide-cd' instead**

I run the command in step 1 again, then I change ide-drive to ide-hd: https://github.com/rcore-os/rCore/blob/a838a1fb9aad45f68b3599a76d8a86ab0ecfb485/kernel/Makefile#L94 and remove the start @ in justrun: https://github.com/rcore-os/rCore/blob/a838a1fb9aad45f68b3599a76d8a86ab0ecfb485/kernel/Makefile#L248 and then run make run ARCH=x86_64 LOG=trace again, it shows: qemu-system-x86_64 -smp cores=4 -bios ../rboot/OVMF.fd -drive format=raw,file=fat:rw:target/x86_64/release/esp -serial mon:stdio -m 4G -device isa-debug-exit -drive format=qcow2,file=../user/build/x86_64.qcow2,media=disk,cache=writeback,id=sfsimg,if=none -device ahci,id=ahci0 -device ide-hd,drive=sfsimg,bus=ahci0.0 -nographic

as above, it just block here, and show nothing. then I type ctrl + a, and then type c, then it shows: QEMU 4.2.0 monitor - type 'help' for more information (qemu) quit # type quit and enter make: *** [Makefile:248: justrun] 段错误 (core dumped)

but Qemu works well with my own images, and all the related toolchains are latest. Could you give some help ?

jiegec commented 4 years ago
  1. Run rustup component add rust-src in rCore dir
  2. Update QEMU to 5.0?
  3. Please quote program output correctly.
prettykernel commented 4 years ago

the first step you said is important, it works well with it