Skip to content

Borrow hazard in IDBTransaction::ObjectStore #39946

@jdm

Description

@jdm

We start a mutable borrow here:

let mut store_handles = self.store_handles.borrow_mut();

We call a method that can transitively GC here:

let store = IDBObjectStore::new(
&self.global(),
self.db.get_name(),
name,
parameters.as_ref(),
CanGc::note(),
self,
);

When a GC occurs, we panic while trying to trace the self.store_handles member because the mutable borrow is still active.

This can be reproduced with ./mach test-wpt /IndexedDB/nested-cloning-large.any.html --pref js_mem_gc_zeal_level=2 --pref js_mem_gc_zeal_frequency=1 --timeout-multiplier=20 in a --debug-mozjs build.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions