RPM Community Forums

Mailing List Message of <rpm-devel>

Re: rpm 5.1 segfaults

From: Per Øyvind Karlsen <pkarlsen@rpm5.org>
Date: Tue 15 Apr 2008 - 23:23:40 CEST
Message-id: <200804152323.41110.pkarlsen@rpm5.org>
På Tirsdag 15 april 2008 , 20:39:46 skrev Jeff Johnson:
> On Apr 15, 2008, at 2:10 PM, Jeff Johnson wrote:
> >> rpm: depends.c:1776: zapRelation: Assertion `tsi->tsi_reqx >= 0 &&
> >> tsi->tsi_reqx < rpmdsCount(requires)' failed.
> >> Avbrutt (SIGABRT)
> >
> > Bingo. Thanks. Now to find where tsi->tsi_reqx goes awry ...
>
> Hmmm, there's only one place that tsi->tsi_reqx is set.
>
> And AFAICT, addRelation() is called only within an rpmds iteration,
> where the value used should be valid. But the code paths are twistier
> than I would like because the iteration index is accessed in the
> addRelation()
> subroutine.
>
> Can I get you to try reproducing with one more assertion?
>
> Here is the patch:
>
> @@ -1902,6 +1903,7 @@ static inline int addRelation(rpmts ts,
>
>       tsi->tsi_tagn = rpmdsTagN(requires);
>       tsi->tsi_reqx = rpmdsIx(requires);
> +assert(tsi->tsi_reqx >= 0 && tsi->tsi_reqx < rpmdsCount(requires));
>
>       tsi->tsi_next = rpmteTSI(q)->tsi_next;
>       rpmteTSI(q)->tsi_next = tsi;
>
> If the new assertion fires, then I'm not reading the rpmds iteration
> code correctly.
>
> If the old assertion fires, then there's a wild pointer somewhere.
>
> Thanks.
[root@localhost SPECS]# LC_ALL=C 
rpm -Uvh /home/peroyvind/RPM/RPMS/x86_64/drakxtools-curses-10.29-1mdv2008.1.x86_64.rpm /home/peroyvind/RPM/RPMS/noarch/drakx-net-*
error: Failed dependencies:
        drakxtools-backend = 10.29-1mdv2008.1 is needed by 
drakxtools-curses-10.29-1mdv2008.1.x86_64
        libdrakx-net = 0.34 is needed by drakx-net-0.34-1mdv2008.1.noarch
        libdrakx-net = 0.34 is needed by drakx-net-text-0.34-1mdv2008.1.noarch
        drakxtools-curses = 10.22-1mdv2008.1 is needed by (installed) 
harddrake-10.22-1mdv2008.1.x86_64
        drakxtools-curses = 10.22-1mdv2008.1 is needed by (installed) 
drakxtools-10.22-1mdv2008.1.x86_64
rpm: depends.c:1776: zapRelation: Assertion `tsi->tsi_reqx >= 0 && 
tsi->tsi_reqx < rpmdsCount(requires)' failed.
Avbrutt (SIGABRT)



-- 
Regards,
Per Øyvind Karlsen
Received on Tue Apr 15 23:23:55 2008
Driven by Jeff Johnson and the RPM project team.
Hosted by OpenPKG and Ralf S. Engelschall.
Powered by FreeBSD and OpenPKG.