Skip to content
This repository was archived by the owner on Mar 24, 2022. It is now read-only.
This repository was archived by the owner on Mar 24, 2022. It is now read-only.

Instances are not wholly cleaned up when they error out due to unexpected signal stack sizes. #455

@fst-crenshaw

Description

@fst-crenshaw

The moment when the lucet runtime switches into a guest to extract the instance's result is a function called swap_and_return. If the call to self.with_signals_on returns with an Error resulting from an unexpected signal stack size, swap_and_return returns without cleaning up the borrowed instance. As in, this doesn't happen.

        CURRENT_INSTANCE.with(|current_instance| {
            *current_instance.borrow_mut() = None;
        });

That moment is here:

To reproduce the issue:

  1. Go to ~/lucet-runtime/lucet-runtime-internal
  2. Run cargo test -- --test-threads=1

The result:

---- alloc::tests::reject_sigstack_smaller_than_min stdout ----
thread 'main' panicked at 'no other instance is running on this thread', lucet-runtime/lucet-runtime-internals/src/instance.rs:956:13
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace.
failures:
  alloc::tests::reject_sigstack_smaller_than_min
test result: FAILED. 65 passed; 1 failed; 0 ignored; 0 measured; 0 filtered out
error: test failed, to rerun pass '--lib'

Tactically, what happens:

This test fails (expectedly) but the cleanup doesn't happen.
alloc::tests::reject_debug_sigstack_smaller_than_12kib

So this test fails (unexpectedly):
alloc::tests::reject_sigstack_smaller_than_min

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