From owner-freebsd-ports@FreeBSD.ORG Sat Dec 7 19:36:41 2013 Return-Path: Delivered-To: freebsd-ports@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id F36D4916 for ; Sat, 7 Dec 2013 19:36:40 +0000 (UTC) Received: from mail.grem.de (outcast.grem.de [213.239.217.27]) by mx1.freebsd.org (Postfix) with SMTP id 434401454 for ; Sat, 7 Dec 2013 19:36:39 +0000 (UTC) Received: (qmail 53843 invoked by uid 89); 7 Dec 2013 19:29:57 -0000 Received: from unknown (HELO bsd64.grem.de) (mg@grem.de@88.217.181.94) by mail.grem.de with ESMTPA; 7 Dec 2013 19:29:57 -0000 Date: Sat, 7 Dec 2013 20:29:58 +0100 From: Michael Gmelin To: Sergio de Almeida Lenzi , "A.J. 'Fonz' van Werven" Subject: Re: "pkg repo" dumps core Message-ID: <20131207202958.58ab3f61@bsd64.grem.de> In-Reply-To: <1386429686.2287.9.camel@lenovo.toontown> References: <20131206183759.GA66308@spectrum.skysmurf.nl> <20131206200452.6ff3fba7@bsd64.grem.de> <1386429686.2287.9.camel@lenovo.toontown> X-Mailer: Claws Mail 3.9.2 (GTK+ 2.24.18; amd64-portbld-freebsd9.1) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: quoted-printable Cc: Baptiste Daroussin , freebsd-ports@freebsd.org X-BeenThere: freebsd-ports@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: Porting software to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 07 Dec 2013 19:36:41 -0000 There is a bug in pkg that makes it segfault on meta ports (package without any files), the first one to trigger this in AJs ports is docbook. See below or github for a patch. @bapt: https://github.com/freebsd/pkg/pull/673 Cheers, Michael Patch: =46rom 3f63d243f55692c0b748c638db0ec201b78fc8e5 Mon Sep 17 00:00:00 2001 From: Michael Gmelin Date: Sat, 7 Dec 2013 20:07:16 +0100 Subject: [PATCH] Fix bug that made pkg repo segfault Introduced in 5dc36026fc60c64763d82a69ef2921b3cd78e913, pkg repo -l crashed on packages (meta ports) that don't install files on their own. --- libpkg/pkg_manifest.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/libpkg/pkg_manifest.c b/libpkg/pkg_manifest.c index 1a32fc2..0516671 100644 --- a/libpkg/pkg_manifest.c +++ b/libpkg/pkg_manifest.c @@ -803,7 +803,8 @@ pkg_emit_filelist(struct pkg *pkg, FILE *f) urlencode(pkg_file_path(file), &b); seq =3D ucl_array_append(seq, ucl_object_fromlstring(sbuf_data(b), sbuf_= len(b))); } - obj =3D ucl_object_insert_key(obj, seq, "files", 5, false); + if (seq !=3D NULL) + obj =3D ucl_object_insert_key(obj, seq, "files", 5, false); =20 output =3D ucl_object_emit(obj, UCL_EMIT_JSON_COMPACT); fprintf(f, "%s", output); --=20 1.8.4.1 --=20 Michael Gmelin