This service will be undergoing maintenance at 00:00 UTC, 2016-09-28. It is expected to last about 1 hours
Bug 283831 - aot-compile-rpm crash
aot-compile-rpm crash
Status: CLOSED RAWHIDE
Product: Fedora
Classification: Fedora
Component: java-1.5.0-gcj (Show other bugs)
7
All Linux
low Severity low
: ---
: ---
Assigned To: Gary Benson
Fedora Extras Quality Assurance
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2007-09-08 23:28 EDT by Jerry James
Modified: 2008-04-03 14:27 EDT (History)
1 user (show)

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


Attachments (Terms of Use)

  None (edit)
Description Jerry James 2007-09-08 23:28:21 EDT
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 03:24:05 EST
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 17:05:56 EDT
Gary, can you take a quick look at this one?
Comment 3 Gary Benson 2008-04-03 03:54:37 EDT
I committed a fix.

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