Closed Bug 1539538 Opened 6 years ago Closed 6 years ago

Add validity checks to containers of bare pointers in IDB and LS

Categories

(Core :: Storage: localStorage & sessionStorage, enhancement, P2)

enhancement

Tracking

()

RESOLVED FIXED
mozilla68
Tracking Status
firefox68 --- fixed

People

(Reporter: ytausky, Assigned: ytausky)

References

(Blocks 1 open bug)

Details

Attachments

(1 file)

We have several containers storing bare pointers to refcounted objects. In the interest of preventing both invalid dereferencing and hanging because of a dangling entry, we should add optional assertions that verify that these pointers get removed before their pointees are destructed.

Yeah, we need this ASAP.

Attached file Introduce UnsafePtr

This commit adds a smart pointer class that verifies that no dangling
pointers remain after the pointee went out of scope. This verification is
opt-in and can be controlled both statically and dynamically by the pointee.

Blocks: 1540402

It would be nice to incorporate patches from this try push:
https://treeherder.mozilla.org/#/jobs?repo=try&revision=725b8386948bb6010f72b6fa53f8e327c4bab9d1
unsafeptr-hash and unsafeptr-idb

unsafeptr-hash needs to be polished, I just quickly created MyHashtable to avoid problems with memmove()

Blocks: 1541370
Blocks: 1543089
Status: ASSIGNED → RESOLVED
Closed: 6 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla68
See Also: → 1622924
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: