skift-org/skift

Kernel panics on PROCESS_FAILURE

adi-g15 opened this issue · 0 comments

Describe the bug
Returning PROCESS_FAILURE (1) from main, from a userspace program causing a kernel panic.
I don't know it's intentional or not, but it handles the error itself too, still causes a kernel panic.

To Reproduce
Execute any wrong command:
a. displayctl
b. displayctl -s 1920*1080

Expected behavior
The program either gives help or print input is wrong (which it does, but then goes on to a kernel panic)

Screenshots
Expected, stops at this:
2021-11-04_10-43

Actual:
2021-11-04_01-30

Additional context
Related issues: adi-g15#2

Two causes observed causing kernel panic:

  1. main() returns 1
  2. Returning Shell::ArgParseResult::FAILURE from functions called by Shell::Argparse

Fixing it 'just to work' can be:
adi-g15@073e8ed