Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 28 Aug 2012 11:14:55 +0200
From:      Stefan Esser <se@freebsd.org>
To:        freebsd-ports@freebsd.org
Cc:        ohauer@gmx.de, bapt@FreeBSD.org
Subject:   Re: PKG_NG: pkg deinstall fails with "argument list too long"
Message-ID:  <503C8C0F.2010302@freebsd.org>
In-Reply-To: <20120827212331.GD64447@ithaqua.etoilebsd.net>
References:  <503BB682.5070108@freebsd.org> <503BD703.2020001@gmx.de> <20120827212331.GD64447@ithaqua.etoilebsd.net>

next in thread | previous in thread | raw e-mail | index | archive | help
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Am 27.08.2012 23:23, schrieb Baptiste Daroussin:
> On Mon, Aug 27, 2012 at 10:22:27PM +0200, olli hauer wrote:

Please do not hijack this thread, even if you are also reporting a
problem with PKG_NG. Threads are free and nobody bothered to reply
to the more urgent problem of the failed deinstallation.

>> On 2012-08-27 20:03, Stefan Esser wrote:
>>> PKG_NG seems to have introduced a limit on the size of ports
>>> that can be deinstalled:
>>> 
>>> # cd /usr/ports/math/lapack #  make deinstall ===>
>>> Deinstalling for math/lapack ===>   Deinstalling
>>> lapack-3.4.0_2 The following packages will be deinstalled:
>>> 
>>> lapack-3.4.0_2
>>> 
>>> The deinstallation will free 28 MB Deinstalling
>>> lapack-3.4.0_2...lapack-3.4.0_2 is required by: qrupdate-1.1.1,
>>> deleting anyway pkg: Cannot run script(DEINSTALL): Argument
>>> list too long *** [deinstall] Error code 3

I have located the line that is causing this error. It is the
posix_spawn on line 102 of libpkg/script.c. The argument length
is limited to KERN_ARGMAX (sysctl kern.argmax) which seems to
be a R/O value initialized to 256KB.

AFAICT this is not even a loader tuneable. A new kernel must
be built, or pkg must be modified to honor the argument length
limit.

The argument is the string argument of "sh -c <string>", which
can not be split in the general case.

In the specific case of math/lapack, the arguments to execve()
(called by posix_spawn()) are:

argv[0] = "sh"
argv[1] = "-c"
argv[2] = " set -- lapack-3.4.0_2
rm -f /usr/local/man/cat3/INSTALL_ilaver.f.3.gz ...
/usr/local/man/cat3/zupmtr.f.3.gz.bz2"

The argument list must be broken into pieces of less than 256KB,
since rising KERN_ARGMAX to >330KB will lead to the same problem
with the next port with even longer PLIST.

Regards, STefan
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.17 (MingW32)
Comment: Using GnuPG with Mozilla - http://www.enigmail.net/

iEYEARECAAYFAlA8jA8ACgkQ69HRkrVjAEzuXgCfTP0gdtRa2CqWp3iWwKu90LO8
ThkAniYRTiGP870wrHwGKCg/F1UmWneF
=UqHR
-----END PGP SIGNATURE-----



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?503C8C0F.2010302>