Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

dnf5 builddep crashes in Fedora 41 container #1864

Closed
abbra opened this issue Nov 15, 2024 · 6 comments · Fixed by #1870
Closed

dnf5 builddep crashes in Fedora 41 container #1864

abbra opened this issue Nov 15, 2024 · 6 comments · Fixed by #1870

Comments

@abbra
Copy link

abbra commented Nov 15, 2024

DNF5 builddep crashes in Fedora 41 container. We use fedora-toolbox container in FreeIPA CI and part of the process we run is a rebuild of FreeIPA package. For that we need to install build dependencies with dnf builddep. This works well for Fedora 40 and prior versions but since this morning we've got reliable crashes in dnf builddep.

It is reproducible outside of a cloud environment as well. Below is the stacktrace we get:

Thread 1 "dnf" received signal SIGSEGV, Segmentation fault.
Downloading 161.53 K source file /usr/include/c++/14/bits/basic_string.h
std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >::basic_string (this=<optimized out>, __s=<optimized out>, __n=<optimized out>, __a=..., this=<optimized out>, __s=<optimized out>,                     
    __n=<optimized out>, __a=...) at /usr/include/c++/14/bits/basic_string.h:626
626	      : _M_dataplus(_M_local_data(), __a)
(gdb) bt full
#0  std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >::basic_string (this=<optimized out>, __s=<optimized out>, __n=<optimized out>, __a=..., this=<optimized out>, __s=<optimized out>, 
    __n=<optimized out>, __a=...) at /usr/include/c++/14/bits/basic_string.h:626
No locals.
#1  0x00007f3838392b9d in std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >::basic_string (this=<optimized out>, __svw=..., __a=..., this=<optimized out>, __svw=..., __a=...)
    at /usr/include/c++/14/bits/basic_string.h:182
No locals.
#2  std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >::basic_string<std::basic_string_view<char, std::char_traits<char> >, void> (this=<optimized out>, __t=..., __a=..., this=<optimized out>, 
    __t=..., __a=...) at /usr/include/c++/14/bits/basic_string.h:801
No locals.
#3  std::construct_at<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::basic_string_view<char, std::char_traits<char> >&> (__location=<optimized out>)
    at /usr/include/c++/14/bits/stl_construct.h:97
No locals.
#4  std::allocator_traits<std::allocator<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > > >::construct<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::basic_string_view<char, std::char_traits<char> >&> (__a=..., __p=<optimized out>) at /usr/include/c++/14/bits/alloc_traits.h:536
No locals.
#5  std::vector<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::allocator<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > > >::emplace_back<std::basic_string_view<char, std::char_traits<char> >&> (this=0x7fffc3d3f610) at /usr/include/c++/14/bits/vector.tcc:117
No locals.
#6  libdnf5::rpm::RpmLogGuard::add_rpm_log (this=0x7fffc3d3f600, log=...) at /usr/src/debug/dnf5-5.2.7.0-1.fc41.x86_64/libdnf5/rpm/rpm_log_guard.cpp:88
No locals.
#7  libdnf5::rpm::rpmlog_callback (rec=rec@entry=0x7fffc3d3ee00, data=data@entry=0x7fffc3d3f600) at /usr/src/debug/dnf5-5.2.7.0-1.fc41.x86_64/libdnf5/rpm/rpm_log_guard.cpp:62
        level = libdnf5::Logger::Level::WARNING
        msg = {_M_len = 63, _M_str = 0x556997fb6d00 "freeipa.spec line 1043: autopatch: no matching patches in range\n"}
        log_guard = 0x7fffc3d3f600
        logger = <optimized out>
#8  0x00007f383854724f in dolog (rec=0x7fffc3d3ee00, saverec=<optimized out>) at /usr/src/debug/rpm-4.20.0-1.fc41.x86_64/rpmio/rpmlog.c:413
        cbrc = 1
        needexit = 0
        ctx = 0x0
        clog = 0x0
        cbdata = <optimized out>
        cbfunc = 0x7f3838392b00 <libdnf5::rpm::rpmlog_callback(rpmlogRec, rpmlogCallbackData)>
        serialize = <optimized out>
        cbrc = <optimized out>
        needexit = <optimized out>
        clog = <optimized out>
        cbdata = <optimized out>
        cbfunc = <optimized out>
        ctx = <optimized out>
#9  rpmlog (code=<optimized out>, fmt=<optimized out>) at /usr/src/debug/rpm-4.20.0-1.fc41.x86_64/rpmio/rpmlog.c:449
        rec = {code = 4, pri = RPMLOG_WARNING, message = 0x556997fb6d00 "freeipa.spec line 1043: autopatch: no matching patches in range\n"}
        saved_errno = 2
        pri = <optimized out>
        mask = <optimized out>
        saverec = <optimized out>
        ap = {{gp_offset = 16, fp_offset = 48, overflow_arg_area = 0x7fffc3d3ef20, reg_save_area = 0x7fffc3d3ee30}}
        msg = 0x556997fb6d00 "freeipa.spec line 1043: autopatch: no matching patches in range\n"
#10 0x00007f3838549a4f in doMacro (mb=mb@entry=0x556998a42210, me=me@entry=0x556997e36220, args=0x556997fe8060, parsed=parsed@entry=0x0) at /usr/src/debug/rpm-4.20.0-1.fc41.x86_64/rpmio/macro.c:1512
        nargs = <optimized out>
        needarg = <optimized out>
        havearg = <optimized out>
        prevme = <optimized out>
        prevarg = <optimized out>
        old_tpos = <optimized out>
#11 0x00007f383854a282 in expandThisMacro (mb=0x556998a42210, me=<optimized out>, args=<optimized out>, flags=<optimized out>) at /usr/src/debug/rpm-4.20.0-1.fc41.x86_64/rpmio/macro.c:1813
        med = {tpos = 0, macro_trace = 0, expand_trace = 0}
        optargs = 0x556997fe8060
        med = <optimized out>
        optargs = <optimized out>
        exit = <optimized out>
        av = <optimized out>
        av = <optimized out>
        s = <optimized out>
