Bug 11900

Summary: rpm and urpmi segfaults during upgrade from mageia 2 to 3
Product: Mageia Reporter: Paweł Susicki <spam>
Component: RPM PackagesAssignee: Mageia Bug Squad <bugsquad>
Status: RESOLVED OLD QA Contact:
Severity: critical    
Priority: Normal CC: thierry.vignaud
Version: 3Keywords: NEEDINFO
Target Milestone: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Source RPM: rpm-4.11.0.1-1.mga3.src.rpm CVE:
Status comment:

Description Paweł Susicki 2013-12-06 13:12:36 CET
Description of problem:

Mageia2 (upgraded Mageia1) connot upgrade to Mageia3.
urpmi --auto-select --auto segfaults on removal of several (about 10) packages,
espcially on rpmdevtools.

Version-Release number of selected component (if applicable):

All versions of librpm.so since two years.

How reproducible:

rpm -e segfaulted while trying to remove package rpmdevtools (and about 10
other packages).

Steps to Reproduce:
1. Install Mageia1 and upgrade to Mageia2.
2. Install rpmdevtools package.
3. Remove rpmdevtools using "rpm -e" or urpme

Upgrade to Mageia3 with this bug is impossible without own patched version of librpm.so.

With gdb problem was identified in lib/transaction.c of librpm.so
in line containing:

	if (*rpmtdGetChar(&ostates) == RPMFILE_STATE_NORMAL)

A function rpmtdGetChar may return NULL instead of pointer
causing segfault in this line. Upgrade continued smoothly
after patch in this place trating NULL return value of the
rpmtdGetChar as if RPMFILE_STATE_NORMAL has been returned.


Reproducible: 

Steps to Reproduce:
Comment 1 Thierry Vignaud 2013-12-06 13:53:31 CET
You must have not upgraded a package rpm is relying on.
You should try perform an upgrade with classic installer (ISO image)

CC: (none) => thierry.vignaud

Comment 2 Paweł Susicki 2013-12-06 14:13:01 CET
I tried classic installer booting ISO image.
Upgrade segfaulted exactly in the same place.
I have copy of rpmdb with Mageia2, so the bug
may be investigated.
Comment 3 Paweł Susicki 2013-12-06 14:13:23 CET
(In reply to Thierry Vignaud from comment #1)
> You must have not upgraded a package rpm is relying on.
> You should try perform an upgrade with classic installer (ISO image)

I tried classic installer booting ISO image.
Upgrade segfaulted exactly in the same place.
I have copy of rpmdb with Mageia2, so the bug
may be investigated.
Comment 4 Thierry Vignaud 2013-12-06 15:39:24 CET
Please attach the /root/drakx/report.bug.xz after this classic installer upgrade

Keywords: (none) => NEEDINFO

Comment 5 Paweł Susicki 2013-12-06 23:42:49 CET
(In reply to Thierry Vignaud from comment #4)
> Please attach the /root/drakx/report.bug.xz after this classic installer
> upgrade

This upgrade segfaults at the beginning, trying to upgrade/remove
package rpmdevtools. So there is no such thing as report after
classic upgrade.

I've done it manually patching librpm.so.3 and using
urpmi --auto-select --auto --replacefiles.

After this manual upgrade everything seems to be ok.

I've a copy of whole root filesystem before upgrade.
Maybe database in /var/lib/rpm would help ?
urpmi/rpm expects at some point during check
to read tag of string type, but it is of another.
Comment 6 Thierry Vignaud 2013-12-07 00:02:34 CET
No.
Mga2 is EOL and for most users the upgrade went smoothly.
There's no way to know what had happened in your case

Status: NEW => RESOLVED
Resolution: (none) => OLD

Comment 7 Paweł Susicki 2013-12-07 19:47:35 CET
(In reply to Thierry Vignaud from comment #6)
> No.
> Mga2 is EOL and for most users the upgrade went smoothly.
> There's no way to know what had happened in your case

OK, I'll recreate this bug on the next upgrade.