RPM Community Forums

Mailing List Message of <rpm-devel>

Re: Perl: Query with RPM-Perl in 5.x for a package?

From: Per ěyvind Karlsen <pkarlsen@rpm5.org>
Date: Mon 22 Dec 2008 - 18:29:43 CET
Message-ID: <534660c60812220929q4caf446fn6ae3dfa1d23c914a@mail.gmail.com>
2008/10/20 Robert Scheck <robert@rpm5.org>

> On Wed, 13 Aug 2008, Robert Scheck wrote:
> > On Tue, 12 Aug 2008, Michael Jennings wrote:
> > > # perl -MRPM::PackageIterator -e '$iter =
> RPM::PackageIterator->new("NAME", "rpm"); while ($pkg = $iter->next())
> {print $pkg->as_nvre(), "\n";}'
> > > rpm-5.1.4-4.caos
> >
> > Sure?
> >
> > robert@tux:~ > perl -MRPM::PackageIterator -e '$iter =
> RPM::PackageIterator->new("NAME", "rpm"); while ($pkg = $iter->next())
> {print $pkg->as_nvre(), "\n";}'
> > Speicherzugriffsfehler
> > robert@tux:~ >
> >
> > "Speicherzugriffsfehler" is German and means "Segmentation fault". Am I
> > too dumb now or is this really a bug? I'm using RPM 5.2.x (HEAD) with a
> > checkout of 2008-06-30.
>
> I'm still seeing this on HEAD with perl 5.10.0 and Fedora. What's needed to
> debug and finally solve this?

I guess rpmtsFree() shouldn't be done before the object is destroyed, I've
added
a destructor function to free the iterator itself, but I don't have good
enough
knowledge of perl xs stuff to figure out the best way to do rpmtsFree()
there as well..

It should at least probably work for you now, although some memory will be
leaked..
(I really hate XS..)
Received on Mon Dec 22 18:29:44 2008
Driven by Jeff Johnson and the RPM project team.
Hosted by OpenPKG and Ralf S. Engelschall.
Powered by FreeBSD and OpenPKG.