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

waitpid implementation difference between ucore and rcore #17

Closed
huangbj16 opened this issue Oct 4, 2019 · 3 comments
Closed

waitpid implementation difference between ucore and rcore #17

huangbj16 opened this issue Oct 4, 2019 · 3 comments

Comments

@huangbj16
Copy link

huangbj16 commented Oct 4, 2019

Description

Discovered by testing ucore test badarg.

In uCore, when waitpid succeeds, it returns 0.

But in rCore, when waitpid succeeds, it returns the pid of the process that changes it status.

In test badarg, it asserts that "waitpid(-1, exit_code) == 0" (which corresponds to the standard of uCore), but in rCore the return value is 2 (the pid of the child process that exits).

Reproduce Steps

make sfsimg arch=x86_64
make run arch=x86_64 mode=release
cd ucore
./badarg

Current Result

fork ok.
user panic at /home/huangbj16/Documents/ostrain/rCore_Self/rCore/user/ucore/src/badarg.c:21:
    assertion failed: waitpid(pid, &exit_code) == 0 && exit_code == 0xbeaf
Unknown signal (core dumped)

#Expected Result

@jiegec
Copy link
Member

jiegec commented Oct 4, 2019

IMHO, uCore tests are no longer needed or can be rewritten for POSIX.

@wangrunji0408
Copy link
Member

I think uCore tests should be modified to match the POSIX API,
which means they can run on common Linux.

@huangbj16
Copy link
Author

agree.

wangrunji0408 added a commit to rcore-os/rcore-user that referenced this issue Oct 5, 2019
- switch waitpid() specification from ucore to rcore/POSIX
  fix rcore-os/rCore#17
- remove pgdir.c
- remove code for kernel in x86_64/arch.h
wangrunji0408 added a commit to rcore-os/rcore-user that referenced this issue Oct 5, 2019
- switch waitpid() specification from ucore to rcore/POSIX
  fix rcore-os/rCore#17
- remove pgdir.c
- remove code for kernel in x86_64/arch.h
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

No branches or pull requests

3 participants