Bug 490378 - Duplicate trigger sources in spec crashes RPM
Duplicate trigger sources in spec crashes RPM
Status: CLOSED ERRATA
Product: Fedora
Classification: Fedora
Component: rpm (Show other bugs)
10
All Linux
low Severity medium
: ---
: ---
Assigned To: Panu Matilainen
Fedora Extras Quality Assurance
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2009-03-15 17:04 EDT by Carl Roth
Modified: 2009-10-27 02:36 EDT (History)
3 users (show)

See Also:
Fixed In Version: 4.7.1-3.fc11
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2009-10-27 02:36:11 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)
RPM spec file (208 bytes, text/plain)
2009-03-15 17:05 EDT, Carl Roth
no flags Details

  None (edit)
Description Carl Roth 2009-03-15 17:04:40 EDT
Description of problem:

If you define two triggers in a SPEC that are triggered from the same source, rpm-4.6 generates invalid trigger sections in the RPM, and the rpm tool crashes when processing the resultant RPM.

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

rpm-4.6.0-1.fc10.x86_64

(this bug does not affect rpm-4.4.2.3-3.fc9.i386 as with F9)

How reproducible:

Always

Steps to Reproduce:
1. Create a spec file with duplicate trigger sources (see attached)
2. Generate the rpm using F9 and F10
3. Query the rpm using F9 and F10
  
Actual results:

F9 behaves as expected.
F10 generates an invalid RPM, and afterwards the rpm tool crashes when trying to process it.

Expected results:


Additional info:

F9 behaves as expected: the RPM contains multiple triggers keyed to the same trigger source.

$ rpm -qp --triggers foo-0.0-0.i386.rpm
triggerin scriptlet (using /bin/sh) -- some-package
:
triggerin scriptlet (using /bin/sh) -- some-package
:

F10 generates an invalid RPM -- only the first trigger has a valid trigger source.

F10's rpm crashes (segfault) when analyzing this RPM (rpm -qp --triggers XXX).

F9's rpm can analyze both RPMs, but the RPM generated by F10 appears to be invalid (as described above)

F10 can handle the RPM generated by F9; the multiple triggers appear correctly.

$ rpm -qp --triggers foo-0.0-0.x86_64.rpm
triggerin scriptlet (using /bin/sh) -- some-package
:
trigger: scriptlet (using /bin/sh) --
:

[note that the second trigger appears invalid]

As a matter of discussion, I am not asking that either RPM version support multiple triggers with the same source -- in my case this was a bug in my SPEC file.  I *would* expect, though, that if it is unsupported, that RPM would report an error or warning, like it does for duplicate %post sections.
Comment 1 Carl Roth 2009-03-15 17:05:18 EDT
Created attachment 335277 [details]
RPM spec file
Comment 2 Panu Matilainen 2009-03-16 04:18:20 EDT
Thanks for the reproducer, will fix.
Comment 3 Panu Matilainen 2009-09-15 05:51:41 EDT
Fixed in rawhide (and upstream) now. Multiple triggers are intentionally permitted, rpm just sees this as two distinct trigger scripts with identical condition, eg

%trigger -- some-package
echo A

%trigger -- some-package
echo B
Comment 4 Fedora Update System 2009-10-08 06:05:58 EDT
rpm-4.7.1-3.fc11 has been submitted as an update for Fedora 11.
http://admin.fedoraproject.org/updates/rpm-4.7.1-3.fc11
Comment 5 Fedora Update System 2009-10-08 23:40:57 EDT
rpm-4.7.1-3.fc11 has been pushed to the Fedora 11 testing repository.  If problems still persist, please make note of it in this bug report.
 If you want to test the update, you can install it with 
 su -c 'yum --enablerepo=updates-testing update rpm'.  You can provide feedback for this update here: http://admin.fedoraproject.org/updates/F11/FEDORA-2009-10354
Comment 6 Fedora Update System 2009-10-27 02:34:58 EDT
rpm-4.7.1-3.fc11 has been pushed to the Fedora 11 stable repository.  If problems still persist, please make note of it in this bug report.

Note You need to log in before you can comment on or make changes to this bug.