New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix "sync: inconsistent mutex state" panic #737

Merged
merged 3 commits into from Jan 18, 2018

Conversation

Projects
None yet
2 participants
@canning-duck
Contributor

canning-duck commented Jan 5, 2018

  • Fix the panic by preventing undue acquisition of the semaphore.
  • Implement the lifo parameter in runtime_SemacquireMutex (not strictly required but improve the mutex fairness).

TestMutexFairness is now passing. Tested with Go 1.9 (gopherjs test -v sync).

#736

@dmitshur

Thanks a lot for this fix @canning-duck.

I've tested your changes on the Go 1.10 branch and they work well. It fixes TestMutexFairness and the test program you posted in #736.

It's passing all tests on Go 1.9 too (via CI).

LGTM.

Show outdated Hide outdated compiler/natives/src/sync/sync.go Outdated

@dmitshur dmitshur merged commit 9b73d05 into gopherjs:master Jan 18, 2018

1 check passed

ci/circleci Your tests passed on CircleCI!
Details
@dmitshur

This comment has been minimized.

Show comment
Hide comment
@dmitshur

dmitshur Jan 18, 2018

Member

Thank you again @canning-duck for investigating and fixing this!

Member

dmitshur commented Jan 18, 2018

Thank you again @canning-duck for investigating and fixing this!

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