[zookeeper] Fixed the atomic patch which actually caused recursive crashing on zookeeper_close. Patch taken fro

tstclair tstclair at fedoraproject.org
Thu Aug 15 19:43:12 UTC 2013


commit f9e1ace94b75c46a9dbeca9ff72813150e122f8e
Author: Timothy St. Clair <tstclair at redhat.com>
Date:   Thu Aug 15 14:40:39 2013 -0500

    Fixed the atomic patch which actually caused recursive crashing on
    zookeeper_close.  Patch taken from upstream as can be seen in spec.

 mt_adaptor.c.patch |   32 ++++++++++++++++++++++++++++++++
 zookeeper.spec     |    6 ++++--
 2 files changed, 36 insertions(+), 2 deletions(-)
---
diff --git a/mt_adaptor.c.patch b/mt_adaptor.c.patch
new file mode 100644
index 0000000..4b230d2
--- /dev/null
+++ b/mt_adaptor.c.patch
@@ -0,0 +1,32 @@
+Index: src/c/src/mt_adaptor.c
+===================================================================
+--- src/c/src/mt_adaptor.c	(revision 1447974)
++++ src/c/src/mt_adaptor.c	(working copy)
+@@ -484,25 +484,9 @@
+ int32_t fetch_and_add(volatile int32_t* operand, int incr)
+ {
+ #ifndef WIN32
+-    int32_t result;
+-    asm __volatile__(
+-         "lock xaddl %0,%1\n"
+-         : "=r"(result), "=m"(*(int *)operand)
+-         : "0"(incr)
+-         : "memory");
+-   return result;
++    return __sync_fetch_and_add(operand, incr);
+ #else
+-    volatile int32_t result;
+-    _asm
+-    {
+-        mov eax, operand; //eax = v;
+-       mov ebx, incr; // ebx = i;
+-        mov ecx, 0x0; // ecx = 0;
+-        lock xadd dword ptr [eax], ecx; 
+-       lock xadd dword ptr [eax], ebx; 
+-        mov result, ecx; // result = ebx;        
+-     }
+-     return result;    
++    return InterlockedExchangeAdd(operand, incr);
+ #endif
+ }
+ 
diff --git a/zookeeper.spec b/zookeeper.spec
index be67a14..ee79368 100644
--- a/zookeeper.spec
+++ b/zookeeper.spec
@@ -20,9 +20,10 @@ Patch2:        %{name}-3.4.5-zktreeutil-gcc.patch
 Patch3:        %{name}-3.4.5-disable-cygwin-detection.patch
 Patch4:        %{name}-3.4.5-build-contrib.patch
 Patch5:        %{name}-3.4.5-add-PIE-and-RELRO.patch
-Patch6:        %{name}-3.4.5-atomic.patch
+#Patch6:        %{name}-3.4.5-atomic.patch
 # remove date/time from console output since journald will keep track of date/time
 Patch7:        %{name}-3.4.5-log4j.patch
+Patch8:        https://issues.apache.org/jira/secure/attachment/12570030/mt_adaptor.c.patch
 
 BuildRequires: autoconf
 BuildRequires: automake
@@ -162,8 +163,9 @@ find -name "*.dll" -delete
 %patch3 -p0
 %patch4 -p1
 %patch5 -p1
-%patch6 -p1
+#%patch6 -p1
 %patch7 -p1
+%patch8 -p0 
 
 sed -i "s|<packaging>pom</packaging>|<packaging>jar</packaging>|" dist-maven/%{name}-%{version}.pom
 sed -i "s|<groupId>checkstyle</groupId>|<groupId>com.puppycrawl.tools</groupId>|" dist-maven/%{name}-%{version}.pom


More information about the scm-commits mailing list