Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!

Bug 677890

Summary: app-portage/genlop-0.30.10-r1 genlop -c lists all merges twice
Product: Portage Development Reporter: Andrew Ammerlaan <andrewammerlaan>
Component: ToolsAssignee: Portage Tools Team <tools-portage>
Status: RESOLVED FIXED    
Severity: normal CC: alarig, andrewammerlaan, cafaia, chris, gentoo, gentoo, kroemmelbein, neil, perl
Priority: Normal    
Version: unspecified   
Hardware: All   
OS: Linux   
See Also: https://bugs.gentoo.org/show_bug.cgi?id=659582
Whiteboard:
Package list:
Runtime testing required: ---
Bug Depends on: 685676    
Bug Blocks:    
Attachments: emerge --info
simple workaround for duplicate output in genlop
Correctly filter running sandboxes

Description Andrew Ammerlaan gentoo-dev 2019-02-13 17:39:18 UTC
Created attachment 565060 [details]
emerge --info

Genlop -c is showing all merges twice for me:

andrew-gentoo-pc andrew # genlop -c
  Currently merging 21 out of 92
  * sys-kernel/gentoo-sources-4.20.8
    current merge time: 9 seconds.
    ETA: less than a minute.
  Currently merging 21 out of 92
  * sys-kernel/gentoo-sources-4.20.8
    current merge time: 9 seconds.
    ETA: less than a minute.

app-portage/genlop-0.30.10-r1
sys-apps/portage-2.3.60
Comment 1 Seweryn 2019-02-22 21:13:11 UTC
Currently merging 9 out of 11

 * dev-qt/qtquickcontrols2-5.12.1 

       current merge time: 4 minutes and 54 seconds.
       ETA: any time now.

 Currently merging 9 out of 11

 * dev-qt/qtquickcontrols2-5.12.1 

       current merge time: 4 minutes and 55 seconds.
       ETA: any time now.
Comment 2 Frank Krömmelbein 2019-03-12 17:56:36 UTC
I have now the same issue, after todays stable update of sys-apps/portage-2.3.51-r1 to 2.3.62.
https://bugs.gentoo.org/680054
I think it is a regression of portage not a issue of genlop.
Comment 3 Ed Santiago 2019-03-19 00:20:04 UTC
Created attachment 569744 [details, diff]
simple workaround for duplicate output in genlop

The attached patch resolves the issue for me.
Comment 4 Seweryn 2019-03-19 17:52:05 UTC
The attached patch resolves the issue for me.
Comment 5 Herbert Wantesh 2019-03-19 23:28:43 UTC
the patch fixes the bug for me too
Comment 6 Samuel Bernardo 2019-04-07 11:35:53 UTC
The patch also solves the issue of listing all merges twince for me, but I need to keyword unmask 0.30.10-r1 for amd64.

The issue also happens with stabilized genlop-0.30.9-r1 that I was using before. I confirm that the problem starts to happen after last portage upgrade. I'm using portage-2.3.62 stable version for amd64.

Thanks Ed Santiago for sharing the patch.
Comment 7 Joe Breuer 2019-05-09 13:26:09 UTC
Created attachment 575600 [details, diff]
Correctly filter running sandboxes

The underlying cause seems to be that genlop looks for running emerges by filtering over sandbox processes. A change to portage (or something) introduced the pid-ns-init process to the call tree, which is also selected by genlop looking for sandbox processes. This is what causes each emerge to show up twice - once matched on the pid-ns-init process, once on the sandbox process itself.

The attached patch introduces another filter to the ps command used to exclude the pid-ns-init processes. 

This Works Here (TM) to only output each running emerge once, not twice.
Comment 8 Gabriel Linder 2019-05-12 00:00:46 UTC
Was hit by this too. Integrated Joe's patch to a PR, hope it gets merged soon :)

https://github.com/gentoo/gentoo/pull/11975
Comment 9 Zac Medico gentoo-dev 2019-05-12 04:19:27 UTC
(In reply to Joe Breuer from comment #7)
> Created attachment 575600 [details, diff] [details, diff]
> Correctly filter running sandboxes

Updated to combine both grep -v calls into one:

https://github.com/gentoo-perl/genlop/pull/11

(In reply to Gabriel Linder from comment #8)
> Was hit by this too. Integrated Joe's patch to a PR, hope it gets merged
> soon :)
> 
> https://github.com/gentoo/gentoo/pull/11975

I'll go ahead and merge that with the updated patch.
Comment 10 Larry the Git Cow gentoo-dev 2019-05-12 04:39:17 UTC
The bug has been referenced in the following commit(s):

https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=3c64f10f130eca58f5171e9d8b915272638af1ba

commit 3c64f10f130eca58f5171e9d8b915272638af1ba
Author:     Gabriel Linder <linder.gabriel@gmail.com>
AuthorDate: 2019-05-11 23:50:57 +0000
Commit:     Zac Medico <zmedico@gentoo.org>
CommitDate: 2019-05-12 04:39:08 +0000

    app-portage/genlop: Correctly filter sandboxes.
    
    Embed the patch provided by Joe Breuer to fix `genlop -c`.
    
    The underlying cause seems to be that genlop looks for running emerges
    by filtering over sandbox processes. A change to portage (or something)
    introduced the pid-ns-init process to the call tree, which is also
    selected by genlop looking for sandbox processes. This is what causes
    each emerge to show up twice - once matched on the pid-ns-init process,
    once on the sandbox process itself.
    
    See https://bugs.gentoo.org/677890#c7 for more details.
    
    Closes: https://github.com/gentoo/gentoo/pull/11975
    Bug: https://bugs.gentoo.org/677890
    Package-Manager: Portage-2.3.62, Repoman-2.3.12
    Signed-off-by: Gabriel Linder <linder.gabriel@gmail.com>
    Signed-off-by: Zac Medico <zmedico@gentoo.org>

 .../genlop/files/genlop-0.30.10-sandbox.patch      | 29 +++++++++++++++++++
 app-portage/genlop/genlop-0.30.10-r2.ebuild        | 33 ++++++++++++++++++++++
 2 files changed, 62 insertions(+)