synaptic-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Synaptic-devel] New release 0.31


From: Sviatoslav Sviridov
Subject: Re: [Synaptic-devel] New release 0.31
Date: Tue, 14 Jan 2003 17:46:22 +0300

On Mon, 13 Jan 2003 23:22:45 +0100
Michael Vogt <address@hidden> wrote:

> ...
> > to fix segfault in "update" command. There is segfault in libapt-pkg
> > and I'm not shere if there is synaptic's problem or apt's one. I
> > will write about this in mailing list a litle bit later...
> 
> Can you please provide some more information? A gdb backtrace or
> something like this. It surely would help.

I've found the reason and created patch (it seems to be dirty hack, but
may be someone can find better solution).
The problem is in
 apt-pkg/rpm/rpmindexfile.cc:vector<pkgRepository *> RepList;
of apt-rpm.
When synaptic reads cache it calls pkgSourceList::ReadVendors() (via
pkgSourceList::ReadMainList()) where vendors.list readed. Vendors are
stored in pkgSourceList::vector<Vendor const *> VendorList;. And pointer
to Vendor is also stored in pkgRepository::const pkgSourceList::Vendor
*Vendor;. pkgRepository created when reading sources lists, but only on
rpm systems, on debian system it's not created:

/deb/debindexfile.cc:
   new
pkgAcqIndexRel(Owner,NULL,IndexURI("Release"),Info("Release"),"Release"
);
                            ^^^^

/rpm/rpmindexfile.cc:
   new pkgAcqIndexRel(Owner,Repository,ReleaseURI("release"),
                            ^^^^^^^^^^
                      ReleaseInfo("release"), "release", true);

And created repository stored in RepList.
When pressing "Update" synaptic calls pkgSourceList::ReadMainList()
whicj calls pkgSourceList::ReadVendors(). And there VendorList is
cleaned and refilled. After this pkgRepository::Vendor points to unused
memory.
And segfault was in acquire-item.cc:477:

         if (Repository->Vendor->FingerPrint != FingerPrint)

One solution for this is to call pkgSourceList::ReadMainList() only one
time. Attached patch do this. I'm not shure id it is really correct, but
it seems to work. pkgSourceList::ReadMainList() called only one time at
first cache initialization. Other times called only
pkgSourceList::Read(sources.list). I'm not shure if it needed, so I
decided to do this since

bool pkgSourceList::ReadMainList()
{
   return ReadVendors() &&
Read(_config->FindFile("Dir::Etc::sourcelist"));
}

Other solution is to fix apt library, but I'm not shure if it can be
done correctly.

-- 
Sviatoslav Sviridoff
// Lintec Project/Minsk // PIN AG/Berlin //
-- 
E Pluribus Unix

Attachment: synaptic-0.31-alt-sourcelist.patch
Description: Text document


reply via email to

[Prev in Thread] Current Thread [Next in Thread]