qualcomm / qualcomm/hexagon-hypervisor
Return value other that 0 results in "Unexpected exit status"
Nobody has claimed this yet.
- Dominant language
- C
- Stars
- 10
- Forks
- 8
- PR merge metrics
- No merged PRs in 30d
Description
Describe the bug
When a guest program exits with any non-zero return value, H2's booter reports FAIL Unexpected exit status. and exits with code 1, instead of cleanly returning the guest's actual return value. A guest that returns 0 still works correctly.
To Reproduce
Steps to reproduce the behavior:
- Create a guest program that returns non-zero:
#include <stdio.h>
int main(){
printf("\nPRINTF\n");
return 100;
}
- Compile and run.
- Check the exit code: echo $? — observe it is 1 (with FAIL ... Unexpected exit status. in the output) instead of 100.
(Any non-zero return value reproduces this; return 0 still exits cleanly.)
Expected behavior
The booter should return/propagate the guest's actual exit status (e.g. 100). $? should equal the guest program's return value.
This bug is introduced by : https://github.com/qualcomm/hexagon-hypervisor/pull/65
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the H2 booter's handling of a guest program's exit status and reproduce the issue using the C guest program described in the report, which returns 100. Trace why non-zero guest exits become "Unexpected exit status" and status 1; done means the booter exits with the guest's actual non-zero status while return 0 still works.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- c
- Domain
- operating-systems
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 64/100