#12 rpmExpandThisMacro (mc=0x7f3838569260 <rpmGlobalMacroContext_s>, n=<optimized out>, args=<optimized out>, obuf=0x7fffc3d3f058, flags=<optimized out>) at /usr/src/debug/rpm-4.20.0-1.fc41.x86_64/rpmio/macro.c:2036
        mb = 0x556998a42210
        mep = <optimized out>
        target = 0x0
        rc = 1
#13 0x00007f3838555414 in mc_call (L=0x556997e46f68) at /usr/src/debug/rpm-4.20.0-1.fc41.x86_64/rpmio/rpmlua.c:1294
        argv = 0x556998a63280
        buf = 0x0
        nitem = 1
        mc = 0x556997e0bf88
        name = 0x556997e47a58 "warn"
        rc = 0
#14 0x00007f3837be043a in precallC (L=0x556997e46f68, func=0x556997e63ea0, nresults=0, f=<optimized out>) at /usr/src/debug/lua-5.4.6-6.fc41.x86_64/src/ldo.c:529
        n = <optimized out>
        ci = 0x556997fc6dd0
        n = <optimized out>
        ci = <optimized out>
        t__ = <optimized out>
        narg = <optimized out>
#15 luaD_precall (L=0x556997e46f68, func=<optimized out>, nresults=0) at /usr/src/debug/lua-5.4.6-6.fc41.x86_64/src/ldo.c:595
No locals.
#16 0x00007f3837bf54f4 in luaV_execute (L=<optimized out>, ci=<optimized out>) at /usr/src/debug/lua-5.4.6-6.fc41.x86_64/src/lvm.c:1686
        ra = <optimized out>
        newci = <optimized out>
        b = <optimized out>
        nresults = 0
        i2 = <optimized out>
        i2 = <optimized out>
        i2 = <optimized out>
        ra = <optimized out>
        ra = <optimized out>
        ra = <optimized out>
        ra = <optimized out>
        ra = <optimized out>
        ra = <optimized out>
        i = <optimized out>
        v1 = <optimized out>
        io = <optimized out>
        n1 = <optimized out>
        io = <optimized out>
        v1 = <optimized out>
        io = <optimized out>
        n1 = <optimized out>
        io = <optimized out>
        v1 = <optimized out>
        io = <optimized out>
        n1 = <optimized out>
        io = <optimized out>
        v2 = <optimized out>
        i1 = <optimized out>
        n2 = <optimized out>
        v2 = <optimized out>
        i1 = <optimized out>
        n2 = <optimized out>
        v2 = <optimized out>
        i1 = <optimized out>
        n2 = <optimized out>
        cl = <optimized out>
        k = <optimized out>
        base = 0x556997e63e80
        pc = <optimized out>
        trap = <optimized out>
        startfunc = <optimized out>
        disptab = {0x7f3837bf4ef8 <luaV_execute+696>, 0x7f3837bf6590 <luaV_execute+6480>, 0x7f3837bf6550 <luaV_execute+6416>, 0x7f3837bf6520 <luaV_execute+6368>, 0x7f3837bf64d8 <luaV_execute+6296>, 
          0x7f3837bf65f0 <luaV_execute+6576>, 0x7f3837bf65c8 <luaV_execute+6536>, 0x7f3837bf5fc0 <luaV_execute+4992>, 0x7f3837bf5f50 <luaV_execute+4880>, 0x7f3837bf6910 <luaV_execute+7376>, 0x7f3837bf6810 <luaV_execute+7120>, 
          0x7f3837bf62a8 <luaV_execute+5736>, 0x7f3837bf4cc8 <luaV_execute+136>, 0x7f3837bf6618 <luaV_execute+6616>, 0x7f3837bf6690 <luaV_execute+6736>, 0x7f3837bf6740 <luaV_execute+6912>, 0x7f3837bf5b28 <luaV_execute+3816>, 
          0x7f3837bf6cc0 <luaV_execute+8320>, 0x7f3837bf6bb0 <luaV_execute+8048>, 0x7f3837bf63f0 <luaV_execute+6064>, 0x7f3837bf6368 <luaV_execute+5928>, 0x7f3837bf5db0 <luaV_execute+4464>, 0x7f3837bf6888 <luaV_execute+7240>, 
          0x7f3837bf5cf8 <luaV_execute+4280>, 0x7f3837bf5c78 <luaV_execute+4152>, 0x7f3837bf69f8 <luaV_execute+7608>, 0x7f3837bf6958 <luaV_execute+7448>, 0x7f3837bf6130 <luaV_execute+5360>, 0x7f3837bf6ad8 <luaV_execute+7832>, 
          0x7f3837bf67b0 <luaV_execute+7024>, 0x7f3837bf61e0 <luaV_execute+5536>, 0x7f3837bf5a48 <luaV_execute+3592>, 0x7f3837bf59e0 <luaV_execute+3488>, 0x7f3837bf7268 <luaV_execute+9768>, 0x7f3837bf7240 <luaV_execute+9728>, 
          0x7f3837bf73c8 <luaV_execute+10120>, 0x7f3837bf64b0 <luaV_execute+6256>, 0x7f3837bf7140 <luaV_execute+9472>, 0x7f3837bf71d8 <luaV_execute+9624>, 0x7f3837bf5ee0 <luaV_execute+4768>, 0x7f3837bf5e00 <luaV_execute+4544>, 
          0x7f3837bf7360 <luaV_execute+10016>, 0x7f3837bf72f8 <luaV_execute+9912>, 0x7f3837bf6240 <luaV_execute+5632>, 0x7f3837bf6e30 <luaV_execute+8688>, 0x7f3837bf6eb0 <luaV_execute+8816>, 0x7f3837bf73f0 <luaV_execute+10160>, 
          0x7f3837bf6f30 <luaV_execute+8944>, 0x7f3837bf5aa8 <luaV_execute+3688>, 0x7f3837bf70a0 <luaV_execute+9312>, 0x7f3837bf7058 <luaV_execute+9240>, 0x7f3837bf70f0 <luaV_execute+9392>, 0x7f3837bf6310 <luaV_execute+5840>, 
          0x7f3837bf5c00 <luaV_execute+4032>, 0x7f3837bf7008 <luaV_execute+9160>, 0x7f3837bf5bb0 <luaV_execute+3952>, 0x7f3837bf72d0 <luaV_execute+9872>, 0x7f3837bf60d0 <luaV_execute+5264>, 0x7f3837bf6060 <luaV_execute+5152>, 
          0x7f3837bf5fe8 <luaV_execute+5032>, 0x7f3837bf6dd0 <luaV_execute+8592>, 0x7f3837bf6d70 <luaV_execute+8496>, 0x7f3837bf6fb8 <luaV_execute+9080>, 0x7f3837bf5990 <luaV_execute+3408>, 0x7f3837bf5940 <luaV_execute+3328>, 
          0x7f3837bf58f0 <luaV_execute+3248>, 0x7f3837bf5590 <luaV_execute+2384>, 0x7f3837bf5870 <luaV_execute+3120>, 0x7f3837bf54b0 <luaV_execute+2160>, 0x7f3837bf5038 <luaV_execute+1016>, 0x7f3837bf50e0 <luaV_execute+1184>, 
          0x7f3837bf4f90 <luaV_execute+848>, 0x7f3837bf4f38 <luaV_execute+760>, 0x7f3837bf57e8 <luaV_execute+2984>, 0x7f3837bf5520 <luaV_execute+2272>, 0x7f3837bf4da0 <luaV_execute+352>, 0x7f3837bf4df0 <luaV_execute+432>, 
          0x7f3837bf4e9d <luaV_execute+605>, 0x7f3837bf52a8 <luaV_execute+1640>, 0x7f3837bf5600 <luaV_execute+2496>, 0x7f3837bf51c0 <luaV_execute+1408>, 0x7f3837bf53c0 <luaV_execute+1920>, 0x7f3837bf4d36 <luaV_execute+246>}
#17 0x00007f3837bd7246 in ccall (L=0x556997e46f68, func=<optimized out>, nResults=-1, inc=65537) at /usr/src/debug/lua-5.4.6-6.fc41.x86_64/src/ldo.c:637
        ci = <optimized out>
        ci = <optimized out>
        t__ = <optimized out>
#18 luaD_callnoyield (L=0x556997e46f68, func=<optimized out>, nResults=-1) at /usr/src/debug/lua-5.4.6-6.fc41.x86_64/src/ldo.c:655
No locals.
#19 f_call (L=L@entry=0x556997e46f68, ud=ud@entry=0x7fffc3d3f390) at /usr/src/debug/lua-5.4.6-6.fc41.x86_64/src/lapi.c:1038
        c = 0x7fffc3d3f390
#20 0x00007f3837bdcc15 in luaD_rawrunprotected (L=0x556997e46f68, f=0x7f3837bd71f0 <f_call>, ud=0x7fffc3d3f390) at /usr/src/debug/lua-5.4.6-6.fc41.x86_64/src/ldo.c:144
        oldnCcalls = 65536
        lj = {previous = 0x0, b = {{__jmpbuf = {16, -5727253035826021375, 0, 1, 93912008257480, 93912008257384, -5727253035792466943, -5689350997673772031}, __mask_was_saved = 0, __saved_mask = {__val = {140736478835552, 
                  139879430172763, 93912008257384, 140736478835360, 139879432284960, 32, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}}}}, status = 0}
#21 0x00007f3837bfe7d4 in luaD_pcall.constprop.0 (L=L@entry=0x556997e46f68, func=func@entry=0x7f3837bd71f0 <f_call>, u=u@entry=0x7fffc3d3f390, old_top=old_top@entry=16, ef=<optimized out>)
    at /usr/src/debug/lua-5.4.6-6.fc41.x86_64/src/ldo.c:953
        status = <optimized out>
        old_ci = 0x556997e46fc8
        old_allowhooks = 1 '\001'
        old_errfunc = 0
#22 0x00007f3837bd7370 in lua_pcallk (L=L@entry=0x556997e46f68, nargs=nargs@entry=2, nresults=nresults@entry=-1, errfunc=errfunc@entry=0, ctx=ctx@entry=0, k=k@entry=0x0) at /usr/src/debug/lua-5.4.6-6.fc41.x86_64/src/lapi.c:1064
        c = {func = 0x556997e63e40, nresults = -1}
        status = <optimized out>
        func = <optimized out>
#23 0x00007f3838550d41 in rpm_pcall (L=L@entry=0x556997e46f68, nargs=nargs@entry=2, nresults=nresults@entry=-1, errfunc=0) at /usr/src/debug/rpm-4.20.0-1.fc41.x86_64/rpmio/rpmlua.c:239
        pid = 295
        rc = <optimized out>
#24 0x00007f38385531ef in rpmluaRunScript (lua=0x556997e5d0f0, script=<optimized out>, name=0x556997e31fbc "autopatch", opts=<optimized out>, args=<optimized out>) at /usr/src/debug/rpm-4.20.0-1.fc41.x86_64/rpmio/rpmlua.c:298
        L = 0x556997e46f68
        ret = -1
        oind = <optimized out>
        nret = 0
        otop = 0
        buf = 0x556997f5fdf0 "local opt, arg = ...;\nif #arg == 0 then\n    local lo = tonumber(rpm.expand(\"%{-m:%{-m*}}\"))\n    local hi = tonumber(rpm.expand(\"%{-M:%{-M*}}\"))\n    for i, n in ipairs(patch_nums) do\n        if ((not l"...
        lualocal = <optimized out>
#25 0x00007f383854b23b in doLua (mb=0x5569980167c0, me=<optimized out>, argv=<optimized out>, parsed=<optimized out>) at /usr/src/debug/rpm-4.20.0-1.fc41.x86_64/rpmio/macro.c:1131
        lua = 0x0
        scriptbuf = 0x556998a48cd0 "\nif #arg == 0 then\n    local lo = tonumber(rpm.expand(\"%{-m:%{-m*}}\"))\n    local hi = tonumber(rpm.expand(\"%{-M:%{-M*}}\"))\n    for i, n in ipairs(patch_nums) do\n        if ((not lo or n >= lo) and (no"...
        printbuf = <optimized out>
        mc = 0x7f3838569260 <rpmGlobalMacroContext_s>
        mbme = <optimized out>
        odepth = <optimized out>
        olevel = <optimized out>
        opts = 0x556997e322fb "vqp:m:M:"
        name = 0x556997e31fbc "autopatch"
        args = 0x556998a590c0
#26 0x00007f3838549a4f in doMacro (mb=mb@entry=0x5569980167c0, me=me@entry=0x556997e110b0, args=0x556997fde460, parsed=parsed@entry=0x0) at /usr/src/debug/rpm-4.20.0-1.fc41.x86_64/rpmio/macro.c:1512
        nargs = <optimized out>
        needarg = <optimized out>
        havearg = <optimized out>
        prevme = <optimized out>
        prevarg = <optimized out>
        old_tpos = <optimized out>
#27 0x00007f3838546776 in expandMacro (mb=mb@entry=0x5569980167c0, src=<optimized out>, slen=<optimized out>, slen@entry=0) at /usr/src/debug/rpm-4.20.0-1.fc41.x86_64/rpmio/macro.c:1760
        args = 0x556997fde460
        fwd = <optimized out>
        mep = <optimized out>
        me = 0x556997e110b0
        s = <optimized out>
        se = 0x556997f4efc4 ""
        f = <optimized out>
        fe = 0x556997f4ec95 ":\nif #arg == 0 then\n    local lo = tonumber(rpm.expand(\"%{-m:%{-m*}}\"))\n    local hi = tonumber(rpm.expand(\"%{-M:%{-M*}}\"))\n    for i, n in ipairs(patch_nums) do\n        if ((not lo or n >= lo) and (n"...
        g = <optimized out>
        ge = 0x556997f4efc3 "}"
        fn = <optimized out>
        gn = <optimized out>
        c = <optimized out>
        negate = <optimized out>
        lastc = 0x0
        chkexist = <optimized out>
        source = 0x556997f4ec90 "%{lua:\nif #arg == 0 then\n    local lo = tonumber(rpm.expand(\"%{-m:%{-m*}}\"))\n    local hi = tonumber(rpm.expand(\"%{-M:%{-M*}}\"))\n    for i, n in ipairs(patch_nums) do\n        if ((not lo or n >= lo) a"...
        med = {tpos = 0, macro_trace = 0, expand_trace = 0}
#28 0x00007f3838549d2f in doMacro (mb=mb@entry=0x5569980167c0, me=me@entry=0x556997e31f80, args=<optimized out>, parsed=parsed@entry=0x0) at /usr/src/debug/rpm-4.20.0-1.fc41.x86_64/rpmio/macro.c:1523
        prevme = <optimized out>
        prevarg = <optimized out>
        old_tpos = <optimized out>
#29 0x00007f3838546776 in expandMacro (mb=mb@entry=0x5569980167c0, src=src@entry=0x556998a590e0 "%autopatch -p1\n", slen=<optimized out>, slen@entry=0) at /usr/src/debug/rpm-4.20.0-1.fc41.x86_64/rpmio/macro.c:1760
        args = 0x556998a590c0
        fwd = <optimized out>
        mep = <optimized out>
        me = 0x556997e31f80
        s = <optimized out>
        se = 0x556997f6a9be "\n"
        f = <optimized out>
        fe = 0x556997f6a9ba " -p1\n"
        g = <optimized out>
        ge = 0x0
        fn = <optimized out>
        gn = <optimized out>
        c = <optimized out>
        negate = <optimized out>
        lastc = 0x556997f6a9be "\n"
        chkexist = <optimized out>
        source = 0x556997f6a9b0 "%autopatch -p1\n"
        med = {tpos = 0, macro_trace = 0, expand_trace = 0}
#30 0x00007f3838546bdd in doExpandMacros (mc=mc@entry=0x7f3838569260 <rpmGlobalMacroContext_s>, src=src@entry=0x556998a590e0 "%autopatch -p1\n", flags=flags@entry=0, target=target@entry=0x7fffc3d3f7b0)
    at /usr/src/debug/rpm-4.20.0-1.fc41.x86_64/rpmio/macro.c:1830
        mb = 0x5569980167c0
        rc = 0
#31 0x00007f3838546c8c in rpmExpandMacros (mc=0x7f3838569260 <rpmGlobalMacroContext_s>, sbuf=sbuf@entry=0x556998a590e0 "%autopatch -p1\n", obuf=obuf@entry=0x7fffc3d3f810, flags=flags@entry=0)
    at /usr/src/debug/rpm-4.20.0-1.fc41.x86_64/rpmio/macro.c:2014
        target = 0x0
        rc = <optimized out>
#32 0x00007f383641c2b2 in specExpand (spec=0x556998010480, lineno=<optimized out>, sbuf=0x556998a590e0 "%autopatch -p1\n", obuf=0x7fffc3d3f810) at /usr/src/debug/rpm-4.20.0-1.fc41.x86_64/build/parseSpec.c:230
No locals.
#33 expandMacrosInSpecBuf (spec=0x556998010480, strip=0) at /usr/src/debug/rpm-4.20.0-1.fc41.x86_64/build/parseSpec.c:267
        lbuf = 0x556998a590e0 "%autopatch -p1\n"
        isComment = 0
        condition = <optimized out>
        ofi = <optimized out>
        lbuf = <optimized out>
        isComment = <optimized out>
        condition = <optimized out>
        ofi = <optimized out>
        s = <optimized out>
        bufA = <optimized out>
        bufB = <optimized out>
#34 copyNextLineFromOFI (spec=0x556998010480, ofi=0x556997fb48d0, strip=<optimized out>) at /usr/src/debug/rpm-4.20.0-1.fc41.x86_64/build/parseSpec.c:353
        from = <optimized out>
        pc = <optimized out>
        bc = <optimized out>
        xc = <optimized out>
        nc = <optimized out>
        ch = <optimized out>
#35 readLine (spec=spec@entry=0x556998010480, strip=strip@entry=0) at /usr/src/debug/rpm-4.20.0-1.fc41.x86_64/build/parseSpec.c:484
        s = <optimized out>
        match = <optimized out>
        rl = <optimized out>
        ofi = 0x556997fb48d0
        rc = <optimized out>
        startLine = <optimized out>
        lineType = <optimized out>
        prevType = 64
        checkCondition = <optimized out>
        retry = <optimized out>
#36 0x00007f383641ede1 in parseLines (spec=spec@entry=0x556998010480, strip=strip@entry=0, avp=avp@entry=0x0, sbp=0x556998010560) at /usr/src/debug/rpm-4.20.0-1.fc41.x86_64/build/parseSpec.c:633
        rc = <optimized out>
        nextPart = <optimized out>
        nl = 0
#37 0x00007f383641f141 in parseSimpleScript (spec=0x556998010480, name=<optimized out>, sbp=0x556998010560, avp=0x5569980105d0, modep=<synthetic pointer>) at /usr/src/debug/rpm-4.20.0-1.fc41.x86_64/build/misc.c:30
        res = -1
        optCon = <optimized out>
        buf = 0x0
        mode = 0
        optionsTable = {{longName = 0x0, shortName = 97 'a', argInfo = 134217735, arg = 0x7fffc3d3f8cc, val = 2, descrip = 0x0, argDescrip = 0x0}, {longName = 0x0, shortName = 112 'p', argInfo = 134217735, arg = 0x7fffc3d3f8cc, 
            val = 1, descrip = 0x0, argDescrip = 0x0}, {longName = 0x0, shortName = 0 '\000', argInfo = 0, arg = 0x0, val = 0, descrip = 0x0, argDescrip = 0x0}}
        argc = 1
        argv = 0x556998a3dba0
        target = <optimized out>
        rc = <optimized out>
        res = <optimized out>
        optCon = <optimized out>
        argc = <optimized out>
        argv = <optimized out>
        target = <optimized out>
        buf = <optimized out>
        rc = <optimized out>
        mode = <optimized out>
        optionsTable = <optimized out>
        exit = <optimized out>
#38 parseBuildScript (spec=spec@entry=0x556998010480, part=part@entry=12) at /usr/src/debug/rpm-4.20.0-1.fc41.x86_64/build/parseSpec.c:1107
        sc = 0x7f383643a5e0 <sectList>
        mode = 0
        rc = <optimized out>
#39 0x00007f38364240b9 in parseSpecSection (specptr=specptr@entry=0x7fffc3d3fbe8, stage=stage@entry=PARSE_SPECFILE) at /usr/src/debug/rpm-4.20.0-1.fc41.x86_64/build/parseSpec.c:1156
        goterror = 0
        spec = 0x556998010480
        parsePart = 12
        prevParsePart = <optimized out>
        storedParsePart = 12
        initialPackage = <optimized out>
        errxit = <optimized out>
        exit = <optimized out>
#40 0x00007f38364237d7 in parseSpec (specFile=0x556997f147e0 "freeipa.spec", flags=flags@entry=3, buildRoot=<optimized out>, recursing=recursing@entry=0) at /usr/src/debug/rpm-4.20.0-1.fc41.x86_64/build/parseSpec.c:1334
        spec = 0x556998010480
#41 0x00007f38364261a5 in rpmSpecParse (specFile=<optimized out>, flags=3, buildRoot=<optimized out>) at /usr/src/debug/rpm-4.20.0-1.fc41.x86_64/build/parseSpec.c:1412
        spec = <optimized out>
#42 0x00007f3836448a62 in dnf5::BuildDepCommand::add_from_spec_file (this=<optimized out>, install_specs=..., conflicts_specs=..., spec_file_name=0x556997f147e0 "freeipa.spec")
    at /usr/src/debug/dnf5-5.2.7.0-1.fc41.x86_64/dnf5-plugins/builddep_plugin/builddep.cpp:156
        spec = <optimized out>
        dependency_set = <optimized out>
        conflicts_set = <optimized out>
        spec = <optimized out>
        dependency_set = <optimized out>
        conflicts_set = <optimized out>
#43 dnf5::BuildDepCommand::run (this=0x556997ed2710) at /usr/src/debug/dnf5-5.2.7.0-1.fc41.x86_64/dnf5-plugins/builddep_plugin/builddep.cpp:265
        spec = @0x556997f147d0: {_M_dataplus = {<std::allocator<char>> = {<std::__new_allocator<char>> = {<No data fields>}, <No data fields>}, _M_p = 0x556997f147e0 "freeipa.spec"}, _M_string_length = 12, {
            _M_local_buf = "freeipa.spec\000e\000", _M_allocated_capacity = 3342075996460642918}}
        __for_range = <optimized out>
        __for_begin = <optimized out>
        __for_end = <optimized out>
        install_specs = {_M_t = {
            _M_impl = {<std::allocator<std::_Rb_tree_node<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > > >> = {<std::__new_allocator<std::_Rb_tree_node<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > > >> = {<No data fields>}, <No data fields>}, <std::_Rb_tree_key_compare<std::less<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > > >> = {
                _M_key_compare = {<std::binary_function<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, bool>> = {<No data fields>}, <No data fields>}}, <std::_Rb_tree_header> = {_M_header = {_M_color = std::_S_red, _M_parent = 0x0, _M_left = 0x7fffc3d3fde8, _M_right = 0x7fffc3d3fde8}, _M_node_count = 0}, <No data fields>}}}
        conflicts_specs = {_M_t = {
            _M_impl = {<std::allocator<std::_Rb_tree_node<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > > >> = {<std::__new_allocator<std::_Rb_tree_node<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > > >> = {<No data fields>}, <No data fields>}, <std::_Rb_tree_key_compare<std::less<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > > >> = {
                _M_key_compare = {<std::binary_function<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, bool>> = {<No data fields>}, <No data fields>}}, <std::_Rb_tree_header> = {_M_header = {_M_color = std::_S_red, _M_parent = 0x0, _M_left = 0x7fffc3d3fdb8, _M_right = 0x7fffc3d3fdb8}, _M_node_count = 0}, <No data fields>}}}
        parse_ok = <optimized out>
        goal = <optimized out>
        settings = {<libdnf5::ResolveSpecSettings> = {p_impl = {_M_t = {<std::__uniq_ptr_impl<libdnf5::ResolveSpecSettings::Impl, std::default_delete<libdnf5::ResolveSpecSettings::Impl> >> = {
                  _M_t = {<std::_Tuple_impl<0, libdnf5::ResolveSpecSettings::Impl*, std::default_delete<libdnf5::ResolveSpecSettings::Impl> >> = {<std::_Tuple_impl<1, std::default_delete<libdnf5::ResolveSpecSettings::Impl> >> = {<std::_Head_base<1, std::default_delete<libdnf5::ResolveSpecSettings::Impl>, true>> = {_M_head_impl = {<No data fields>}}, <No data fields>}, <std::_Head_base<0, libdnf5::ResolveSpecSettings::Impl*, false>> = {
                        _M_head_impl = 0x9}, <No data fields>}, <No data fields>}}, <No data fields>}}}, p_impl = {
            _M_t = {<std::__uniq_ptr_impl<libdnf5::GoalJobSettings::Impl, std::default_delete<libdnf5::GoalJobSettings::Impl> >> = {
                _M_t = {<std::_Tuple_impl<0, libdnf5::GoalJobSettings::Impl*, std::default_delete<libdnf5::GoalJobSettings::Impl> >> = {<std::_Tuple_impl<1, std::default_delete<libdnf5::GoalJobSettings::Impl> >> = {<std::_Head_base<1, std::default_delete<libdnf5::GoalJobSettings::Impl>, true>> = {_M_head_impl = {<No data fields>}}, <No data fields>}, <std::_Head_base<0, libdnf5::GoalJobSettings::Impl*, false>> = {
                      _M_head_impl = 0x556997e04d48}, <No data fields>}, <No data fields>}}, <No data fields>}}}
#44 0x000055696a9fc385 in main (argc=<optimized out>, argv=<optimized out>) at /usr/src/debug/dnf5-5.2.7.0-1.fc41.x86_64/dnf5/main.cpp:1383
        repo_sack = {ptr = 0x556997e04d10, guard = 0x556997e06800}
        __for_begin = <optimized out>
        __for_end = <optimized out>
        __for_begin = <optimized out>
        __for_end = <optimized out>
        fd = <optimized out>
        destination_logger = {_M_t = {<std::__uniq_ptr_impl<libdnf5::Logger, std::default_delete<libdnf5::Logger> >> = {
              _M_t = {<std::_Tuple_impl<0, libdnf5::Logger*, std::default_delete<libdnf5::Logger> >> = {<std::_Tuple_impl<1, std::default_delete<libdnf5::Logger> >> = {<std::_Head_base<1, std::default_delete<libdnf5::Logger>, true>> = {_M_head_impl = {<No data fields>}}, <No data fields>}, <std::_Head_base<0, libdnf5::Logger*, false>> = {_M_head_impl = 0x556997e015d0}, <No data fields>}, <No data fields>}}, <No data fields>}}
        vars = {ptr = 0x556997e04ea8, guard = 0x556997e04f48}
        enable = <optimized out>
        plugin_name_pattern = <optimized out>
        __for_range = <optimized out>
        id_path_pair = <optimized out>
        __for_range = <optimized out>
        download_callbacks_uptr = {_M_t = {<std::__uniq_ptr_impl<dnf5::DownloadCallbacks, std::default_delete<dnf5::DownloadCallbacks> >> = {
              _M_t = {<std::_Tuple_impl<0, dnf5::DownloadCallbacks*, std::default_delete<dnf5::DownloadCallbacks> >> = {<std::_Tuple_impl<1, std::default_delete<dnf5::DownloadCallbacks> >> = {<std::_Head_base<1, std::default_delete<dnf5::DownloadCallbacks>, true>> = {_M_head_impl = {<No data fields>}}, <No data fields>}, <std::_Head_base<0, dnf5::DownloadCallbacks*, false>> = {_M_head_impl = 0x0}, <No data fields>}, <No data fields>}}, <No data fields>}}
        command = 0x556997ed2710
        global_logger = {<No data fields>}
        download_callbacks = 0x556997f1f210
        any_repos_from_system_configuration = <optimized out>
        ex = <optimized out>
        loggers = {<std::_Vector_base<std::unique_ptr<libdnf5::Logger, std::default_delete<libdnf5::Logger> >, std::allocator<std::unique_ptr<libdnf5::Logger, std::default_delete<libdnf5::Logger> > > >> = {
            _M_impl = {<std::allocator<std::unique_ptr<libdnf5::Logger, std::default_delete<libdnf5::Logger> > >> = {<std::__new_allocator<std::unique_ptr<libdnf5::Logger, std::default_delete<libdnf5::Logger> > >> = {<No data fields>}, <No data fields>}, <std::_Vector_base<std::unique_ptr<libdnf5::Logger, std::default_delete<libdnf5::Logger> >, std::allocator<std::unique_ptr<libdnf5::Logger, std::default_delete<libdnf5::Logger> > > >::_Vector_impl_data> = {
                _M_start = 0x0, _M_finish = 0x0, _M_end_of_storage = 0x0}, <No data fields>}}, <No data fields>}
        prealloc_log_items = 256
        context = {<libdnf5::cli::session::Session> = {p_impl = {ptr = 0x556997e01240}}, p_impl = {_M_t = {<std::__uniq_ptr_impl<dnf5::Context::Impl, std::default_delete<dnf5::Context::Impl> >> = {
                _M_t = {<std::_Tuple_impl<0, dnf5::Context::Impl*, std::default_delete<dnf5::Context::Impl> >> = {<std::_Tuple_impl<1, std::default_delete<dnf5::Context::Impl> >> = {<std::_Head_base<1, std::default_delete<dnf5::Context::Impl>, true>> = {_M_head_impl = {<No data fields>}}, <No data fields>}, <std::_Head_base<0, dnf5::Context::Impl*, false>> = {_M_head_impl = 0x556997e04940}, <No data fields>}, <No data fields>}}, <No data fields>}}}
        log_router = @0x556997e04ce8: {<libdnf5::Logger> = {_vptr.Logger = 0x7f38384ea590 <vtable for libdnf5::LogRouter+16>}, p_impl = {ptr = 0x556997e05060}}
        max_log_items_to_keep = 10000
        cmdline = {_M_dataplus = {<std::allocator<char>> = {<std::__new_allocator<char>> = {<No data fields>}, <No data fields>}, 
            _M_p = 0x556997ddf970 "/usr/bin/dnf builddep -y -D with_wheels 1 -D with_lint 1 -D with_doc 1 --best --allowerasing --setopt=install_weak_deps=False freeipa.spec"}, _M_string_length = 138, {
            _M_local_buf = "\360\000\000\000\000\000\000\000/dnf \000\000", _M_allocated_capacity = 240}}
        base = @0x556997e04970: {base_guard = {registered_weak_ptrs = {
              _M_h = {<std::__detail::_Hashtable_base<libdnf5::WeakPtr<libdnf5::Base, false>*, libdnf5::WeakPtr<libdnf5::Base, false>*, std::__detail::_Identity, std::equal_to<libdnf5::WeakPtr<libdnf5::Base, false>*>, std::hash<libdnf5::WeakPtr<libdnf5::Base, false>*>, std::__detail::_Mod_range_hashing, std::__detail::_Default_ranged_hash, std::__detail::_Hashtable_traits<false, true, true> >> = {<std::__detail::_Hash_code_base<libdnf5::WeakPtr<libdnf5::Base, false>*, libdnf5::WeakPtr<libdnf5::Base, false>*, std::__detail::_Identity, std::hash<libdnf5::WeakPtr<libdnf5::Base, false>*>, std::__detail::_Mod_range_hashing, std::__detail::_Default_ranged_hash, false>> = {<std::__detail::_Hashtable_ebo_helper<1, std::hash<libdnf5::WeakPtr<libdnf5::Base, false>*>, true>> = {<std::hash<libdnf5::WeakPtr<libdnf5::Base, false>*>> = {<std::__hash_base<unsigned long, libdnf5::WeakPtr<libdnf5::Base, false>*>> = {<No data fields>}, <No data fields>}, <No data fields>}, <No data fields>}, <std::__detail::_Hashtable_ebo_helper<0, std::equal_to<libdnf5::WeakPtr<libdnf5::Base, false>*>, true>> = {<std::equal_to<libdnf5::WeakPtr<libdnf5::Base, false>*>> = {<std::binary_function<libdnf5::WeakPtr<libdnf5::Base, false>*, libdnf5::WeakPtr<libdnf5::Base, false>*, bool>> = {<No data fields>}, <No data fields>}, <No data fields>}, <No data fields>}, <std::__detail::_Map_base<libdnf5::WeakPtr<libdnf5::Base, false>*, libdnf5::WeakPtr<libdnf5::Base, false>*, std::allocator<libdnf5::WeakPtr<libdnf5::Base, false>*>, std::__detail::_Identity, std::equal_to<libdnf5::WeakPtr<libdnf5::Base, false>*>, std::hash<libdnf5::WeakPtr<libdnf5::Base, false>*>, std::__detail::_Mod_range_hashing, std::__detail::_Default_ranged_hash, std::__detail::_Prime_rehash_policy, std::__detail::_Hashtable_traits<false, true, true>, true>> = {<No data fields>}, <std::__detail::_Insert<libdnf5::WeakPtr<libdnf5::Base, false>*, libdnf5::WeakPtr<libdnf5::Base, false>*, std::allocator<libdnf5::WeakPtr<libdnf5::Base, false>*>, std::__detail::_Identity, std::equal_to<libdnf5::WeakPtr<libdnf5::Base, false>*>, std::hash<libdnf5::WeakPtr<libdnf5::Base, false>*>, std::__detail::_Mod_range_hashing, std::__detail::_Default_ranged_hash, std::__detail::_Prime_rehash_policy, std::__detail::_Hashtable_traits<false, true, true>, true>> = {<std::__detail::_Insert_base<libdnf5::WeakPtr<libdnf5::Base, false>*, libdnf5::WeakPtr<libdnf5::Base, false>*, std::allocator<libdnf5::WeakPtr<libdnf5::Base, false>*>, std::__detail::_Identity, std::equal_to<libdnf5::WeakPtr<libdnf5::Base, false>*>, std::hash<libdnf5::WeakPtr<libdnf5::Base, false>*>, std::__detail::_Mod_range_hashing, std::__detail::_Default_ranged_hash, std::__detail::_Prime_rehash_policy, std::__detail::_Hashtable_traits<false, true, true> >> = {<No data fields>}, <No data fields>}, <std::__detail::_Rehash_base<libdnf5::WeakPtr<libdnf5::Base, false>*, libdnf5::WeakPtr<libdnf5::Base, false>*, std::allocator<libdnf5::WeakPtr<libdnf5::Base, false>*>, std::__detail::_Identity, std::equal_to<libdnf5::WeakPtr<libdnf5::Base, false>*>, std::hash<libdnf5::WeakPtr<libdnf5::Base, false>*>, std::__detail::_Mod_range_hashing, std::__detail::_Default_ranged_hash, std::__detail::_Prime_rehash_policy, std::__detail::_Hashtable_traits<false, true, true>, std::integral_constant<bool, true> >> = {<No data fields>}, <std::__detail::_Equality<libdnf5::WeakPtr<libdnf5::Base, false>*, libdnf5::WeakPtr<libdnf5::Base, false>*, std::allocator<libdnf5::WeakPtr<libdnf5::Base, false>*>, std::__detail::_Identity, std::equal_to<libdnf5::WeakPtr<libdnf5::Base, false>*>, std::hash<libdnf5::WeakPtr<libdnf5::Base, false>*>, std::__detail::_Mod_range_hashing, std::__detail::_Default_ranged_hash, std::__detail::_Prime_rehash_policy, std::__detail::_Hashtable_traits<false, true, true>, true>> = {<No data fields>}, <std::__detail::_Hashtable_alloc<std::allocator<std::__detail::_Hash_node<libdnf5::WeakPtr<libdnf5::Base, false>*, false> > >> = {<std::__detail::_Hashtable_ebo_helper<0, std::allocator<std::__detail::_Hash_node<libdnf5::WeakPtr<libdnf5::Base, false>*, false> >, true>> = {<std::allocator<std::__detail::_Hash_node<libdnf5::WeakPtr<libdnf5::Base, false>*, false> >> = {<std::__new_allocator<std::__detail::_Hash_node<libdnf5::WeakPtr<libdnf5::Base, false>*, false> >> = {<No data fields>}, <No data fields>}, <No data fields>}, <No data fields>}, <std::_Enable_default_constructor<true, std::__detail::_Hash_node_base>> = {<No data fields>}, _M_buckets = 0x556997f1d780, _M_bucket_count = 59, _M_before_begin = {_M_nxt = 0x7f3820000c10}, _M_element_count = 51, _M_rehash_policy = {
                  static _S_growth_factor = 2, _M_max_load_factor = 1, _M_next_resize = 59}, _M_single_bucket = 0x0}}, registered_weak_ptrs_mutex = {<std::__mutex_base> = {_M_mutex = {__data = {__lock = 0, __count = 0, 
                    __owner = 0, __nusers = 0, __kind = 0, __spins = 0, __elision = 0, __list = {__prev = 0x0, __next = 0x0}}, __size = '\000' <repeats 39 times>, __align = 0}}, <No data fields>}}, p_impl = {ptr = 0x556997e04ab0}}
@abbra
Copy link
Author

abbra commented Nov 15, 2024

Reproducer:

  • podman pull registry.fedoraproject.org/fedora-toolbox:41
  • podman run -ti fedora-toolbox:41
  • inside the toolbox:
  • dnf makecache
  • dnf install -y 'dnf-command(builddep)' gdb-minimal make autoconf rpm-build gettext-devel git automake libtool docker python3-paramiko python3-pyyaml
  • dnf builddep -y freeipa
  • git clone https://github.com/freeipa/freeipa
  • cd freeipa; cp freeipa.spec.in freeipa.spec
  • dnf builddep -y -D "with_wheels 1" -D "with_lint 1" -D "with_doc 1" --best --allowerasing --setopt=install_weak_deps=False freeipa.spec

At the point when almost everything is installed, dnf crashes.

@abbra
Copy link
Author

abbra commented Nov 15, 2024

FreeIPA spec has '%autopatch -p1` but no patches in this scenario which causes a warning to be issued when parsing the spec file. However, unlike DNF4, DNF5 crashes when printing this warning.

abbra added a commit to abbra/freeipa that referenced this issue Nov 15, 2024
See rpm-software-management/dnf5#1864

Avoid warning in autopatch by using -q option to suppress warnings.

Signed-off-by: Alexander Bokovoy <[email protected]>
@abbra
Copy link
Author

abbra commented Nov 15, 2024

Using %autopatch -q -p1 avoids running into the macros.warn() part and thus avoids crash. It is still a problem that should be fixed in dnf5.

if #arg == 0 and not opt.q then
   macros.warn({rpm.expand("%{?__file_name:%{__file_name} line %{__file_lineno}}: autopatch: no matching patches in range")})
end

abbra added a commit to abbra/freeipa that referenced this issue Nov 15, 2024
See rpm-software-management/dnf5#1864

Avoid warning in autopatch by using -q option to suppress warnings.

Signed-off-by: Alexander Bokovoy <[email protected]>
abbra added a commit to abbra/freeipa that referenced this issue Nov 15, 2024
See rpm-software-management/dnf5#1864

Avoid warning in autopatch by using -q option to suppress warnings.

Signed-off-by: Alexander Bokovoy <[email protected]>
abbra added a commit to abbra/freeipa that referenced this issue Nov 15, 2024
See rpm-software-management/dnf5#1864

Avoid warning in autopatch by using -q option to suppress warnings.

Signed-off-by: Alexander Bokovoy <[email protected]>
@Patronos
Copy link

Hi there...

Before opening a new issue here... could this be related?

https://bugzilla.redhat.com/show_bug.cgi?id=2326535

@abbra
Copy link
Author

abbra commented Nov 15, 2024

I think it might be a similar cause but there is no detail there.

Two examples in the bug use %autosetup -p1 which internally will expand to call %autopatch -q ... which should not call into macros.warn() due to -q.

m-blaha added a commit that referenced this issue Nov 18, 2024
This patch addresses undefined behavior that occurs when the RPM log
callback function is invoked after the RpmLogGuard object has been
destroyed. The issue arises because rpmlogCallbackData retains a
reference to the destroyed object.

The problem manifests during the execution of the builddep plugin command:

1. During Vars::detect_release, the RPM log callback is set via RpmLogGuard.
2. After the release version is detected, the RpmLogGuard object is destroyed.
3. A subsequent call to rpmSpecParse() by the builddep command may
   trigger the previously set log callback.
4. This results in undefined behavior because the callback data still
   points to the destroyed RpmLogGuard.

By resetting the RPM log callback upon RpmLogGuard destruction, this
patch ensures safe and predictable behavior.

Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=2326535
Resolves: #1864
@m-blaha
Copy link
Member

m-blaha commented Nov 18, 2024

@Patronos Yes, I think the root cause is the same and should be addressed by PR #1870

github-merge-queue bot pushed a commit that referenced this issue Nov 18, 2024
This patch addresses undefined behavior that occurs when the RPM log
callback function is invoked after the RpmLogGuard object has been
destroyed. The issue arises because rpmlogCallbackData retains a
reference to the destroyed object.

The problem manifests during the execution of the builddep plugin command:

1. During Vars::detect_release, the RPM log callback is set via RpmLogGuard.
2. After the release version is detected, the RpmLogGuard object is destroyed.
3. A subsequent call to rpmSpecParse() by the builddep command may
   trigger the previously set log callback.
4. This results in undefined behavior because the callback data still
   points to the destroyed RpmLogGuard.

By resetting the RPM log callback upon RpmLogGuard destruction, this
patch ensures safe and predictable behavior.

Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=2326535
Resolves: #1864
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants