[libpfm] Avoid triggering swig segfault

William Eden Cohen wcohen at fedoraproject.org
Fri Jun 8 18:06:22 UTC 2012


commit 1bd5d57e0dde81ee4dd97b311028b716f78fd11e
Author: William Cohen <wcohen at redhat.com>
Date:   Fri Jun 8 13:55:16 2012 -0400

    Avoid triggering swig segfault
    
    When building with swig 2.0.7 in rawhide the the printing of a warning
    message in swig would cause swig to segfault.  This patch avoids the error
    message and allow libpfm to build.

 libpfm-swig.patch |   11 +++++++++++
 libpfm.spec       |    7 ++++++-
 2 files changed, 17 insertions(+), 1 deletions(-)
---
diff --git a/libpfm-swig.patch b/libpfm-swig.patch
new file mode 100644
index 0000000..12d31d8
--- /dev/null
+++ b/libpfm-swig.patch
@@ -0,0 +1,11 @@
+diff -up libpfm-4.2.0/python/src/perfmon_int.i.ill libpfm-4.2.0/python/src/perfmon_int.i
+--- libpfm-4.2.0/python/src/perfmon_int.i.ill	2012-06-08 12:39:16.872998571 -0400
++++ libpfm-4.2.0/python/src/perfmon_int.i	2012-06-08 12:39:30.183000006 -0400
+@@ -92,7 +92,6 @@ ptr_argout(pfm_event_attr_info_t);
+ 
+ /* Kernel interface */
+ %include <perfmon/perf_event.h>
+-ptr_argout(perf_event_attr_t);
+ 
+ /* Library interface */
+ /* We never set the const char * members. So no memory leak */
diff --git a/libpfm.spec b/libpfm.spec
index 6eb0999..ec7272b 100644
--- a/libpfm.spec
+++ b/libpfm.spec
@@ -10,7 +10,7 @@
 
 Name:		libpfm
 Version:	4.2.0
-Release:	6%{?dist}
+Release:	7%{?dist}
 
 Summary:	Library to encode performance events for use by perf tool
 
@@ -20,6 +20,7 @@ URL:		http://perfmon2.sourceforge.net/
 Source0:	http://sourceforge.net/projects/perfmon2/files/libpfm4/%{name}-%{version}.tar.gz
 Patch1: libpfm4-python.patch
 Patch2: libpfm-siginfo_t.patch
+Patch3: libpfm-swig.patch
 
 %if %{with python}
 BuildRequires:	python-devel
@@ -66,6 +67,7 @@ Python bindings for libpfm4 and perf_event_open system call.
 
 %patch1 -p1
 %patch2 -p1
+%patch3 -p1
 
 %build
 %if %{with python}
@@ -112,6 +114,9 @@ make \
 %endif
 
 %changelog
+* Fri Jun 8 2012 William Cohen <wcohen at redhat.com> 4.2.0-7
+- Eliminate swig error.
+
 * Thu Jun 7 2012 William Cohen <wcohen at redhat.com> 4.2.0-6
 - Eliminate rpm_build_root macro in build section.
 - Correct location of shared library files.


More information about the scm-commits mailing list