Skip to content

Possible unsoundness in AssetManager #161

@blaind

Description

@blaind

Seems like the method below (in android-activity/src/game_activity/mod.rs) takes a pointer to the NativeAppGlue (self.native_app) struct, which may be dropped before the AssetManager itself.

pub fn asset_manager(&self) -> AssetManager {
    unsafe {
        let app_ptr = self.native_app.as_ptr();
        let am_ptr = NonNull::new_unchecked((*(*app_ptr).activity).assetManager);
        AssetManager::from_ptr(am_ptr)
    }
}

calling an asset manager method such as open is causing a SIGABRT with a message of FORTIFY: pthread_mutex_lock called on a destroyed mutex (0xb400007643074c50)

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingsafetySomething that relates to a safety or soundness issue

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions