Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 700850 - app-portage/portage-utils-9999: segfault in qlop when "valid-category/*" used.
Summary: app-portage/portage-utils-9999: segfault in qlop when "valid-category/*" used.
Status: RESOLVED FIXED
Alias: None
Product: Portage Development
Classification: Unclassified
Component: Tools (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Fabian Groffen
URL:
Whiteboard:
Keywords: Bug
Depends on:
Blocks:
 
Reported: 2019-11-21 07:11 UTC by Kent Fredric (IRC: kent\n) (RETIRED)
Modified: 2019-12-28 09:42 UTC (History)
1 user (show)

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


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Kent Fredric (IRC: kent\n) (RETIRED) gentoo-dev 2019-11-21 07:11:46 UTC
Updated to latest to check, but 5574f98fd76030581c75622bcb7f2f2c85cad234 still exhibits this issue.

Stumbled onto it by accident, no other character seems to have this effect.

   qlop "dev-perl/*"
   qlop "dev-qt/*"

While of course the "*" is functionally redundant here, it producing a segfault is concerning.

But it must be a valid category to trip.

Backtrace:



#0  0x000055555557c472 in atom_compare (data=data@entry=0x5555555c7b10, query=0x5555555c8080)
    at atom.c:523
        pfx_op = ATOM_OP_NONE
        sfx_op = ATOM_OP_STAR
        bl_op = <optimized out>
        ver_bits = 0
#1  0x0000555555568edd in do_emerge_log (log=<optimized out>, flags=flags@entry=0x7fffffffbc50, 
    atoms=atoms@entry=0x7fffffffbc60, tbegin=0, tend=9223372036854775807) at qlop.c:617
        id = 0x7fffffff7bd1 "emerge (3 of 4) dev-qt/qtscript-4.8.4 to /\n"
        fp = 0x5555555ab900
        buf = "1362362973\000  >>> emerge (3 of 4) dev-qt/qtscript-4.8.4 to /\n\000data-2012j to /\n\000usr/portage/sys-libs/timezone-data/timezone-data-2012j.ebuild)\n\000modules-4.2.8.ebuild)\n\000build)\n\000ebuild)\n\000ebuild)\n\000pp-emulat"...
        p = <optimized out>
        q = <optimized out>
        tstart = 1362362973
        tstart_emerge = <optimized out>
        last_merge = <optimized out>
        sync_start = 0
        sync_time = 0
        sync_cnt = 0
        elapsed = <optimized out>
        atom = 0x5555555c7b10
        atomw = <optimized out>
        upgrade_atom = 0x0
        _merge_matches = {eles = 0x0, num = 0, len = 0}
        merge_matches = 0x7fffffff7b60
        merge_averages = 0x5555555c7c70
        _unmerge_matches = {eles = 0x0, num = 0, len = 0}
        unmerge_matches = 0x7fffffff7b80
        unmerge_averages = 0x5555555c5e40
        atomset = <optimized out>
        i = 0
        parallel_emerge = 0
        all_atoms = <optimized out>
        afmt = '\000' <repeats 2280 times>...
        pkg = <optimized out>
        pkgw = <optimized out>
#2  0x000055555556ab1f in qlop_main (argc=<optimized out>, argv=<optimized out>) at qlop.c:1330
        i = 1
        ret = <optimized out>
        start_time = 0
        end_time = 9223372036854775807
        m = {do_time = -1 '\377', do_merge = -1 '\377', do_unmerge = -1 '\377', 
          do_autoclean = 0 '\000', do_sync = 0 '\000', do_running = 0 '\000', do_average = 0 '\000', 
          do_summary = 0 '\000', do_human = 0 '\000', do_machine = 0 '\000', do_endtime = 0 '\000', 
          show_lastmerge = 0 '\000', show_emerge = 0 '\000', fmt = 0x55555558ad96 "%[CATEGORY]%[PN]"}
        logfile = 0x5555555ab3f0 "/var/log/emerge.log"
        atomfile = 0x0
        p = 0x0
        q = <optimized out>
        atom = <optimized out>
        _atoms = {eles = 0x5555555c81b0, num = 1, len = 32}
        atoms = 0x7fffffffbc60
        runningmode = 0
