synaptic-devel
[Top][All Lists]
Advanced

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

Re: [Synaptic-devel] Strange segfault


From: Andrey Tarassov
Subject: Re: [Synaptic-devel] Strange segfault
Date: Sat, 17 Apr 2004 14:01:41 +0100
User-agent: Mozilla Thunderbird 0.5 (X11/20040208)

Yeap, it worked without any segfaults now as well. To make sure I will test this with some clean machine and a clean installation as well during the next week. Just in case :-)

Good work, thanks!

BTW, I've noticed an unpleasant thing with repositories and refreshing the lists. Our server was down when I tried to refresh the list and I received a warning that some release files were not downloaded. Then the server was put up and running and I pressed the Refresh button again, but synaptic would not download the lists until it is restarted. Is this a bug or a feature?

Thanks again,

Andrey

Gustavo Niemeyer wrote:
Yeah! That really helped! But how does the pkgSourceList destructor gets called before the lists are refreshed? Is there any way to eliminate the memory leak as well?


Andrey, would you please be able to test the attached patch?

Thanks!



------------------------------------------------------------------------

Index: apt-pkg/rpm/rpmindexfile.cc
===================================================================
--- apt-pkg/rpm/rpmindexfile.cc (revision 320)
+++ apt-pkg/rpm/rpmindexfile.cc (working copy)
@@ -644,10 +644,8 @@
       {
if ((*iter)->URI == URI && (*iter)->Dist == Dist) { - // The registered object has no vendor, but the new one does
-           // so, we make the previous one have the vendor too.
-           if ((*iter)->Vendor == NULL && Vendor != NULL)
-              (*iter)->Vendor = Vendor;
+           if (Vendor != NULL)
+              (*iter)->FingerPrint = Vendor->FingerPrint;
            return *iter;
         }
       }
Index: apt-pkg/repository.h
===================================================================
--- apt-pkg/repository.h        (revision 320)
+++ apt-pkg/repository.h        (working copy)
@@ -28,27 +28,29 @@
map<string,Checksum> IndexChecksums; // path -> checksum data bool GotRelease; - + public: string URI;
    string Dist;
-   const pkgSourceList::Vendor *Vendor;
    string RootURI;
bool Acquire; - + string FingerPrint;
+
    bool ParseRelease(string File);
    bool HasRelease() const { return GotRelease; }
- bool IsAuthenticated() const { return Vendor != NULL; };
+   bool IsAuthenticated() const { return !FingerPrint.empty(); };
    bool FindChecksums(string URI,unsigned long &Size, string &MD5);
pkgRepository(string URI,string Dist, const pkgSourceList::Vendor *Vendor,
                 string RootURI)
-      : GotRelease(0), URI(URI), Dist(Dist), Vendor(Vendor), RootURI(RootURI),
+      : GotRelease(0), URI(URI), Dist(Dist), RootURI(RootURI),
        Acquire(1)
-      {};
+   {
+      if (Vendor) FingerPrint = Vendor->FingerPrint;
+   };
}; Index: apt-pkg/acquire-item.cc
===================================================================
--- apt-pkg/acquire-item.cc     (revision 320)
+++ apt-pkg/acquire-item.cc     (working copy)
@@ -477,11 +477,11 @@
         }
// Match fingerprint of Release file
-        if (Repository->Vendor->FingerPrint != FingerPrint)
+        if (Repository->FingerPrint != FingerPrint)
         {
            Status = StatError;
            ErrorText = _("Signature fingerprint of Release file does not match 
(expected ")
-              +Repository->Vendor->FingerPrint+_(", got ")+FingerPrint+")";
+              +Repository->FingerPrint+_(", got ")+FingerPrint+")";
            return;
         }
       }

--
Andrey Tarasov
Software Engineer

OÜ SOT Finnish Software Engineering
Kreutzwaldi 7-4, 10124 TALLINN, ESTONIA

Phone: +372 641 9975
Fax:   +372 641 9876
address@hidden
http://www.sot.com




reply via email to

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