Created attachment 871888 [details] InspectVM.java Description of problem: Using the inspect_list_applications2 function causes java.lang.ArrayIndexOutOfBoundsException to be thrown. Version-Release number of selected component (if applicable): libguestfs-java-1.25.42-1.fc21.x86_64 How reproducible: 100% Steps to Reproduce: Download InspectVM.java file attached. Compile it like this: javac -classpath /usr/share/java/libguestfs.jar InspectVM.java To test this you will need any Linux disk image. eg. Build one using virt-builder: virt-builder fedora-20 Run the program on this disk image: $ java -classpath /usr/share/java/libguestfs.jar:. InspectVM fedora-20.img Root device: /dev/sda3 Product name: Fedora release 20 (Heisenbug) Version: 20.0 Type: linux Distro: fedora java.lang.ArrayIndexOutOfBoundsException: 231 It shouldn't print the ArrayIndexOutOfBoundsException error.
This same bug appears with a ubuntu guest machine. Tewsted it with JDK Oracle 1.8 and multiple libguestfs versions (up to 1.24.5)
Patches posted: https://www.redhat.com/archives/libguestfs/2014-March/thread.html#00042
I pushed this series upstream, on the basis that: - passes make check - passes make check-valgrind [but valgrind probably isn't run on the java bindings, so this may not be meaningful] - should be at least an improvement on the previous situation, even if we discover further problems. Therefore I'm closing this bug, fixed upstream in libguestfs >= 1.25.43. These are candidates for backporting to the stable branch. Please reopen if you find further problems with g.inspect_list_applications2. For other Java bindings bugs, open a new bug.
I've backported the fixes to 1.24.7 which will be released soon.
*** Bug 1249918 has been marked as a duplicate of this bug. ***