Commit bfff4ae3 authored by Julien Muchembled's avatar Julien Muchembled

version up: many components

parents 733c1e8a adc45383
...@@ -38,9 +38,9 @@ md5sum = 2202b18f269ad606d70e1864857ed93c ...@@ -38,9 +38,9 @@ md5sum = 2202b18f269ad606d70e1864857ed93c
# inspired on http://old.aclark.net/team/aclark/blog/a-lamp-buildout-for-wordpress-and-other-php-apps/ # inspired on http://old.aclark.net/team/aclark/blog/a-lamp-buildout-for-wordpress-and-other-php-apps/
recipe = slapos.recipe.cmmi recipe = slapos.recipe.cmmi
shared = false shared = false
version = 2.4.39 version = 2.4.41
url = https://archive.apache.org/dist/httpd/httpd-${:version}.tar.bz2 url = https://archive.apache.org/dist/httpd/httpd-${:version}.tar.bz2
md5sum = 930e217ba2d71e708a3f1521ecae7ec0 md5sum = dfc674f8f454e3bc2d4ccd73ad3b5f1e
pre-configure = pre-configure =
cp -ar ${apr:location}/apr-${apr:version} srclib/apr/ && cp -ar ${apr:location}/apr-${apr:version} srclib/apr/ &&
cp -ar ${apr-util:location}/apr-util-${apr-util:version} srclib/apr-util cp -ar ${apr-util:location}/apr-util-${apr-util:version} srclib/apr-util
......
...@@ -15,10 +15,11 @@ parts = ...@@ -15,10 +15,11 @@ parts =
[curl] [curl]
recipe = slapos.recipe.cmmi recipe = slapos.recipe.cmmi
shared = true shared = true
url = http://curl.haxx.se/download/curl-7.60.0.tar.xz url = http://curl.haxx.se/download/curl-7.67.0.tar.xz
md5sum = a889cd11b4ae8794b7030472cb4df0a0 md5sum = d55351b88dec558dd3a24dabb2c2d899
configure-options = configure-options =
--disable-static --disable-static
--disable-esni
--disable-ldap --disable-ldap
--disable-ldaps --disable-ldaps
--disable-rtsp --disable-rtsp
...@@ -29,22 +30,28 @@ configure-options = ...@@ -29,22 +30,28 @@ configure-options =
--disable-imap --disable-imap
--disable-smtp --disable-smtp
--disable-gopher --disable-gopher
--disable-manual
--enable-ipv6 --enable-ipv6
--disable-sspi --disable-sspi
--disable-alt-svc
--with-zlib=${zlib:location} --with-zlib=${zlib:location}
--with-ssl=${openssl:location} --with-ssl=${openssl:location}
--without-gnutls --without-gnutls
--without-polarssl --without-polarssl
--without-mbedtls --without-mbedtls
--without-cyassl --without-mesalink
--without-nss --without-nss
--without-axtls
--without-libpsl --without-libpsl
--without-libmetalink --without-libmetalink
--without-libssh2 --without-libssh2
--without-librtmp --without-librtmp
--without-libidn --without-libidn2
--with-nghttp2=${nghttp2:location} --with-nghttp2=${nghttp2:location}
--without-ngtcp2
--without-nghttp3
--without-quiche
--without-zsh-functions-dir
--without-fish-functions-dir
environment = environment =
PATH=${perl:location}/bin:${pkgconfig:location}/bin:${xz-utils:location}/bin:%(PATH)s PATH=${perl:location}/bin:${pkgconfig:location}/bin:${xz-utils:location}/bin:%(PATH)s
......
From a975c66c81e45433a668b7daeb4c903a78cb9d33 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?J=C3=A9rome=20Perrin?= <jerome@nexedi.com>
Date: Fri, 27 Sep 2019 01:56:24 +0200
Subject: [PATCH] fix libmagic correctly detect msooxml files
Coming from slapos patch on component:
commit 7a24c4e4ff96a7d00072db891761cea8db7b9122
Author: Boris Kocherov <bk@raskon.ru>
Date: Sun Feb 4 10:52:17 2018 +0300
component/file: fix libmagic correctly detect msooxml files
that was reformatted as a patch so that component/file supports shared
slapos.recipe.cmmi. Maybe file now include a proper fix.
---
magic/Magdir/msooxml | 27 ++++++++++++++++++---------
1 file changed, 18 insertions(+), 9 deletions(-)
diff --git a/magic/Magdir/msooxml b/magic/Magdir/msooxml
index 059e729c..f8431dc8 100644
--- a/magic/Magdir/msooxml
+++ b/magic/Magdir/msooxml
@@ -1,4 +1,3 @@
-
#------------------------------------------------------------------------------
# $File: msooxml,v 1.5 2014/08/05 07:38:45 christos Exp $
# msooxml: file(1) magic for Microsoft Office XML
@@ -13,24 +12,34 @@
# which can distinguish between the three types
# start by checking for ZIP local file header signature
-0 string PK\003\004
+0 string PK\003\004
!:strength +10
# make sure the first file is correct
->0x1E regex \\[Content_Types\\]\\.xml|_rels/\\.rels
+>0x1E regex \\[Content_Types\\]\\.xml|_rels/\\.rels
# skip to the second local file header
# since some documents include a 520-byte extra field following the file
# header, we need to scan for the next header
->>(18.l+49) search/2000 PK\003\004
+>>(18.l+49) search/2000 PK\003\004
# now skip to the *third* local file header; again, we need to scan due to a
# 520-byte extra field following the file header
->>>&26 search/1000 PK\003\004
+>>>&26 search/1000 PK\003\004
+# and check the subdirectory name to determine which type of OOXML
+# file we have. Correct the mimetype with the registered ones:
+# http://technet.microsoft.com/en-us/library/cc179224.aspx
+>>>>&26 string word/ Microsoft Word 2007+
+!:mime application/vnd.openxmlformats-officedocument.wordprocessingml.document
+>>>>&26 string ppt/ Microsoft PowerPoint 2007+
+!:mime application/vnd.openxmlformats-officedocument.presentationml.presentation
+>>>>&26 string xl/ Microsoft Excel 2007+
+!:mime application/vnd.openxmlformats-officedocument.spreadsheetml.sheet
+
+>>1104 search/300 PK\003\004
# and check the subdirectory name to determine which type of OOXML
# file we have. Correct the mimetype with the registered ones:
# http://technet.microsoft.com/en-us/library/cc179224.aspx
->>>>&26 string word/ Microsoft Word 2007+
+>>>&26 string word/ Microsoft Word 2007+
!:mime application/vnd.openxmlformats-officedocument.wordprocessingml.document
->>>>&26 string ppt/ Microsoft PowerPoint 2007+
+>>>&26 string ppt/ Microsoft PowerPoint 2007+
!:mime application/vnd.openxmlformats-officedocument.presentationml.presentation
->>>>&26 string xl/ Microsoft Excel 2007+
+>>>&26 string xl/ Microsoft Excel 2007+
!:mime application/vnd.openxmlformats-officedocument.spreadsheetml.sheet
->>>>&26 default x Microsoft OOXML
--
2.11.0
...@@ -10,8 +10,8 @@ extends = ...@@ -10,8 +10,8 @@ extends =
[file] [file]
recipe = slapos.recipe.cmmi recipe = slapos.recipe.cmmi
shared = true shared = true
url = http://ftp.icm.edu.pl/packages/file/file-5.32.tar.gz url = http://ftp.icm.edu.pl/packages/file/file-5.37.tar.gz
md5sum = 4f2503752ff041895090ed6435610435 md5sum = 80c29aca745466c6c24d11f059329075
configure-options = configure-options =
--disable-static --disable-static
environment = environment =
...@@ -21,4 +21,4 @@ environment = ...@@ -21,4 +21,4 @@ environment =
patch-binary = ${patch:location}/bin/patch patch-binary = ${patch:location}/bin/patch
patch-options = -p1 patch-options = -p1
patches = patches =
${:_profile_base_location_}/0001-fix-libmagic-correctly-detect-msooxml-files.patch#5e66a340d8ec7212d485e17d9af95f24 https://sources.debian.org/data/main/f/file/1:5.37-6/debian/patches/cherry-pick.FILE5_37-67-g46a8443f.limit-the-number-of-elements-in-a-vector-found-by-oss-fuzz.patch#fb6f7d32ce89573bf4b4b302c812e394
...@@ -32,5 +32,5 @@ environment = ...@@ -32,5 +32,5 @@ environment =
[ghostscript-9] [ghostscript-9]
<= ghostscript-common <= ghostscript-common
url = https://github.com/ArtifexSoftware/ghostpdl-downloads/releases/download/gs927/ghostscript-9.27.tar.xz url = https://github.com/ArtifexSoftware/ghostpdl-downloads/releases/download/gs950/ghostscript-9.50.tar.xz
md5sum = dd531503dbbc524f73528359e2ea145c md5sum = 6cea6bae4a7cdfac6ccb09f07f0caf8c
...@@ -13,8 +13,8 @@ parts = ...@@ -13,8 +13,8 @@ parts =
[glib] [glib]
recipe = slapos.recipe.cmmi recipe = slapos.recipe.cmmi
shared = true shared = true
url = http://ftp.gnome.org/pub/gnome/core/3.22/3.22.2/sources/glib-2.50.2.tar.xz url = https://ftp.gnome.org/pub/gnome/sources/glib/2.56/glib-2.56.4.tar.xz
md5sum = 5eeb2bfaf78a07be59585e8b6e80b1d6 md5sum = 17c3dca43d99a4882384f1a7b530b80b
configure-options = configure-options =
--with-python=${buildout:executable} --with-python=${buildout:executable}
--disable-libmount --disable-libmount
......
...@@ -15,8 +15,8 @@ extends = ...@@ -15,8 +15,8 @@ extends =
[groonga] [groonga]
recipe = slapos.recipe.cmmi recipe = slapos.recipe.cmmi
shared = false shared = false
url = https://packages.groonga.org/source/groonga/groonga-9.0.9.tar.gz url = https://packages.groonga.org/source/groonga/groonga-9.1.0.tar.gz
md5sum = 877bc3e2840e2935f606fb3d2d359a2c md5sum = 81722e0bc8cc0cfdddcafde2087b71df
# temporary patch to respect more tokens in natural language mode. # temporary patch to respect more tokens in natural language mode.
patches = patches =
${:_profile_base_location_}/groonga.patch#9ed02fbe8400402d3eab47eee149978b ${:_profile_base_location_}/groonga.patch#9ed02fbe8400402d3eab47eee149978b
......
...@@ -13,8 +13,8 @@ parts = haproxy ...@@ -13,8 +13,8 @@ parts = haproxy
[haproxy] [haproxy]
recipe = slapos.recipe.cmmi recipe = slapos.recipe.cmmi
shared = true shared = true
url = http://www.haproxy.org/download/1.8/src/haproxy-1.8.4.tar.gz url = http://www.haproxy.org/download/1.8/src/haproxy-1.8.23.tar.gz
md5sum = 540cd21169e8828d5d11894b2fa74ab4 md5sum = 6c35b83a9969449c4b79783a2119551e
configure-command = true configure-command = true
# If the system is running on Linux 2.6, we use "linux26" as the TARGET, # If the system is running on Linux 2.6, we use "linux26" as the TARGET,
# otherwise use "generic". # otherwise use "generic".
......
[buildout] [buildout]
extends =
../lunzip/buildout.cfg
parts = parts =
libexpat libexpat
[libexpat] [libexpat]
recipe = slapos.recipe.cmmi recipe = slapos.recipe.cmmi
shared = true shared = true
url = http://downloads.sourceforge.net/project/expat/expat/2.2.1/expat-2.2.1.tar.bz2 url = https://github.com/libexpat/libexpat/releases/download/R_2_2_9/expat-2.2.9.tar.lz
md5sum = d9c3baeab58774cefc2f04faf29f2cf8 md5sum = c356e4f2092df4f0b0ffef904f001842
configure-options = configure-options =
--disable-static --disable-static
--without-xmlwf
--without-examples
--without-tests
--without-docbook
environment =
PATH=${lunzip:location}/bin:%(PATH)s
...@@ -19,15 +19,10 @@ environment = ...@@ -19,15 +19,10 @@ environment =
[libpng12] [libpng12]
<= libpng-common <= libpng-common
url = http://download.sourceforge.net/libpng/libpng-1.2.58.tar.xz url = http://download.sourceforge.net/libpng/libpng-1.2.59.tar.xz
md5sum = 1fe68fa3cdab99dbcfd2a6b4de95645f md5sum = e120f48f4e27e72255bc366c73aae1db
[libpng15]
<= libpng-common
url = http://download.sourceforge.net/libpng/libpng-1.5.29.tar.xz
md5sum = b9e5452ee9681c313638efedb16c12a6
[libpng] [libpng]
<= libpng-common <= libpng-common
url = http://download.sourceforge.net/libpng/libpng-1.6.32.tar.xz url = http://download.sourceforge.net/libpng/libpng-1.6.37.tar.xz
md5sum = e01be057a9369183c959b793a685ad15 md5sum = 015e8e15db1eecde5f2eb9eb5b6e59e9
...@@ -29,8 +29,8 @@ parts = ...@@ -29,8 +29,8 @@ parts =
[mariadb] [mariadb]
recipe = slapos.recipe.cmmi recipe = slapos.recipe.cmmi
url = https://downloads.mariadb.org/f/mariadb-${:version}/source/mariadb-${:version}.tar.gz/from/http%3A//fr.mirror.babylon.network/mariadb/?serve url = https://downloads.mariadb.org/f/mariadb-${:version}/source/mariadb-${:version}.tar.gz/from/http%3A//fr.mirror.babylon.network/mariadb/?serve
version = 10.3.20 version = 10.3.21
md5sum = a87a9532568c0ed50d25ce7e7c60d67d md5sum = c5b9ed98f2f57f7b809d4ec9c1515107
location = ${buildout:parts-directory}/${:_buildout_section_name_} location = ${buildout:parts-directory}/${:_buildout_section_name_}
pre-configure = pre-configure =
set -e '\bSET(PLUGIN_AUTH_PAM YES)' cmake/build_configurations/mysql_release.cmake set -e '\bSET(PLUGIN_AUTH_PAM YES)' cmake/build_configurations/mysql_release.cmake
...@@ -84,8 +84,8 @@ post-install = ...@@ -84,8 +84,8 @@ post-install =
# mroonga - a storage engine for MySQL. It provides fast fulltext search feature to all MySQL users. # mroonga - a storage engine for MySQL. It provides fast fulltext search feature to all MySQL users.
# http://mroonga.github.com/ # http://mroonga.github.com/
recipe = slapos.recipe.cmmi recipe = slapos.recipe.cmmi
url = https://packages.groonga.org/source/mroonga/mroonga-9.09.tar.gz url = https://packages.groonga.org/source/mroonga/mroonga-9.10.tar.gz
md5sum = 1b4ec3a8c6b4b459bd7a94f2bb8ad585 md5sum = 30a3010fd5ef11a8bd440053f1624bdb
pre-configure = set -e pre-configure = set -e
rm -rf fake_mariadb_source rm -rf fake_mariadb_source
mkdir -p fake_mariadb_source mkdir -p fake_mariadb_source
......
...@@ -13,8 +13,8 @@ parts = nginx-output ...@@ -13,8 +13,8 @@ parts = nginx-output
[nginx-common] [nginx-common]
recipe = slapos.recipe.cmmi recipe = slapos.recipe.cmmi
shared = false shared = false
url = https://nginx.org/download/nginx-1.17.1.tar.gz url = https://nginx.org/download/nginx-1.17.6.tar.gz
md5sum = 51021f3e8204a5fc809f5e695a4508db md5sum = 55022aa5715386c994f6773478822853
[nginx] [nginx]
<= nginx-common <= nginx-common
......
...@@ -17,8 +17,8 @@ parts = ...@@ -17,8 +17,8 @@ parts =
[openssl] [openssl]
recipe = slapos.recipe.cmmi recipe = slapos.recipe.cmmi
shared = true shared = true
url = https://www.openssl.org/source/openssl-1.1.0j.tar.gz url = https://www.openssl.org/source/openssl-1.1.1d.tar.gz
md5sum = b4ca5b78ae6ae79da80790b30dbedbdc md5sum = 3be209000dbc7e1b95bcdf47980a3baa
location = @@LOCATION@@ location = @@LOCATION@@
# 'prefix' option to override --openssldir/--prefix (which is useful # 'prefix' option to override --openssldir/--prefix (which is useful
# when combined with DESTDIR). Used by slapos.package.git/obs # when combined with DESTDIR). Used by slapos.package.git/obs
...@@ -57,8 +57,8 @@ openssl = ${openssl:location}/bin/openssl ...@@ -57,8 +57,8 @@ openssl = ${openssl:location}/bin/openssl
[openssl-1.0] [openssl-1.0]
recipe = slapos.recipe.cmmi recipe = slapos.recipe.cmmi
shared = true shared = true
url = https://www.openssl.org/source/openssl-1.0.2p.tar.gz url = https://www.openssl.org/source/openssl-1.0.2t.tar.gz
md5sum = ac5eb30bf5798aa14b1ae6d0e7da58df md5sum = ef66581b80f06eae42f5268bc0b50c6d
location = @@LOCATION@@ location = @@LOCATION@@
# 'prefix' option to override --openssldir/--prefix (which is useful # 'prefix' option to override --openssldir/--prefix (which is useful
# when combined with INSTALL_PREFIX). Used by slapos.package.git/obs # when combined with INSTALL_PREFIX). Used by slapos.package.git/obs
......
...@@ -29,9 +29,9 @@ python = python2.7 ...@@ -29,9 +29,9 @@ python = python2.7
[python2.7] [python2.7]
recipe = slapos.recipe.cmmi recipe = slapos.recipe.cmmi
shared = true shared = true
package_version = 2.7.15 package_version = 2.7.17
package_version_suffix = package_version_suffix =
md5sum = a80ae3cc478460b922242f43a1b4094d md5sum = b3b6d2c92f42a60667814358ab9f0cfd
# This is actually the default setting for prefix, but we can't use it in # This is actually the default setting for prefix, but we can't use it in
# other settings in this part if we don't set it explicitly here. # other settings in this part if we don't set it explicitly here.
...@@ -42,7 +42,7 @@ executable = ${:prefix}/bin/python${:version} ...@@ -42,7 +42,7 @@ executable = ${:prefix}/bin/python${:version}
patch-options = -p1 patch-options = -p1
patches = patches =
${:_profile_base_location_}/fix_compiler_module_issue_20613.patch#94443a77f903e9de880a029967fa6aa7 ${:_profile_base_location_}/fix_compiler_module_issue_20613.patch#94443a77f903e9de880a029967fa6aa7
${:_profile_base_location_}/pytracemalloc_pep445.patch#3dfad79654af9671325f988c36fb6be2 ${:_profile_base_location_}/pytracemalloc_pep445.patch#9f3145817afa2b7fad801fde8447e396
${:_profile_base_location_}/disabled_module_list.patch#71ad30d32bcdbc50c19cf48675b1246e ${:_profile_base_location_}/disabled_module_list.patch#71ad30d32bcdbc50c19cf48675b1246e
${:_profile_base_location_}/asyncore_poll_insteadof_select.patch#ab6991c0ee6e25aeb8951e71f280a2f1 ${:_profile_base_location_}/asyncore_poll_insteadof_select.patch#ab6991c0ee6e25aeb8951e71f280a2f1
url = url =
......
...@@ -492,7 +492,7 @@ diff -Naru a/Objects/obmalloc.c b/Objects/obmalloc.c ...@@ -492,7 +492,7 @@ diff -Naru a/Objects/obmalloc.c b/Objects/obmalloc.c
#ifdef WITH_PYMALLOC #ifdef WITH_PYMALLOC
#ifdef HAVE_MMAP #ifdef HAVE_MMAP
@@ -214,7 +489,7 @@ @@ -220,7 +495,7 @@
* Arenas are allocated with mmap() on systems supporting anonymous memory * Arenas are allocated with mmap() on systems supporting anonymous memory
* mappings to reduce heap fragmentation. * mappings to reduce heap fragmentation.
*/ */
...@@ -501,7 +501,7 @@ diff -Naru a/Objects/obmalloc.c b/Objects/obmalloc.c ...@@ -501,7 +501,7 @@ diff -Naru a/Objects/obmalloc.c b/Objects/obmalloc.c
#ifdef WITH_MEMORY_LIMITS #ifdef WITH_MEMORY_LIMITS
#define MAX_ARENAS (SMALL_MEMORY_LIMIT / ARENA_SIZE) #define MAX_ARENAS (SMALL_MEMORY_LIMIT / ARENA_SIZE)
@@ -581,7 +856,7 @@ @@ -587,7 +862,7 @@
return NULL; /* overflow */ return NULL; /* overflow */
#endif #endif
nbytes = numarenas * sizeof(*arenas); nbytes = numarenas * sizeof(*arenas);
...@@ -510,7 +510,7 @@ diff -Naru a/Objects/obmalloc.c b/Objects/obmalloc.c ...@@ -510,7 +510,7 @@ diff -Naru a/Objects/obmalloc.c b/Objects/obmalloc.c
if (arenaobj == NULL) if (arenaobj == NULL)
return NULL; return NULL;
arenas = arenaobj; arenas = arenaobj;
@@ -785,9 +1060,8 @@ @@ -791,9 +1066,8 @@
* Unless the optimizer reorders everything, being too smart... * Unless the optimizer reorders everything, being too smart...
*/ */
...@@ -522,7 +522,7 @@ diff -Naru a/Objects/obmalloc.c b/Objects/obmalloc.c ...@@ -522,7 +522,7 @@ diff -Naru a/Objects/obmalloc.c b/Objects/obmalloc.c
{ {
block *bp; block *bp;
poolp pool; poolp pool;
@@ -802,15 +1076,6 @@ @@ -808,15 +1082,6 @@
#endif #endif
/* /*
...@@ -538,7 +538,7 @@ diff -Naru a/Objects/obmalloc.c b/Objects/obmalloc.c ...@@ -538,7 +538,7 @@ diff -Naru a/Objects/obmalloc.c b/Objects/obmalloc.c
* This implicitly redirects malloc(0). * This implicitly redirects malloc(0).
*/ */
if ((nbytes - 1) < SMALL_REQUEST_THRESHOLD) { if ((nbytes - 1) < SMALL_REQUEST_THRESHOLD) {
@@ -981,17 +1246,13 @@ @@ -987,17 +1252,13 @@
* last chance to serve the request) or when the max memory limit * last chance to serve the request) or when the max memory limit
* has been reached. * has been reached.
*/ */
...@@ -559,7 +559,7 @@ diff -Naru a/Objects/obmalloc.c b/Objects/obmalloc.c ...@@ -559,7 +559,7 @@ diff -Naru a/Objects/obmalloc.c b/Objects/obmalloc.c
{ {
poolp pool; poolp pool;
block *lastfree; block *lastfree;
@@ -1211,7 +1472,7 @@ @@ -1217,7 +1478,7 @@
redirect: redirect:
#endif #endif
/* We didn't allocate this address. */ /* We didn't allocate this address. */
...@@ -568,7 +568,7 @@ diff -Naru a/Objects/obmalloc.c b/Objects/obmalloc.c ...@@ -568,7 +568,7 @@ diff -Naru a/Objects/obmalloc.c b/Objects/obmalloc.c
} }
/* realloc. If p is NULL, this acts like malloc(nbytes). Else if nbytes==0, /* realloc. If p is NULL, this acts like malloc(nbytes). Else if nbytes==0,
@@ -1219,10 +1480,8 @@ @@ -1225,10 +1486,8 @@
* return a non-NULL result. * return a non-NULL result.
*/ */
...@@ -581,7 +581,7 @@ diff -Naru a/Objects/obmalloc.c b/Objects/obmalloc.c ...@@ -581,7 +581,7 @@ diff -Naru a/Objects/obmalloc.c b/Objects/obmalloc.c
{ {
void *bp; void *bp;
poolp pool; poolp pool;
@@ -1232,16 +1491,7 @@ @@ -1238,16 +1497,7 @@
#endif #endif
if (p == NULL) if (p == NULL)
...@@ -599,7 +599,7 @@ diff -Naru a/Objects/obmalloc.c b/Objects/obmalloc.c ...@@ -599,7 +599,7 @@ diff -Naru a/Objects/obmalloc.c b/Objects/obmalloc.c
#ifdef WITH_VALGRIND #ifdef WITH_VALGRIND
/* Treat running_on_valgrind == -1 the same as 0 */ /* Treat running_on_valgrind == -1 the same as 0 */
@@ -1269,10 +1519,10 @@ @@ -1275,10 +1525,10 @@
} }
size = nbytes; size = nbytes;
} }
...@@ -612,7 +612,7 @@ diff -Naru a/Objects/obmalloc.c b/Objects/obmalloc.c ...@@ -612,7 +612,7 @@ diff -Naru a/Objects/obmalloc.c b/Objects/obmalloc.c
} }
return bp; return bp;
} }
@@ -1290,40 +1540,17 @@ @@ -1296,40 +1546,17 @@
* at p. Instead we punt: let C continue to manage this block. * at p. Instead we punt: let C continue to manage this block.
*/ */
if (nbytes) if (nbytes)
...@@ -655,7 +655,7 @@ diff -Naru a/Objects/obmalloc.c b/Objects/obmalloc.c ...@@ -655,7 +655,7 @@ diff -Naru a/Objects/obmalloc.c b/Objects/obmalloc.c
#endif /* WITH_PYMALLOC */ #endif /* WITH_PYMALLOC */
#ifdef PYMALLOC_DEBUG #ifdef PYMALLOC_DEBUG
@@ -1343,10 +1570,6 @@ @@ -1349,10 +1576,6 @@
#define DEADBYTE 0xDB /* dead (newly freed) memory */ #define DEADBYTE 0xDB /* dead (newly freed) memory */
#define FORBIDDENBYTE 0xFB /* untouchable bytes at each end of a block */ #define FORBIDDENBYTE 0xFB /* untouchable bytes at each end of a block */
...@@ -666,7 +666,7 @@ diff -Naru a/Objects/obmalloc.c b/Objects/obmalloc.c ...@@ -666,7 +666,7 @@ diff -Naru a/Objects/obmalloc.c b/Objects/obmalloc.c
static size_t serialno = 0; /* incremented on each debug {m,re}alloc */ static size_t serialno = 0; /* incremented on each debug {m,re}alloc */
/* serialno is always incremented via calling this routine. The point is /* serialno is always incremented via calling this routine. The point is
@@ -1429,58 +1652,18 @@ @@ -1467,58 +1690,18 @@
p[2*S+n: 2*S+n+S] p[2*S+n: 2*S+n+S]
Copies of FORBIDDENBYTE. Used to catch over- writes and reads. Copies of FORBIDDENBYTE. Used to catch over- writes and reads.
p[2*S+n+S: 2*S+n+2*S] p[2*S+n+S: 2*S+n+2*S]
...@@ -722,7 +722,7 @@ diff -Naru a/Objects/obmalloc.c b/Objects/obmalloc.c ...@@ -722,7 +722,7 @@ diff -Naru a/Objects/obmalloc.c b/Objects/obmalloc.c
- -
-/* generic debug memory api, with an "id" to identify the API in use */ -/* generic debug memory api, with an "id" to identify the API in use */
-void * -void *
-_PyObject_DebugMallocApi(char id, size_t nbytes) -_PyObject_DebugMallocApi(char api, size_t nbytes)
+static void * +static void *
+_PyMem_DebugMallocCtx(void *ctx, size_t nbytes) +_PyMem_DebugMallocCtx(void *ctx, size_t nbytes)
{ {
...@@ -730,25 +730,27 @@ diff -Naru a/Objects/obmalloc.c b/Objects/obmalloc.c ...@@ -730,25 +730,27 @@ diff -Naru a/Objects/obmalloc.c b/Objects/obmalloc.c
uchar *p; /* base address of malloc'ed block */ uchar *p; /* base address of malloc'ed block */
uchar *tail; /* p + 2*SST + nbytes == pointer to tail pad bytes */ uchar *tail; /* p + 2*SST + nbytes == pointer to tail pad bytes */
size_t total; /* nbytes + 4*SST */ size_t total; /* nbytes + 4*SST */
@@ -1491,14 +1674,14 @@ @@ -1530,7 +1713,7 @@
/* overflow: can't represent total as a size_t */
return NULL; return NULL;
if (api == _PYMALLOC_OBJ_ID) {
- p = (uchar *)PyObject_Malloc(total); - p = (uchar *)PyObject_Malloc(total);
+ p = (uchar *)api->alloc.malloc(api->alloc.ctx, total); + p = (uchar *)api->alloc.malloc(api->alloc.ctx, total);
if (p == NULL) }
return NULL; else {
p = (uchar *)_PyMem_Malloc(total);
@@ -1540,8 +1723,8 @@
/* at p, write size (SST bytes), id (1 byte), pad (SST-1 bytes) */ /* at p, write size (SST bytes), api (1 byte), pad (SST-1 bytes) */
write_size_t(p, nbytes); write_size_t(p, nbytes);
- p[SST] = (uchar)id; - p[SST] = (uchar)api;
- memset(p + SST + 1 , FORBIDDENBYTE, SST-1); - memset(p + SST + 1 , FORBIDDENBYTE, SST-1);
+ p[SST] = (uchar)api->api_id; + p[SST] = (uchar)api->api_id;
+ memset(p + SST + 1, FORBIDDENBYTE, SST-1); + memset(p + SST + 1, FORBIDDENBYTE, SST-1);
if (nbytes > 0) if (nbytes > 0)
memset(p + 2*SST, CLEANBYTE, nbytes); memset(p + 2*SST, CLEANBYTE, nbytes);
@@ -1516,35 +1699,37 @@ @@ -1559,40 +1742,42 @@
Then fills the original bytes with DEADBYTE. Then fills the original bytes with DEADBYTE.
Then calls the underlying free. Then calls the underlying free.
*/ */
...@@ -769,9 +771,14 @@ diff -Naru a/Objects/obmalloc.c b/Objects/obmalloc.c ...@@ -769,9 +771,14 @@ diff -Naru a/Objects/obmalloc.c b/Objects/obmalloc.c
nbytes += 4*SST; nbytes += 4*SST;
if (nbytes > 0) if (nbytes > 0)
memset(q, DEADBYTE, nbytes); memset(q, DEADBYTE, nbytes);
if (api == _PYMALLOC_OBJ_ID) {
- PyObject_Free(q); - PyObject_Free(q);
+ api->alloc.free(api->alloc.ctx, q); + api->alloc.free(api->alloc.ctx, q);
} }
else {
_PyMem_Free(q);
}
}
-void * -void *
-_PyObject_DebugReallocApi(char api, void *p, size_t nbytes) -_PyObject_DebugReallocApi(char api, void *p, size_t nbytes)
...@@ -795,7 +802,7 @@ diff -Naru a/Objects/obmalloc.c b/Objects/obmalloc.c ...@@ -795,7 +802,7 @@ diff -Naru a/Objects/obmalloc.c b/Objects/obmalloc.c
bumpserialno(); bumpserialno();
original_nbytes = read_size_t(q - 2*SST); original_nbytes = read_size_t(q - 2*SST);
total = nbytes + 4*SST; total = nbytes + 4*SST;
@@ -1552,16 +1737,12 @@ @@ -1600,17 +1785,13 @@
/* overflow: can't represent total as a size_t */ /* overflow: can't represent total as a size_t */
return NULL; return NULL;
...@@ -808,13 +815,14 @@ diff -Naru a/Objects/obmalloc.c b/Objects/obmalloc.c ...@@ -808,13 +815,14 @@ diff -Naru a/Objects/obmalloc.c b/Objects/obmalloc.c
* case we didn't get the chance to mark the old memory with DEADBYTE, * case we didn't get the chance to mark the old memory with DEADBYTE,
* but we live with that. * but we live with that.
*/ */
if (api == _PYMALLOC_OBJ_ID) {
- q = (uchar *)PyObject_Realloc(q - 2*SST, total); - q = (uchar *)PyObject_Realloc(q - 2*SST, total);
+ oldq = q; + oldq = q;
+ q = (uchar *)api->alloc.realloc(api->alloc.ctx, q - 2*SST, total); + q = (uchar *)api->alloc.realloc(api->alloc.ctx, q - 2*SST, total);
if (q == NULL) { }
if (nbytes <= original_nbytes) { else {
/* bpo-31626: the memset() above expects that realloc never fails q = (uchar *)_PyMem_Realloc(q - 2*SST, total);
@@ -1571,11 +1752,17 @@ @@ -1624,11 +1805,17 @@
return NULL; return NULL;
} }
...@@ -833,7 +841,7 @@ diff -Naru a/Objects/obmalloc.c b/Objects/obmalloc.c ...@@ -833,7 +841,7 @@ diff -Naru a/Objects/obmalloc.c b/Objects/obmalloc.c
tail = q + nbytes; tail = q + nbytes;
memset(tail, FORBIDDENBYTE, SST); memset(tail, FORBIDDENBYTE, SST);
write_size_t(tail + SST, serialno); write_size_t(tail + SST, serialno);
@@ -1594,8 +1781,8 @@ @@ -1647,8 +1834,8 @@
* and call Py_FatalError to kill the program. * and call Py_FatalError to kill the program.
* The API id, is also checked. * The API id, is also checked.
*/ */
...@@ -844,7 +852,7 @@ diff -Naru a/Objects/obmalloc.c b/Objects/obmalloc.c ...@@ -844,7 +852,7 @@ diff -Naru a/Objects/obmalloc.c b/Objects/obmalloc.c
{ {
const uchar *q = (const uchar *)p; const uchar *q = (const uchar *)p;
char msgbuf[64]; char msgbuf[64];
@@ -1941,3 +2128,44 @@ @@ -1994,3 +2181,44 @@
arenas[arenaindex_temp].address != 0; arenas[arenaindex_temp].address != 0;
} }
#endif #endif
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment