Accepting request 162046 from devel:libraries:c_c++
Automatic submission by obs-autosubmit OBS-URL: https://build.opensuse.org/request/show/162046 OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/gc?expand=0&rev=27
This commit is contained in:
commit
cb835f5af3
@ -1,40 +0,0 @@
|
|||||||
From be9df82919960214ee4b9d3313523bff44fd99e1 Mon Sep 17 00:00:00 2001
|
|
||||||
From: Xi Wang <xi.wang@gmail.com>
|
|
||||||
Date: Thu, 15 Mar 2012 04:55:08 +0800
|
|
||||||
Subject: [PATCH] Fix allocation size overflows due to rounding.
|
|
||||||
|
|
||||||
* malloc.c (GC_generic_malloc): Check if the allocation size is
|
|
||||||
rounded to a smaller value.
|
|
||||||
* mallocx.c (GC_generic_malloc_ignore_off_page): Likewise.
|
|
||||||
---
|
|
||||||
malloc.c | 2 ++
|
|
||||||
mallocx.c | 2 ++
|
|
||||||
2 files changed, 4 insertions(+), 0 deletions(-)
|
|
||||||
|
|
||||||
diff --git a/malloc.c b/malloc.c
|
|
||||||
index cc0cc00..899d6ff 100644
|
|
||||||
--- a/malloc.c
|
|
||||||
+++ b/malloc.c
|
|
||||||
@@ -169,6 +169,8 @@ GC_API void * GC_CALL GC_generic_malloc(size_t lb, int k)
|
|
||||||
GC_bool init;
|
|
||||||
lg = ROUNDED_UP_GRANULES(lb);
|
|
||||||
lb_rounded = GRANULES_TO_BYTES(lg);
|
|
||||||
+ if (lb_rounded < lb)
|
|
||||||
+ return((*GC_get_oom_fn())(lb));
|
|
||||||
n_blocks = OBJ_SZ_TO_BLOCKS(lb_rounded);
|
|
||||||
init = GC_obj_kinds[k].ok_init;
|
|
||||||
LOCK();
|
|
||||||
diff --git a/mallocx.c b/mallocx.c
|
|
||||||
index 2c79f41..0d9c0a6 100644
|
|
||||||
--- a/mallocx.c
|
|
||||||
+++ b/mallocx.c
|
|
||||||
@@ -183,4 +183,6 @@ GC_INNER void * GC_generic_malloc_ignore_off_page(size_t lb, int k)
|
|
||||||
lg = ROUNDED_UP_GRANULES(lb);
|
|
||||||
lb_rounded = GRANULES_TO_BYTES(lg);
|
|
||||||
+ if (lb_rounded < lb)
|
|
||||||
+ return((*GC_get_oom_fn())(lb));
|
|
||||||
n_blocks = OBJ_SZ_TO_BLOCKS(lb_rounded);
|
|
||||||
init = GC_obj_kinds[k].ok_init;
|
|
||||||
--
|
|
||||||
1.7.7
|
|
||||||
|
|
@ -1,32 +0,0 @@
|
|||||||
From e10c1eb9908c2774c16b3148b30d2f3823d66a9a Mon Sep 17 00:00:00 2001
|
|
||||||
From: Xi Wang <xi.wang@gmail.com>
|
|
||||||
Date: Thu, 15 Mar 2012 04:46:49 +0800
|
|
||||||
Subject: [PATCH] Fix calloc() overflow
|
|
||||||
|
|
||||||
* malloc.c (calloc): Check multiplication overflow in calloc(),
|
|
||||||
assuming REDIRECT_MALLOC.
|
|
||||||
---
|
|
||||||
malloc.c | 5 +++++
|
|
||||||
1 files changed, 5 insertions(+), 0 deletions(-)
|
|
||||||
|
|
||||||
diff --git a/malloc.c b/malloc.c
|
|
||||||
index da68f13..cc0cc00 100644
|
|
||||||
--- a/malloc.c
|
|
||||||
+++ b/malloc.c
|
|
||||||
@@ -372,8 +372,13 @@ void * malloc(size_t lb)
|
|
||||||
}
|
|
||||||
#endif /* GC_LINUX_THREADS */
|
|
||||||
|
|
||||||
+#ifndef SIZE_MAX
|
|
||||||
+#define SIZE_MAX (~(size_t)0)
|
|
||||||
+#endif
|
|
||||||
void * calloc(size_t n, size_t lb)
|
|
||||||
{
|
|
||||||
+ if (lb && n > SIZE_MAX / lb)
|
|
||||||
+ return NULL;
|
|
||||||
# if defined(GC_LINUX_THREADS) /* && !defined(USE_PROC_FOR_LIBRARIES) */
|
|
||||||
/* libpthread allocated some memory that is only pointed to by */
|
|
||||||
/* mmapped thread stacks. Make sure it's not collectable. */
|
|
||||||
--
|
|
||||||
1.7.7
|
|
||||||
|
|
@ -1,39 +0,0 @@
|
|||||||
From 6a93f8e5bcad22137f41b6c60a1c7384baaec2b3 Mon Sep 17 00:00:00 2001
|
|
||||||
From: Ivan Maidanski <ivmai@mail.ru>
|
|
||||||
Date: Thu, 15 Mar 2012 20:30:11 +0400
|
|
||||||
Subject: [PATCH] Fix calloc-related code to prevent SIZE_MAX redefinition in
|
|
||||||
sys headers
|
|
||||||
|
|
||||||
* malloc.c: Include limits.h for SIZE_MAX.
|
|
||||||
* malloc.c (SIZE_MAX, calloc): Define GC_SIZE_MAX instead of SIZE_MAX.
|
|
||||||
---
|
|
||||||
malloc.c | 10 +++++++---
|
|
||||||
1 files changed, 7 insertions(+), 3 deletions(-)
|
|
||||||
|
|
||||||
diff --git a/malloc.c b/malloc.c
|
|
||||||
index 899d6ff..cb49a5c 100644
|
|
||||||
--- a/malloc.c
|
|
||||||
+++ b/malloc.c
|
|
||||||
@@ -374,12 +374,16 @@ void * malloc(size_t lb)
|
|
||||||
}
|
|
||||||
#endif /* GC_LINUX_THREADS */
|
|
||||||
|
|
||||||
-#ifndef SIZE_MAX
|
|
||||||
-#define SIZE_MAX (~(size_t)0)
|
|
||||||
+#include <limits.h>
|
|
||||||
+#ifdef SIZE_MAX
|
|
||||||
+# define GC_SIZE_MAX SIZE_MAX
|
|
||||||
+#else
|
|
||||||
+# define GC_SIZE_MAX (~(size_t)0)
|
|
||||||
#endif
|
|
||||||
+
|
|
||||||
void * calloc(size_t n, size_t lb)
|
|
||||||
{
|
|
||||||
- if (lb && n > SIZE_MAX / lb)
|
|
||||||
+ if (lb && n > GC_SIZE_MAX / lb)
|
|
||||||
return NULL;
|
|
||||||
# if defined(GC_LINUX_THREADS) /* && !defined(USE_PROC_FOR_LIBRARIES) */
|
|
||||||
/* libpthread allocated some memory that is only pointed to by */
|
|
||||||
--
|
|
||||||
1.7.7
|
|
||||||
|
|
@ -1,34 +0,0 @@
|
|||||||
From 83231d0ab5ed60015797c3d1ad9056295ac3b2bb Mon Sep 17 00:00:00 2001
|
|
||||||
From: Hans Boehm <Hans.Boehm@hp.com>
|
|
||||||
Date: Thu, 15 Mar 2012 21:09:05 +0400
|
|
||||||
Subject: [PATCH] Speedup calloc size overflow check by preventing division if
|
|
||||||
small values
|
|
||||||
|
|
||||||
* malloc.c (GC_SQRT_SIZE_MAX): New macro.
|
|
||||||
* malloc.c (calloc): Add fast initial size overflow check to avoid
|
|
||||||
integer division for reasonably small values passed.
|
|
||||||
---
|
|
||||||
malloc.c | 5 ++++-
|
|
||||||
1 files changed, 4 insertions(+), 1 deletions(-)
|
|
||||||
|
|
||||||
diff --git a/malloc.c b/malloc.c
|
|
||||||
index cb49a5c..c9b9eb6 100644
|
|
||||||
--- a/malloc.c
|
|
||||||
+++ b/malloc.c
|
|
||||||
@@ -381,9 +381,12 @@ void * malloc(size_t lb)
|
|
||||||
# define GC_SIZE_MAX (~(size_t)0)
|
|
||||||
#endif
|
|
||||||
|
|
||||||
+#define GC_SQRT_SIZE_MAX ((1U << (WORDSZ / 2)) - 1)
|
|
||||||
+
|
|
||||||
void * calloc(size_t n, size_t lb)
|
|
||||||
{
|
|
||||||
- if (lb && n > GC_SIZE_MAX / lb)
|
|
||||||
+ if ((lb | n) > GC_SQRT_SIZE_MAX /* fast initial test */
|
|
||||||
+ && lb && n > GC_SIZE_MAX / lb)
|
|
||||||
return NULL;
|
|
||||||
# if defined(GC_LINUX_THREADS) /* && !defined(USE_PROC_FOR_LIBRARIES) */
|
|
||||||
/* libpthread allocated some memory that is only pointed to by */
|
|
||||||
--
|
|
||||||
1.7.7
|
|
||||||
|
|
@ -1,3 +0,0 @@
|
|||||||
version https://git-lfs.github.com/spec/v1
|
|
||||||
oid sha256:7d62742cdb32a8f9ca2a8ede3511f1b019ca3c663240ef2fd513ffd3a058dbd2
|
|
||||||
size 1011054
|
|
3
gc-7.2d.tar.gz
Normal file
3
gc-7.2d.tar.gz
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
version https://git-lfs.github.com/spec/v1
|
||||||
|
oid sha256:d9fe0ae8650d43746a48bfb394cab01a319f3809cee19f8ebd16aa985b511c5e
|
||||||
|
size 1263064
|
@ -1,12 +0,0 @@
|
|||||||
Index: gc-7.2alpha6/Makefile.am
|
|
||||||
===================================================================
|
|
||||||
--- gc-7.2alpha6.orig/Makefile.am
|
|
||||||
+++ gc-7.2alpha6/Makefile.am
|
|
||||||
@@ -104,7 +104,6 @@ EXTRA_libgc_la_SOURCES = alpha_mach_dep.
|
|
||||||
|
|
||||||
if CPLUSPLUS
|
|
||||||
lib_LTLIBRARIES += libgccpp.la
|
|
||||||
-pkginclude_HEADERS += include/gc_cpp.h include/gc_allocator.h
|
|
||||||
libgccpp_la_SOURCES = gc_cpp.cc
|
|
||||||
libgccpp_la_LIBADD = ./libgc.la
|
|
||||||
libgccpp_la_LDFLAGS = -version-info 1:3:0 -no-undefined
|
|
@ -1,3 +1,12 @@
|
|||||||
|
-------------------------------------------------------------------
|
||||||
|
Mon Mar 25 14:50:51 UTC 2013 - dmueller@suse.com
|
||||||
|
|
||||||
|
- update to 7.2d
|
||||||
|
+ no upstream changelog available, but bring it two years
|
||||||
|
further up to date
|
||||||
|
- remove all patches. All upstream meanwhile
|
||||||
|
- fix packaging of atomic_ops.pc
|
||||||
|
|
||||||
-------------------------------------------------------------------
|
-------------------------------------------------------------------
|
||||||
Sun Mar 3 20:42:59 UTC 2013 - jengelh@inai.de
|
Sun Mar 3 20:42:59 UTC 2013 - jengelh@inai.de
|
||||||
|
|
||||||
|
20
gc.spec
20
gc.spec
@ -19,18 +19,12 @@
|
|||||||
Name: gc
|
Name: gc
|
||||||
Version: 7.1.9.6
|
Version: 7.1.9.6
|
||||||
Release: 0
|
Release: 0
|
||||||
%define src_ver 7.2alpha6
|
%define src_ver 7.2d
|
||||||
Url: http://www.hpl.hp.com/personal/Hans_Boehm/gc/
|
Url: http://www.hpl.hp.com/personal/Hans_Boehm/gc/
|
||||||
Summary: A garbage collector for C and C++
|
Summary: A garbage collector for C and C++
|
||||||
License: BSD-3-Clause
|
License: BSD-3-Clause
|
||||||
Group: Development/Libraries/C and C++
|
Group: Development/Libraries/C and C++
|
||||||
Source: %{name}-%{src_ver}.tar.bz2
|
Source: http://www.hpl.hp.com/personal/Hans_Boehm/gc/gc_source/%{name}-%{src_ver}.tar.gz
|
||||||
Patch0: %{name}-build.patch
|
|
||||||
Patch1: 0001-Fix-allocation-size-overflows-due-to-rounding.patch
|
|
||||||
Patch2: 0001-Fix-calloc-overflow.patch
|
|
||||||
Patch3: 0001-Fix-calloc-related-code-to-prevent-SIZE_MAX-redefini.patch
|
|
||||||
Patch4: 0001-Speedup-calloc-size-overflow-check-by-preventing-div.patch
|
|
||||||
|
|
||||||
BuildRoot: %{_tmppath}/%{name}-%{version}-build
|
BuildRoot: %{_tmppath}/%{name}-%{version}-build
|
||||||
BuildRequires: autoconf >= 2.64
|
BuildRequires: autoconf >= 2.64
|
||||||
BuildRequires: gcc-c++
|
BuildRequires: gcc-c++
|
||||||
@ -92,12 +86,7 @@ considers memory barrier semantics, and allows the construction of code
|
|||||||
that involves minimum overhead across a variety of architectures.
|
that involves minimum overhead across a variety of architectures.
|
||||||
|
|
||||||
%prep
|
%prep
|
||||||
%setup -q -n %{name}-%{src_ver}
|
%setup -q -n %{name}-7.2
|
||||||
%patch0 -p1
|
|
||||||
%patch1 -p1
|
|
||||||
%patch2 -p1
|
|
||||||
%patch3 -p1
|
|
||||||
%patch4 -p1
|
|
||||||
|
|
||||||
%build
|
%build
|
||||||
# refresh auto*/libtool to purge rpaths
|
# refresh auto*/libtool to purge rpaths
|
||||||
@ -148,7 +137,7 @@ make check -C libatomic_ops ||:
|
|||||||
%defattr(-, root, root)
|
%defattr(-, root, root)
|
||||||
%doc doc/[a-z]*
|
%doc doc/[a-z]*
|
||||||
%{_libdir}/lib*.so
|
%{_libdir}/lib*.so
|
||||||
%{_libdir}/pkgconfig/*.pc
|
%{_libdir}/pkgconfig/bdw-gc.pc
|
||||||
%{_includedir}/gc.h
|
%{_includedir}/gc.h
|
||||||
%{_includedir}/gc_cpp.h
|
%{_includedir}/gc_cpp.h
|
||||||
%{_includedir}/gc
|
%{_includedir}/gc
|
||||||
@ -157,6 +146,7 @@ make check -C libatomic_ops ||:
|
|||||||
%defattr(-,root,root,-)
|
%defattr(-,root,root,-)
|
||||||
%doc libatomic_ops/AUTHORS libatomic_ops/ChangeLog libatomic_ops/COPYING libatomic_ops/NEWS libatomic_ops/README
|
%doc libatomic_ops/AUTHORS libatomic_ops/ChangeLog libatomic_ops/COPYING libatomic_ops/NEWS libatomic_ops/README
|
||||||
%doc libatomic_ops/doc/*.txt
|
%doc libatomic_ops/doc/*.txt
|
||||||
|
%{_libdir}/pkgconfig/atomic_ops.pc
|
||||||
%{_includedir}/atomic_ops.h
|
%{_includedir}/atomic_ops.h
|
||||||
%{_includedir}/atomic_ops_malloc.h
|
%{_includedir}/atomic_ops_malloc.h
|
||||||
%{_includedir}/atomic_ops_stack.h
|
%{_includedir}/atomic_ops_stack.h
|
||||||
|
Loading…
Reference in New Issue
Block a user