diff --git a/00-fix-locking-order.patch b/00-fix-locking-order.patch new file mode 100644 index 0000000..6f09f02 --- /dev/null +++ b/00-fix-locking-order.patch @@ -0,0 +1,14 @@ +diff --git a/deadlock.go b/deadlock.go +index 6f8f81e..68c7b7a 100644 +--- a/deadlock.go ++++ b/deadlock.go +@@ -189,8 +189,8 @@ func lock(lockFn func(), ptr interface{}) { + if buf, ok := Opts.LogBuf.(*bufio.Writer); ok { + buf.Flush() + } +- lo.mu.Unlock() + Opts.mu.Unlock() ++ lo.mu.Unlock() + Opts.OnPotentialDeadlock() + <-ch + PostLock(4, ptr) diff --git a/golang-github-sasha-s-go-deadlock.spec b/golang-github-sasha-s-go-deadlock.spec index 35fcaad..203b7b9 100644 --- a/golang-github-sasha-s-go-deadlock.spec +++ b/golang-github-sasha-s-go-deadlock.spec @@ -31,12 +31,16 @@ Name: golang-%{provider}-%{project}-%{repo} Version: 0.2.0 -Release: 2%{?dist} +Release: 3%{?dist} Summary: Online deadlock detection in go License: ASL 2.0 URL: https://%{provider_prefix} Source0: https://%{provider_prefix}/archive/%{commit}/%{project}-%{repo}-%{shortcommit}.tar.gz +# Upstream patch to fix a locking order, from commit: +# https://github.com/sasha-s/go-deadlock/commit/89fc81536521522e45c1465e2b40879d55a17406 +Patch0: 00-fix-locking-order.patch + # e.g. el6 has ppc64 arch without gcc-go, so EA tag is required ExclusiveArch: %{?go_arches:%{go_arches}}%{!?go_arches:%{ix86} x86_64 aarch64 %{arm}} # If go_compiler is not set to 1, there is no virtual provide. Use golang instead. @@ -84,6 +88,7 @@ providing packages with %{import_path} prefix. %prep %setup -q -n %{repo}-%{commit} +%patch0 -p1 %build @@ -164,6 +169,9 @@ export GOPATH=%{buildroot}/%{gopath}:%{gopath} %changelog +* Fri Jun 01 2018 Fabio Valentini - 0.2.0-3 +- Add upstream patch to fix a potential race condition. + * Wed Feb 07 2018 Fedora Release Engineering - 0.2.0-2 - Rebuilt for https://fedoraproject.org/wiki/Fedora_28_Mass_Rebuild