[libwvstreams] Fixed crashed caused by compiler optimizations

Michal Sekletar msekleta at fedoraproject.org
Mon Jun 4 07:33:51 UTC 2012


commit 2c3b9aaad9fa7b3257ffbd2f4d76363ae4799def
Author: Michal Sekletar <msekleta at redhat.com>
Date:   Mon Jun 4 09:33:10 2012 +0200

    Fixed crashed caused by compiler optimizations

 libwvstreams.spec           |    7 ++++++-
 wvstreams-4.6.1-magic.patch |   35 +++++++++++++++++++++++++++++++++++
 2 files changed, 41 insertions(+), 1 deletions(-)
---
diff --git a/libwvstreams.spec b/libwvstreams.spec
index 13b3394..9ddc7bc 100644
--- a/libwvstreams.spec
+++ b/libwvstreams.spec
@@ -1,6 +1,6 @@
 Name: libwvstreams
 Version: 4.6.1
-Release: 4%{?dist}
+Release: 5%{?dist}
 Summary: WvStreams is a network programming library written in C++
 Source: http://wvstreams.googlecode.com/files/wvstreams-%{version}.tar.gz
 #fixed multilib issue (bug #192717)
@@ -16,6 +16,7 @@ Patch4: wvstreams-4.6.1-statinclude.patch
 Patch5: wvstreams-4.6.1-gcc.patch
 # fix missing unistd.h header for gcc 4.7
 Patch6: wvstreams-4.6.1-gcc47.patch
+Patch7: wvstreams-4.6.1-magic.patch
 URL: http://alumnit.ca/wiki/index.php?page=WvStreams
 Group: System Environment/Libraries
 BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
@@ -44,6 +45,7 @@ needed for developing applications which use WvStreams.
 %patch4 -p1 -b .statinclude
 %patch5 -p1 -b .gcc
 %patch6 -p1 -b .gcc47
+%patch7 -p1 -b .magic
 
 %build
 #  --without-PACKAGE       do not use PACKAGE (same as --with-PACKAGE=no)
@@ -96,6 +98,9 @@ rm -rf $RPM_BUILD_ROOT
 %postun -p /sbin/ldconfig
 
 %changelog
+* Mon Jun 04 2012 Michal Sekletar <msekleta at redhat.com> - 4.6.1-5
+- Fix crashes caused by compiler optimizations, #812651
+
 * Thu Jan 05 2012 Jan Synáček <jsynacek at redhat.com> - 4.6.1-4
 - Fix missing unistd.h header for gcc 4.7
 
diff --git a/wvstreams-4.6.1-magic.patch b/wvstreams-4.6.1-magic.patch
new file mode 100644
index 0000000..05928a3
--- /dev/null
+++ b/wvstreams-4.6.1-magic.patch
@@ -0,0 +1,35 @@
+diff -up wvstreams-4.6.1/include/wvtask.h.magic wvstreams-4.6.1/include/wvtask.h
+--- wvstreams-4.6.1/include/wvtask.h.magic	2008-07-14 21:11:35.000000000 +0200
++++ wvstreams-4.6.1/include/wvtask.h	2012-06-03 17:24:47.909187849 +0200
+@@ -45,7 +45,8 @@ class WvTask
+     typedef void TaskFunc(void *userdata);
+     
+     static int taskcount, numtasks, numrunning;
+-    int magic_number, *stack_magic;
++    int volatile magic_number;
++    int *stack_magic;
+     WvString name;
+     int tid;
+     
+@@ -84,7 +85,7 @@ class WvTaskMan
+     static WvTaskMan *singleton;
+     static int links;
+     
+-    static int magic_number;
++    static int volatile magic_number;
+     static WvTaskList all_tasks, free_tasks;
+     
+     static void get_stack(WvTask &task, size_t size);
+diff -up wvstreams-4.6.1/utils/wvtask.cc.magic wvstreams-4.6.1/utils/wvtask.cc
+--- wvstreams-4.6.1/utils/wvtask.cc.magic	2009-05-13 23:42:52.000000000 +0200
++++ wvstreams-4.6.1/utils/wvtask.cc	2012-06-03 14:29:09.729656804 +0200
+@@ -58,7 +58,8 @@ char *alloca ();
+ int WvTask::taskcount, WvTask::numtasks, WvTask::numrunning;
+ 
+ WvTaskMan *WvTaskMan::singleton;
+-int WvTaskMan::links, WvTaskMan::magic_number;
++int WvTaskMan::links;
++int volatile WvTaskMan::magic_number;
+ WvTaskList WvTaskMan::all_tasks, WvTaskMan::free_tasks;
+ ucontext_t WvTaskMan::stackmaster_task, WvTaskMan::get_stack_return,
+     WvTaskMan::toplevel;


More information about the scm-commits mailing list