Skip to content

Why does teeos panic during exit? #162847

Description

@maxdexh

I was reading the platform sources for the runtime and I found this peculiar sys::cleanup implementation on teeos (aarch64-unknown-teeos):

pub unsafe fn cleanup() {
unimplemented!()
// We do NOT have stack overflow handler, because TEE OS will kill TA when it happens.
// So cleanup is commented
// stack_overflow::cleanup();
}

This function is always invoked after main. The unsupported.rs implementation is to just do nothing, but this is panicking instead. Even if it is somehow intentional, an rtabort call would surely be much more appropriate in this context, given that unimplemented involves a call to the global allocator and panic hook.

It just looks wrong. Am I missing something?

@rustbot label T-libs O-teeos

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    C-bugCategory: This is a bug.O-teeosTarget: Arm's secure enclave that code isn't supposed to be able to jailbreakT-libsRelevant to the library team, which will review and decide on the PR/issue.

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions