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 3 commits into from Jan 18, 2018


None yet
2 participants

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).



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).


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!

This comment has been minimized.

Show comment
Hide comment

dmitshur Jan 18, 2018


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


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