Bug 956190

Summary: rpmbuild crashes with double free or corruption (fasttop) when %caps directives are at the end of a %files section or have wildcards
Product: [Fedora] Fedora Reporter: Simone Caronni <negativo17>
Component: rpmAssignee: Packaging Maintenance Team <packaging-team-maint>
Status: CLOSED ERRATA QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: high Docs Contact:
Priority: unspecified    
Version: 18CC: ffesti, jzeleny, novyjindrich, packaging-team-maint, pknirsch
Target Milestone: ---   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: rpm-4.11.1-3.fc19 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2013-09-01 23:01:51 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Simone Caronni 2013-04-24 12:28:44 UTC
Description of problem:
Building an rpm with a %caps directive in the %files list make rpmbuild crash with a double free.

Version-Release number of selected component (if applicable):
This happens on *all* Fedora and RHEL 6 distribution, so all the rpm versions as bundled in RHEL 6 and Fedora 17, 18.

How reproducible:
Always.

Steps to Reproduce:
1. Download a %caps enabled package
2. Move the %caps file to the end of a %files section or use a wildcard
3. Rebuild the package.
  
Actual results:
rpmbuilds crashes

Expected results:
rpmbuild will build the package as expected.

Additional info:
The reason why it hasn't been spotted before this is that it apparently only occurs if the %caps entry is either a wildcard or the last file in a %files section.

Comment 1 Simone Caronni 2013-04-24 12:29:13 UTC
*** glibc detected *** rpmbuild: double free or corruption (fasttop): 0x0000000000c07f80 ***
======= Backtrace: =========
/lib64/libc.so.6(+0x7ca8e)[0x7fe4b181fa8e]
/lib64/librpmio.so.3(rfree+0x9)[0x7fe4b3c44ee9]
/lib64/librpmbuild.so.3(+0x890e)[0x7fe4b42e490e]
/lib64/librpmbuild.so.3(+0xaf3c)[0x7fe4b42e6f3c]
/lib64/librpmbuild.so.3(+0xc91c)[0x7fe4b42e891c]
/lib64/librpmbuild.so.3(+0x78c1)[0x7fe4b42e38c1]
rpmbuild[0x402b8a]
rpmbuild[0x402e0f]
rpmbuild[0x401fe3]
/lib64/libc.so.6(__libc_start_main+0xf5)[0x7fe4b17c4a05]
rpmbuild[0x40221d]
======= Memory map: ========
00400000-00405000 r-xp 00000000 fd:01 1465924                            /usr/bin/rpmbuild
00604000-00605000 r--p 00004000 fd:01 1465924                            /usr/bin/rpmbuild
00605000-00606000 rw-p 00005000 fd:01 1465924                            /usr/bin/rpmbuild
00b95000-00fdd000 rw-p 00000000 00:00 0                                  [heap]
7fe4a995d000-7fe4a9972000 r-xp 00000000 fd:01 1467761                    /usr/lib64/libgcc_s-4.7.2-20121109.so.1
7fe4a9972000-7fe4a9b71000 ---p 00015000 fd:01 1467761                    /usr/lib64/libgcc_s-4.7.2-20121109.so.1
7fe4a9b71000-7fe4a9b72000 r--p 00014000 fd:01 1467761                    /usr/lib64/libgcc_s-4.7.2-20121109.so.1
7fe4a9b72000-7fe4a9b73000 rw-p 00015000 fd:01 1467761                    /usr/lib64/libgcc_s-4.7.2-20121109.so.1
7fe4a9b73000-7fe4a9bd9000 r-xp 00000000 fd:01 1469829                    /usr/lib64/libfreebl3.so
7fe4a9bd9000-7fe4a9dd9000 ---p 00066000 fd:01 1469829                    /usr/lib64/libfreebl3.so
7fe4a9dd9000-7fe4a9dda000 r--p 00066000 fd:01 1469829                    /usr/lib64/libfreebl3.so
7fe4a9dda000-7fe4a9ddb000 rw-p 00067000 fd:01 1469829                    /usr/lib64/libfreebl3.so
7fe4a9ddb000-7fe4a9ddf000 rw-p 00000000 00:00 0 
7fe4a9ddf000-7fe4a9e85000 r-xp 00000000 fd:01 1470287                    /usr/lib64/libsqlite3.so.0.8.6
7fe4a9e85000-7fe4aa084000 ---p 000a6000 fd:01 1470287                    /usr/lib64/libsqlite3.so.0.8.6
7fe4aa084000-7fe4aa086000 r--p 000a5000 fd:01 1470287                    /usr/lib64/libsqlite3.so.0.8.6
7fe4aa086000-7fe4aa088000 rw-p 000a7000 fd:01 1470287                    /usr/lib64/libsqlite3.so.0.8.6
7fe4aa088000-7fe4aa089000 rw-p 00000000 00:00 0 
7fe4aa089000-7fe4aa0c7000 r-xp 00000000 fd:01 1469407                    /usr/lib64/libsoftokn3.so
7fe4aa0c7000-7fe4aa2c7000 ---p 0003e000 fd:01 1469407                    /usr/lib64/libsoftokn3.so
7fe4aa2c7000-7fe4aa2c8000 r--p 0003e000 fd:01 1469407                    /usr/lib64/libsoftokn3.so
7fe4aa2c8000-7fe4aa2c9000 rw-p 0003f000 fd:01 1469407                    /usr/lib64/libsoftokn3.so
7fe4aa2c9000-7fe4aa2d5000 r-xp 00000000 fd:01 1467786                    /usr/lib64/libnss_files-2.16.so
7fe4aa2d5000-7fe4aa4d4000 ---p 0000c000 fd:01 1467786                    /usr/lib64/libnss_files-2.16.so
7fe4aa4d4000-7fe4aa4d5000 r--p 0000b000 fd:01 1467786                    /usr/lib64/libnss_files-2.16.so
7fe4aa4d5000-7fe4aa4d6000 rw-p 0000c000 fd:01 1467786                    /usr/lib64/libnss_files-2.16.so
7fe4aa4d6000-7fe4b08c6000 r--p 00000000 fd:01 1466334                    /usr/lib/locale/locale-archive
7fe4b08c6000-7fe4b08ff000 r-xp 00000000 fd:01 1470258                    /usr/lib64/libnspr4.so
7fe4b08ff000-7fe4b0aff000 ---p 00039000 fd:01 1470258                    /usr/lib64/libnspr4.so
7fe4b0aff000-7fe4b0b00000 r--p 00039000 fd:01 1470258                    /usr/lib64/libnspr4.so
7fe4b0b00000-7fe4b0b02000 rw-p 0003a000 fd:01 1470258                    /usr/lib64/libnspr4.so
7fe4b0b02000-7fe4b0b04000 rw-p 00000000 00:00 0 
7fe4b0b04000-7fe4b0b07000 r-xp 00000000 fd:01 1469808                    /usr/lib64/libplds4.so
7fe4b0b07000-7fe4b0d06000 ---p 00003000 fd:01 1469808                    /usr/lib64/libplds4.so
7fe4b0d06000-7fe4b0d07000 r--p 00002000 fd:01 1469808                    /usr/lib64/libplds4.so
7fe4b0d07000-7fe4b0d08000 rw-p 00003000 fd:01 1469808                    /usr/lib64/libplds4.so
7fe4b0d08000-7fe4b0d0c000 r-xp 00000000 fd:01 1470139                    /usr/lib64/libplc4.so
7fe4b0d0c000-7fe4b0f0b000 ---p 00004000 fd:01 1470139                    /usr/lib64/libplc4.so
7fe4b0f0b000-7fe4b0f0c000 r--p 00003000 fd:01 1470139                    /usr/lib64/libplc4.so
7fe4b0f0c000-7fe4b0f0d000 rw-p 00004000 fd:01 1470139                    /usr/lib64/libplc4.so
7fe4b0f0d000-7fe4b0f31000 r-xp 00000000 fd:01 1467752                    /usr/lib64/libnssutil3.so
7fe4b0f31000-7fe4b1131000 ---p 00024000 fd:01 1467752                    /usr/lib64/libnssutil3.so
7fe4b1131000-7fe4b1137000 r--p 00024000 fd:01 1467752                    /usr/lib64/libnssutil3.so
7fe4b1137000-7fe4b1138000 rw-p 0002a000 fd:01 1467752                    /usr/lib64/libnssutil3.so
7fe4b1138000-7fe4b113f000 r-xp 00000000 fd:01 1470193                    /usr/lib64/librt-2.16.so
7fe4b113f000-7fe4b133e000 ---p 00007000 fd:01 1470193                    /usr/lib64/librt-2.16.so
7fe4b133e000-7fe4b133f000 r--p 00006000 fd:01 1470193                    /usr/lib64/librt-2.16.so
7fe4b133f000-7fe4b1340000 rw-p 00007000 fd:01 1470193                    /usr/lib64/librt-2.16.so
7fe4b1340000-7fe4b1344000 r-xp 00000000 fd:01 1467751                    /usr/lib64/libattr.so.1.1.0
7fe4b1344000-7fe4b1543000 ---p 00004000 fd:01 1467751                    /usr/lib64/libattr.so.1.1.0
7fe4b1543000-7fe4b1544000 r--p 00003000 fd:01 1467751                    /usr/lib64/libattr.so.1.1.0
7fe4b1544000-7fe4b1545000 rw-p 00004000 fd:01 1467751                    /usr/lib64/libattr.so.1.1.0
7fe4b1545000-7fe4b15a1000 r-xp 00000000 fd:01 1469779                    /usr/lib64/libpcre.so.1.0.1
7fe4b15a1000-7fe4b17a1000 ---p 0005c000 fd:01 1469779                    /usr/lib64/libpcre.so.1.0.1
7fe4b17a1000-7fe4b17a2000 r--p 0005c000 fd:01 1469779                    /usr/lib64/libpcre.so.1.0.1
7fe4b17a2000-7fe4b17a3000 rw-p 0005d000 fd:01 1469779                    /usr/lib64/libpcre.so.1.0.1
7fe4b17a3000-7fe4b1950000 r-xp 00000000 fd:01 1467807                    /usr/lib64/libc-2.16.so
7fe4b1950000-7fe4b1b50000 ---p 001ad000 fd:01 1467807                    /usr/lib64/libc-2.16.so
7fe4b1b50000-7fe4b1b54000 r--p 001ad000 fd:01 1467807                    /usr/lib64/libc-2.16.so
7fe4b1b54000-7fe4b1b56000 rw-p 001b1000 fd:01 1467807                    /usr/lib64/libc-2.16.so
7fe4b1b56000-7fe4b1b5b000 rw-p 00000000 00:00 0 
7fe4b1b5b000-7fe4b1b71000 r-xp 00000000 fd:01 1469836                    /usr/lib64/libpthread-2.16.so
7fe4b1b71000-7fe4b1d71000 ---p 00016000 fd:01 1469836                    /usr/lib64/libpthread-2.16.so
7fe4b1d71000-7fe4b1d72000 r--p 00016000 fd:01 1469836                    /usr
Child return code was: -6

Comment 2 Simone Caronni 2013-04-24 12:30:56 UTC
RHEL 6 bug referenced:

https://bugzilla.redhat.com/show_bug.cgi?id=904818

Changed from Fedora 19 (mistake!) to Fedora 18.

Comment 3 Fedora Update System 2013-08-26 09:18:58 UTC
rpm-4.10.3.1-2.fc18 has been submitted as an update for Fedora 18.
https://admin.fedoraproject.org/updates/rpm-4.10.3.1-2.fc18

Comment 4 Fedora Update System 2013-08-26 22:30:50 UTC
Package rpm-4.10.3.1-2.fc18:
* should fix your issue,
* was pushed to the Fedora 18 testing repository,
* should be available at your local mirror within two days.
Update it with:
# su -c 'yum update --enablerepo=updates-testing rpm-4.10.3.1-2.fc18'
as soon as you are able to.
Please go to the following url:
https://admin.fedoraproject.org/updates/FEDORA-2013-15331/rpm-4.10.3.1-2.fc18
then log in and leave karma (feedback).

Comment 5 Fedora Update System 2013-09-01 23:01:51 UTC
rpm-4.10.3.1-2.fc18 has been pushed to the Fedora 18 stable repository.  If problems still persist, please make note of it in this bug report.

Comment 6 Fedora Update System 2013-09-09 12:42:23 UTC
rpm-4.11.1-7.fc20 has been submitted as an update for Fedora 20.
https://admin.fedoraproject.org/updates/rpm-4.11.1-7.fc20

Comment 7 Fedora Update System 2013-09-09 12:44:26 UTC
rpm-4.11.1-2.fc19 has been submitted as an update for Fedora 19.
https://admin.fedoraproject.org/updates/rpm-4.11.1-2.fc19

Comment 8 Fedora Update System 2013-09-11 02:05:46 UTC
rpm-4.11.1-3.fc19 has been pushed to the Fedora 19 stable repository.  If problems still persist, please make note of it in this bug report.

Comment 9 Fedora Update System 2013-09-23 00:16:07 UTC
rpm-4.11.1-7.fc20 has been pushed to the Fedora 20 stable repository.  If problems still persist, please make note of it in this bug report.