Rework 2MB stack allocation in qemu-img which causes SEGV with our

default process limits. Bump PKGREVISION.
This commit is contained in:
tnn 2010-10-01 08:32:35 +00:00
parent 954bcca228
commit aa0e889c39
3 changed files with 36 additions and 2 deletions

View file

@ -1,7 +1,8 @@
# $NetBSD: Makefile,v 1.72 2010/08/09 20:56:32 tsutsui Exp $
# $NetBSD: Makefile,v 1.73 2010/10/01 08:32:35 tnn Exp $
#
DISTNAME= qemu-0.12.4
PKGREVISION= 1
CATEGORIES= emulators
MASTER_SITES= http://download.savannah.gnu.org/releases/qemu/

View file

@ -1,9 +1,10 @@
$NetBSD: distinfo,v 1.58 2010/08/11 17:05:13 tsutsui Exp $
$NetBSD: distinfo,v 1.59 2010/10/01 08:32:35 tnn Exp $
SHA1 (qemu-0.12.4.tar.gz) = 1cc3200bf496c836f7c4256c1d12143dab9b82dc
RMD160 (qemu-0.12.4.tar.gz) = dbf5e02812b0df076e4ec8c20b7c382f7507645e
Size (qemu-0.12.4.tar.gz) = 4697077 bytes
SHA1 (patch-aa) = df7561fa16c1b12b973557a6e9a13e82bc64df89
SHA1 (patch-ab) = 5b19489e36022537488cca8944448ad65914a67d
SHA1 (patch-ao) = e515093b6ea99f9cba665de022fd62f3be911569
SHA1 (patch-ba) = f317a580e849aa368f904137d4fb7ce44701a231
SHA1 (patch-dd) = 32661203ba023bea67cd7cde1f4088f4d0e5c582

View file

@ -0,0 +1,32 @@
$NetBSD: patch-ab,v 1.13 2010/10/01 08:32:35 tnn Exp $
Rework 2MB stack allocation in qemu-img which causes SEGV with our
default process limits.
--- qemu-img.c.orig 2010-05-04 15:27:48.000000000 +0000
+++ qemu-img.c
@@ -537,12 +537,15 @@ static int img_convert(int argc, char **
BlockDriverState **bs, *out_bs;
int64_t total_sectors, nb_sectors, sector_num, bs_offset;
uint64_t bs_sectors;
- uint8_t buf[IO_BUF_SIZE];
+ uint8_t *buf;
const uint8_t *buf1;
BlockDriverInfo bdi;
QEMUOptionParameter *param = NULL;
char *options = NULL;
+ buf = malloc(IO_BUF_SIZE);
+ if (!buf)
+ error("out of memory");
fmt = NULL;
out_fmt = "raw";
out_baseimg = NULL;
@@ -792,6 +795,7 @@ static int img_convert(int argc, char **
for (bs_i = 0; bs_i < bs_n; bs_i++)
bdrv_delete(bs[bs_i]);
free(bs);
+ free(buf);
return 0;
}