[libguestfs/el5] Fix segfault in LIBGUESTFS_TRACE.

Richard W.M. Jones rjones at fedoraproject.org
Wed Jun 27 14:38:16 UTC 2012


commit 7fc7bebf35a489621cb478083beee5d0a05f8f34
Author: Richard W.M. Jones <rjones at redhat.com>
Date:   Wed Jun 27 15:38:10 2012 +0100

    Fix segfault in LIBGUESTFS_TRACE.

 ....c-Include-config.h-in-this-generated-fil.patch |   29 ++++++++++++++
 ...EL-5-Don-t-run-regression-test-for-790721.patch |   40 --------------------
 README.EPEL-5                                      |    3 -
 libguestfs.spec                                    |   10 +++--
 4 files changed, 35 insertions(+), 47 deletions(-)
---
diff --git a/0001-src-actions.c-Include-config.h-in-this-generated-fil.patch b/0001-src-actions.c-Include-config.h-in-this-generated-fil.patch
new file mode 100644
index 0000000..5cdc22f
--- /dev/null
+++ b/0001-src-actions.c-Include-config.h-in-this-generated-fil.patch
@@ -0,0 +1,29 @@
+From 0ffcbb36b4baf33af7af0d9df7cdf1ce597036ca Mon Sep 17 00:00:00 2001
+From: Richard W.M. Jones <rjones at redhat.com>
+Date: Wed, 27 Jun 2012 15:30:56 +0100
+Subject: [PATCH] src/actions.c: Include <config.h> in this generated file.
+
+On RHEL 5, because _GNU_SOURCE was not defined, open_memstream was not
+being declared, resulting in miscompilation and a segfault in the
+trace code whenever open_memstream returned a pointer >= 0x80000000
+(which would be truncated to a 32 bit int and then sign-extended).
+---
+ generator/generator_c.ml |    2 ++
+ 1 files changed, 2 insertions(+), 0 deletions(-)
+
+diff --git a/generator/generator_c.ml b/generator/generator_c.ml
+index 3e7f314..d2275ac 100644
+--- a/generator/generator_c.ml
++++ b/generator/generator_c.ml
+@@ -658,6 +658,8 @@ and generate_client_actions () =
+   generate_header CStyle LGPLv2plus;
+ 
+   pr "\
++#include <config.h>
++
+ #include <stdio.h>
+ #include <stdlib.h>
+ #include <stdint.h>
+-- 
+1.7.4.1
+
diff --git a/README.EPEL-5 b/README.EPEL-5
index fcd3718..9f783a9 100644
--- a/README.EPEL-5
+++ b/README.EPEL-5
@@ -111,9 +111,6 @@ The following features may not work fully in this version of libguestfs:
 
  - virt-sysprep '--script' option (because it requires FUSE).
 
- - Enabling trace in multi-threaded programs may cause a segfault.
-   Appears to be caused by a bug in RHEL 5 glibc open_memstream(3).
-
 
 (5) Other notes
 ---------------
diff --git a/libguestfs.spec b/libguestfs.spec
index e199395..d1fe392 100644
--- a/libguestfs.spec
+++ b/libguestfs.spec
@@ -22,7 +22,7 @@ Summary:       Access and modify virtual machine disk images
 Name:          libguestfs
 Epoch:         1
 Version:       1.19.13
-Release:       1%{?dist}
+Release:       2%{?dist}
 License:       LGPLv2+
 Group:         Development/Libraries
 URL:           http://libguestfs.org/
@@ -60,7 +60,9 @@ Patch0016:     0016-EPEL-5-sparsify-Fix-command-line-options-for-old-qem.patch
 Patch0017:     0017-EPEL-5-Remove-Fedora-MD-test-images.patch
 Patch0018:     0018-EPEL-5-Add-mkisofs-to-package-list.patch
 Patch0019:     0019-EPEL-5-Add-1-second-pause-after-unmounting-any-files.patch
-Patch0020:     0020-EPEL-5-Don-t-run-regression-test-for-790721.patch
+
+# Upstream in libguestfs >= 1.19.14.
+Patch0020:     0001-src-actions.c-Include-config.h-in-this-generated-fil.patch
 
 # Basic build requirements:
 BuildRequires: /usr/bin/pod2man
@@ -910,11 +912,11 @@ rm -rf $RPM_BUILD_ROOT
 
 
 %changelog
-* Wed Jun 25 2012 Richard W.M. Jones <rjones at redhat.com> - 1:1.19.13-1
+* Wed Jun 27 2012 Richard W.M. Jones <rjones at redhat.com> - 1:1.19.13-2
 - New upstream version 1.19.13.
 - Update patches.
 
-* Tue Jun 25 2012 Richard W.M. Jones <rjones at redhat.com> - 1:1.19.12-3
+* Tue Jun 26 2012 Richard W.M. Jones <rjones at redhat.com> - 1:1.19.12-3
 - New upstream version 1.19.12.
 - Update patches.
 


More information about the scm-commits mailing list