Segfaults on powerpc platform

Panu Matilainen pmatilai at laiskiainen.org
Thu Apr 26 00:32:56 PDT 2007


On Mon, 23 Apr 2007, Tim Verhoeven wrote:

> On 4/23/07, Panu Matilainen <pmatilai at laiskiainen.org> wrote:
>>
>> Sorry, haven't had a chance to look into this. The backtrace did look
>> familiar, I now remember somebody reported the very same issue with ppc64
>> quite some time ago but I'd blissfully forgotten about it.
>>
>> I'm afraid this might be tricky to sort without access to ppc64 myself,
>> but lets see... Can you run the same upgrade with attached patch applied
>> and post the output here to give me a hint where to start looking?
>
> Panu,
>
> The gdb output of but with your patch applied :
>
> (gdb) run upgrade
> Starting program: /usr/bin/apt-get upgrade
> [Thread debugging using libthread_db enabled]
> [New Thread 4159255552 (LWP 8856)]
> Reading Package Lists... Done
> Building Dependency Tree... Done
> The following packages will be upgraded
>  ImageMagick-c++.32bit ImageMagick.32bit cups-libs cups-libs.32bit cups.32bit
>  file.32bit firefox.32bit freetype freetype.32bit gnupg.32bit libf2c libgcj
>  libgnat.32bit libobjc mysql mysql.32bit samba-client.32bit samba-common
>  samba-common.32bit seamonkey-nspr.32bit seamonkey-nss.32bit seamonkey.32bit
>  tzdata xorg-x11-Mesa-libGL xorg-x11-Mesa-libGL.32bit xorg-x11-Mesa-libGLU
>  xorg-x11-Mesa-libGLU.32bit xorg-x11-deprecated-libs
>  xorg-x11-deprecated-libs.32bit xorg-x11-font-utils.32bit xorg-x11-libs
>  xorg-x11-libs.32bit xorg-x11-xauth.32bit xorg-x11-xdm.32bit
>  xorg-x11-xfs.32bit xorg-x11.32bit
> 36 upgraded, 0 newly installed, 0 removed and 0 not upgraded.
> creating parser for 3 RPM Database
>
> Program received signal SIGSEGV, Segmentation fault.

Ok so it crashes at least when creating rpmdb parser, the next step is to 
see if it dies on all index types... Apply the attached patch, do
'rm -f /var/cache/apt/*.bin' and then repeat the steps to reproduce the 
crash.

Just so you know where this is going: that'll only tell me if it's somehow 
related to rpmdb handling or a generic problem (I suspect the later) on 
ppc64, not do anything about the problem itself. Frankly, I don't have a 
clue what the actual problem might be. In any case this is just the tip of 
the iceberg for ppc64 problems, at the moment you're probably better of 
having it crash than actually do something :)

/me wanders into apt-rpm multilib la-la-land...
For one, apt gets the preferred architecture wrong on ppc64 
where you generally want 32bit packages with the exception of kernel and 
some other bits. Means it ends up renaming the majority of packages to 
<name>.32bit (which has it's own issues) when it should be renaming 
the 64bit stuff instead to keep the breakage to minimum.
Would help testing if it was runtime configurable instead of hardwired... 
guess I should make it configurable anyway.

The *real* issue however is that the .32bit/.64bit renaming hacks are, 
well, just hacks to keep apt from totally blowing up in the face of 
multilib. The real fix requires ripping up libapt-pkg apart from bottom up 
and completely breaking API compatibility to properly support having 
several packages with same name but different version/arch installed at 
the same time. It's going to hurt bad, but it's unavoidable (long term).

P.S. Again, getting this fixed probably requires me to have (temporary) 
access to ppc64 myself. If somebody can offer that, cool. Otherwise .. 
well, I'll probably gain access to ppc64 hw sooner or later through work 
anyway.

 	- Panu -
-------------- next part --------------
diff --git a/apt-pkg/pkgrecords.cc b/apt-pkg/pkgrecords.cc
diff --git a/apt-pkg/rpm/rpmindexfile.cc b/apt-pkg/rpm/rpmindexfile.cc
diff --git a/apt-pkg/rpm/rpmsystem.cc b/apt-pkg/rpm/rpmsystem.cc
index fb45458..1e159ed 100644
--- a/apt-pkg/rpm/rpmsystem.cc
+++ b/apt-pkg/rpm/rpmsystem.cc
@@ -231,7 +231,7 @@ bool rpmSystem::AddStatusFiles(vector<pkgIndexFile *> &List)
 {
    if (StatusFile == NULL)
       StatusFile = new rpmDatabaseIndex();
-   List.push_back(StatusFile);
+   List.insert(List.begin(), StatusFile);
    return true;
 }
 									/*}}}*/


More information about the Apt-Rpm mailing list