Closed Bug 546415 Opened 15 years ago Closed 7 years ago

If you call VMPI_lockRelease twice on the same lock we should assert/crash

Categories

(Tamarin Graveyard :: Virtual Machine, defect)

x86
macOS
defect
Not set
normal

Tracking

(Not tracked)

RESOLVED WONTFIX

People

(Reporter: treilly, Unassigned)

Details

Attachments

(3 files)

Right now it just silently ignores the second lock release call
Flags: flashplayer-qrb+
Target Milestone: --- → Future
Assignee: nobody → treilly
Status: NEW → ASSIGNED
Priority: -- → P3
Target Milestone: Future → flash10.1
Deferring to 10.2.
Target Milestone: flash10.1 → flash10.2
Poaching, I'm currently looking into a related bug, we need to nail down the VMPI for this properly.
Assignee: treilly → lhansen
Changes documentation / semantics to being less lenient / easier to implement / less error prone; locks that are used when they're not in the appropriate state will cause asserts in debug builds. This includes locking locked locks, unlocking unlocked locks, and unlocking locks held by other threads. I need to know if this is too draconian. Note I've dispensed with the return values for lockAcquire and lockRelease; they were almost never being checked, and when they were checked they were checked by GCAssert. Instead the assertions in the platform layer make sure that that kind of checking is always happening. Updates to the platform layers as well as to vm code will follow.
Attachment #444098 - Flags: review?(treilly)
Attachment #444098 - Flags: review?(edwsmith)
This diff probably looks bigger than it is. The changes are: - changes in return types from bool to void in a couple of cases - debug code on all platforms - change in how the unix implementation is factored. Tested on Mac only so far, consider it a little preliminary but good enough to review. On Mac it appears to uncover a bug; regress/bug_515935.abc apparently leaves a lock hanging during OOM abort and that triggers an assert. That probably means FixedMalloc needs to set up an unwind handler, but the bigger question is whether there are going to be similar problems for OOM handling elsewhere.
Attachment #444099 - Flags: review?(treilly)
Attachment #444099 - Flags: review?(edwsmith)
Very gentle changes resulting from no longer returning values from VMPI_lockAcquire and VMPI_lockRelease.
Attachment #444100 - Flags: review?(treilly)
Attachment #444100 - Flags: review?(edwsmith)
Attachment #444098 - Flags: review?(edwsmith) → review+
Comment on attachment 444098 [details] [diff] [review] New VMPI spec for locking primitives Adding simon for feedback since this relates to bug 555760 which adds more VMPI concurrency apis.
Attachment #444098 - Flags: feedback?(siwilkin)
Attachment #444099 - Flags: review?(edwsmith) → review+
Attachment #444100 - Flags: review?(edwsmith) → review+
Whiteboard: has-patch
One comment: For VMPI_lockDestroy I can see the utility of documenting: "..The lock must not be held by any thread when this function is called." But trying to actually ASSERT it is a race-condition.
Attachment #444098 - Flags: review?(treilly) → review+
Comment on attachment 444099 [details] [diff] [review] Implementation of VMPI locking primitives rubber stamping, gave it a quick scan, just noticed that VMPI_lockRelease for mac has an = that should be a ==
Attachment #444099 - Flags: review?(treilly) → review+
Attachment #444100 - Flags: review?(treilly) → review+
(In reply to comment #8) > (From update of attachment 444099 [details] [diff] [review]) > rubber stamping, gave it a quick scan, just noticed that VMPI_lockRelease for > mac has an = that should be a == That bug appears elsewhere in the patch, e.g. in symbian-platform.h ...
(In reply to comment #7) > One comment: > For VMPI_lockDestroy I can see the utility of documenting: "..The lock must not > be held by any thread when this function is called." > But trying to actually ASSERT it is a race-condition. It's a race, but isn't it a benign one, in that the assert does not catch all the cases where the invariant is violated, but when it does fire there's definitely a violation?
(Patch can't land without considering the need for an unwind handler around the FixedMalloc locks, at a minimum, and the consequences for the Flash Player are not understood.)
(In reply to comment #9) > (In reply to comment #8) > > (From update of attachment 444099 [details] [diff] [review] [details]) > > rubber stamping, gave it a quick scan, just noticed that VMPI_lockRelease for > > mac has an = that should be a == > > That bug appears elsewhere in the patch, e.g. in symbian-platform.h ... I checked all the files and I found those two cases, no others.
Attachment #444098 - Flags: feedback?(siwilkin)
(Removing has-patch since we're still blocked on a reasonable unwind handler, see comment #11.)
Whiteboard: has-patch
Removing targeting and unassigning; it's not clear that fixing this is actually desirable - ignoring the second call might be the right thing to do, or at most print a message in debug mode.
Assignee: lhansen → nobody
Status: ASSIGNED → NEW
Priority: P3 → --
Target Milestone: flash10.2 → ---
Status: NEW → RESOLVED
Closed: 7 years ago
Resolution: --- → WONTFIX
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: