Bug 283831 - aot-compile-rpm crash
Summary: aot-compile-rpm crash
Status: CLOSED RAWHIDE
Alias: None
Product: Fedora
Classification: Fedora
Component: java-1.5.0-gcj (Show other bugs)
(Show other bugs)
Version: 7
Hardware: All Linux
low
low
Target Milestone: ---
Assignee: Gary Benson
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Keywords:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2007-09-09 03:28 UTC by Jerry James
Modified: 2008-04-03 18:27 UTC (History)
1 user (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2008-04-03 18:27:21 UTC
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

Description Jerry James 2007-09-09 03:28:21 UTC
Description of problem:
Due to operator error, I managed to create an empty jar file (containing only
META-INF/MANIFEST.MF).  Then aot-compile-rpm crashed:

+ /usr/bin/aot-compile-rpm
Traceback (most recent call last):
 File "/usr/bin/aot-compile-rpm", line 66, in <module>
   compiler.compile()
 File "/usr/lib/python2.5/site-packages/aotcompile.py", line 98, in compile
   self.writeMakefile(MAKEFILE, jobs)
 File "/usr/lib/python2.5/site-packages/aotcompile.py", line 124, in
writeMakefile
   (job.dsoName(), job.dbName()) for job in jobs]))}
TypeError: reduce() of empty sequence with no initial value
error: Bad exit status from /var/tmp/rpm-tmp.78936 (%install)

It took me a little digging through the code to figure out what that crash
meant.  It would be good to catch this exception and issue an error message
instead, perhaps "You dummy, there's nothing in your JAR file!"

Version-Release number of selected component (if applicable):
java-1.5.0-gcj-devel-1.5.0.0-14.fc7

How reproducible:
Always

Steps to Reproduce:
1. Write an RPM script that produces an empty jar file.  Have the %build script
execute "jar cf some.jar", for example.
2. Invoke aot-compile-rpm in the %install section
3. Invoke rpmbuild on the script
  
Actual results:
aot-compile-rpm crashes with the stacktrace given above

Expected results:
aot-compile-rpm should instead warn that it was given an empty JAR file

Additional info:

Comment 1 Mat Booth 2007-12-11 08:24:05 UTC
I've managed to generate the same error on F8 under the same circumstances. As
I'm not a Python person, I didn't know what I doing was wrong until some
Googling brought me here.

Comment 2 Thomas Fitzsimmons 2008-04-02 21:05:56 UTC
Gary, can you take a quick look at this one?

Comment 3 Gary Benson 2008-04-03 07:54:37 UTC
I committed a fix.


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