#3  0x000055555555f9a6 in q_main (argc=2, argv=0x7fffffffcfc8) at q.c:95
        i = <optimized out>
        install = <optimized out>
        print_overlays = <optimized out>
        print_vars = <optimized out>
        p = <optimized out>
        func = <optimized out>
        __func__ = "q_main"
#4  0x000055555555f6bb in main (argc=2, argv=0x7fffffffcfc8) at main.c:822
        st = {st_dev = 22, st_ino = 31, st_nlink = 1, st_mode = 8592, st_uid = 1000, st_gid = 5, 
          __pad0 = 0, st_rdev = 34844, st_size = 0, st_blksize = 1024, st_blocks = 0, st_atim = {
            tv_sec = 1574319833, tv_nsec = 243852754}, st_mtim = {tv_sec = 1574319832, 
            tv_nsec = 243852754}, st_ctim = {tv_sec = 1569293914, tv_nsec = 243852754}, 
          __glibc_reserved = {0, 0, 0}}
        winsz = {ws_row = 79, ws_col = 105, ws_xpixel = 630, ws_ypixel = 1027}
Comment 1 Fabian Groffen gentoo-dev 2019-11-21 07:54:01 UTC
Thanks, the trailing / is enough (and supported) for portage-utils, but the crash is indeed absolutely not what should happen.
Comment 2 Larry the Git Cow gentoo-dev 2019-12-27 21:19:46 UTC
The bug has been referenced in the following commit(s):

https://gitweb.gentoo.org/proj/portage-utils.git/commit/?id=e2b0611a5d20eb60a5b5362975703b1909704289

commit e2b0611a5d20eb60a5b5362975703b1909704289
Author:     Fabian Groffen <grobian@gentoo.org>
AuthorDate: 2019-12-27 21:18:46 +0000
Commit:     Fabian Groffen <grobian@gentoo.org>
CommitDate: 2019-12-27 21:18:46 +0000

    libq/atom: fix crash in atom_compare on invalid input
    
    Bug: https://bugs.gentoo.org/700850
    Signed-off-by: Fabian Groffen <grobian@gentoo.org>

 libq/atom.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
Comment 3 Larry the Git Cow gentoo-dev 2019-12-28 09:42:41 UTC
The bug has been closed via the following commit(s):

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

commit ccbfbff3ffb51a9e7783458c9dad3e6d2cb49e29
Author:     Fabian Groffen <grobian@gentoo.org>
AuthorDate: 2019-12-28 09:42:05 +0000
Commit:     Fabian Groffen <grobian@gentoo.org>
CommitDate: 2019-12-28 09:42:23 +0000

    app-portage/portage-utils-0.83: version bump with bugfixes
    
    Drop overshadowed testing versions.
    
    Closes: https://bugs.gentoo.org/701968
    Closes: https://bugs.gentoo.org/701470
    Bug: https://bugs.gentoo.org/701402
    Closes: https://bugs.gentoo.org/701392
    Closes: https://bugs.gentoo.org/701386
    Closes: https://bugs.gentoo.org/700850
    Closes: https://bugs.gentoo.org/699558
    Package-Manager: Portage-2.3.79, Repoman-2.3.16
    Signed-off-by: Fabian Groffen <grobian@gentoo.org>

 app-portage/portage-utils/Manifest                 |  3 +-
 .../portage-utils/portage-utils-0.74-r1.ebuild     | 38 ----------
 .../portage-utils/portage-utils-0.81.ebuild        | 87 ----------------------
 ...utils-0.82.ebuild => portage-utils-0.83.ebuild} |  0
 4 files changed, 1 insertion(+), 127 deletions(-)