Skip to content

Conversation

billiegoose
Copy link
Member

Somehow, "Mutex double-freed" has occurred ~200 times in production over the last 30 days.

So far the only possibility I see is maybe there is a way that PromisifiedFS can _deactivate twice, since _deactivationTimeout is written to in two places.

That said, _deactivate itself is written to handle concurrency: you could call it 100 times concurrently, and it should only ever call this._mutex.release() once. So I don't see how this can fix anything.

@billiegoose billiegoose self-assigned this Mar 3, 2020
@billiegoose billiegoose changed the title a shot in the dark at fixing the "Mutex double-freed" error fix: a shot in the dark at fixing the "Mutex double-freed" error Mar 3, 2020
// need to attempt to release the mutex
this._activate().then(() => {
if (this._operations.size === 0) {
if (this._operations.size === 0 && !this._deactivationTimeout) {
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I hope that the identifier is always a non-zero integer :trollface:
I'd need to look at the spec, but if it's not a hard requirement... 😆

Copy link
Member Author

@billiegoose billiegoose Mar 3, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I looked at the spec. 😆

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

let handle be a user-agent-defined integer that is greater than zero

source: https://html.spec.whatwg.org/multipage/timers-and-user-prompts.html

@billiegoose billiegoose merged commit 7941b9c into master Mar 3, 2020
@billiegoose billiegoose deleted the fix/mutex-double-free branch March 3, 2020 04:10
@isomorphic-git-bot
Copy link
Member

🎉 This PR is included in version 3.4.2 🎉

The release is available on:

Your semantic-release bot 📦🚀

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

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants