Skip to content

Return value other that 0 results in "Unexpected exit status" #79

Description

@quic-k

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 : #65

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions