Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 657422 - emerge --getbinpkgonly: [Errno 7] Argument list too long: b'/bin/bash': ...
Summary: emerge --getbinpkgonly: [Errno 7] Argument list too long: b'/bin/bash': ...
Status: RESOLVED FIXED
Alias: None
Product: Portage Development
Classification: Unclassified
Component: Unclassified (show other bugs)
Hardware: All Linux
: Normal normal
Assignee: Portage team
URL:
Whiteboard:
Keywords: InVCS
Depends on:
Blocks: 659322
  Show dependency tree
 
Reported: 2018-06-05 19:42 UTC by Mason Loring Bliss
Modified: 2018-10-12 19:28 UTC (History)
1 user (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
emerge.strace.3401 (emerge.strace.3401,66.24 KB, text/plain)
2018-06-26 07:44 UTC, Denis Sokolovsky
Details
emerge --info (emerge.info,6.77 KB, text/plain)
2018-06-26 07:47 UTC, Denis Sokolovsky
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Mason Loring Bliss 2018-06-05 19:42:28 UTC
Relevant make.conf bit:

EMERGE_DEFAULT_OPTS="${EMERGE_DEFAULT_OPTS} --getbinpkgonly"
------------------------------------------------------------------------------
The error:

root@penguin /root# emerge x11-ssh-askpass
Calculating dependencies... done!

>>> Emerging binary (1 of 1) net-misc/x11-ssh-askpass-1.2.4.1-r1::gentoo
 * x11-ssh-askpass-1.2.4.1-r1.tbz2 MD5 SHA1 size ;-) ...                 [ ok ]
[Errno 7] Argument list too long: b'/bin/bash':
   /bin/bash -c /usr/lib/portage/python3.5/ebuild.sh clean
Traceback (most recent call last):
  File "/usr/lib64/python3.5/site-packages/portage/process.py", line 347, in spawn
    unshare_net, unshare_ipc, cgroup)
  File "/usr/lib64/python3.5/site-packages/portage/process.py", line 555, in _exec
    os.execve(binary, myargs, env)
  File "/usr/lib64/python3.5/site-packages/portage/__init__.py", line 250, in __call__
    rval = self._func(*wrapped_args, **wrapped_kwargs)
OSError: [Errno 7] Argument list too long: b'/bin/bash'
[Errno 7] Argument list too long: b'/usr/bin/sandbox':
   /usr/bin/sandbox /usr/lib/portage/python3.5/misc-functions.sh die_hooks
Traceback (most recent call last):
  File "/usr/lib64/python3.5/site-packages/portage/process.py", line 347, in spawn
    unshare_net, unshare_ipc, cgroup)
  File "/usr/lib64/python3.5/site-packages/portage/process.py", line 555, in _exec
    os.execve(binary, myargs, env)
  File "/usr/lib64/python3.5/site-packages/portage/__init__.py", line 250, in __call__
    rval = self._func(*wrapped_args, **wrapped_kwargs)
OSError: [Errno 7] Argument list too long: b'/usr/bin/sandbox'
 * The ebuild phase 'die_hooks' has exited unexpectedly. This type of
 * behavior is known to be triggered by things such as failed variable
 * assignments (bug #190128) or bad substitution errors (bug #200313).
 * Normally, before exiting, bash should have displayed an error message
 * above. If bash did not produce an error message above, it's possible
 * that the ebuild has called `exit` when it should have called `die`
 * instead. This behavior may also be triggered by a corrupt bash binary or
 * a hardware problem such as memory or cpu malfunction. If the problem is
 * not reproducible or it appears to occur randomly, then it is likely to
 * be triggered by a hardware problem. If you suspect a hardware problem
 * then you should try some basic hardware diagnostics such as memtest.
 * Please do not report this as a bug unless it is consistently
 * reproducible and you are sure that your bash binary and hardware are
 * functioning properly.

>>> Failed to emerge net-misc/x11-ssh-askpass-1.2.4.1-r1, Log file:

>>>  '/var/tmp/portage/net-misc/x11-ssh-askpass-1.2.4.1-r1/temp/build.log'

 * Messages for package net-misc/x11-ssh-askpass-1.2.4.1-r1:
------------------------------------------------------------------------------
Comment 1 Mason Loring Bliss 2018-06-05 19:49:26 UTC
So, a second run showed a similar error, only this time noting wget. The partial path it showed didn't exist, but running find to locate everything related to the package showed /usr/portage/packages/ being populated. I nuked that entirely, and my next attempt at emerging completed successfully.

However, I suspect there's still a bug in here somewhere, so I don't want to close this prematurely.
Comment 2 Zac Medico gentoo-dev 2018-06-07 06:01:11 UTC
Please post output of emerge --info.
Comment 3 Denis Sokolovsky 2018-06-26 07:44:39 UTC
Created attachment 537270 [details]
emerge.strace.3401
Comment 4 Denis Sokolovsky 2018-06-26 07:47:05 UTC
Created attachment 537272 [details]
emerge --info
Comment 5 Denis Sokolovsky 2018-06-26 07:48:06 UTC
"emerge --info" looks good for me. What interesting, is that error triggered by too large environment in arguments to "execve", while command line looks pretty good. I've attached excerpt from "strace -ffvxs 4096 ...". Looks like every USE_EXPAND_VALUES_* variable expanded much more than once.
Comment 6 Denis Sokolovsky 2018-06-26 19:11:33 UTC
I played a bit and found that to get this kind of error "--getbinpkgonly" is mandatory. Once I start emerge with command line arguments "--getbinpkgonly=n --getbinpkg=y" everything works as expected.
Comment 7 Larry the Git Cow gentoo-dev 2018-06-26 20:24:23 UTC
The bug has been referenced in the following commit(s):

https://gitweb.gentoo.org/proj/portage.git/commit/?id=2710f9ab525e7c726c2ffb027e242dbdf31cfe76

commit 2710f9ab525e7c726c2ffb027e242dbdf31cfe76
Author:     Zac Medico <zmedico@gentoo.org>
AuthorDate: 2018-06-26 20:14:09 +0000
Commit:     Zac Medico <zmedico@gentoo.org>
CommitDate: 2018-06-26 20:16:25 +0000

    binarytree._merge_pkgindex_header: deduplicate values (bug 657422)
    
    Deduplicate values of implicit IUSE variables, in order to
    prevent them from growing without bound, triggering "[Errno 7]
    Argument list too long" errors as reported in bug 657422.
    
    Fixes: cab78dba98c4 ("emerge --usepkgonly: propagate implicit IUSE and USE_EXPAND (bug 640318)")
    Bug: https://bugs.gentoo.org/657422

 pym/portage/dbapi/bintree.py | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
Comment 8 Zac Medico gentoo-dev 2018-06-26 20:26:21 UTC
This patch should fix it, you can apply it by saving it in /etc/portage/patches/sys-apps/portage/ and rebuilding portage:

https://gitweb.gentoo.org/proj/portage.git/patch/?id=2710f9ab525e7c726c2ffb027e242dbdf31cfe76
Comment 9 Mason Loring Bliss 2018-07-19 21:08:36 UTC
This saves the day for me. Does this need more review before being committed?
Comment 10 Zac Medico gentoo-dev 2018-07-19 21:18:26 UTC
(In reply to Mason Loring Bliss from comment #9)
> This saves the day for me. Does this need more review before being committed?

This fix is included in sys-apps/portage-2.3.43.
Comment 11 Mason Loring Bliss 2018-07-20 14:07:20 UTC
Thank you. I've now learned a couple ways to grab the newer version, and I'll report back if I see any fall-out that seems related.