harvard-lts / fits

File Information Tool Set
http://fitstool.org
GNU Lesser General Public License v2.1
92 stars 46 forks source link

JVM crashes when Fits is launched #160

Open ghost opened 6 years ago

ghost commented 6 years ago

On Ubuntu 16.04, JVM crashes when Fits is called on any file format. Tried with java-8-open-jdk, java-8-oracle-jdk, fits-1.2.0, fits-1.0.5. It only works by downgrading fits to 0.8.5.

~/fits-1.0.5$ ./fits.sh -i myfile.txt 
#
# A fatal error has been detected by the Java Runtime Environment:
#
#  SIGSEGV (0xb) at pc=0x00007fb65abb9a23, pid=2788, tid=0x00007fb681505700
#
# JRE version: Java(TM) SE Runtime Environment (8.0_151-b12) (build 1.8.0_151-b12)
# Java VM: Java HotSpot(TM) 64-Bit Server VM (25.151-b12 mixed mode linux-amd64 compressed oops)
# Problematic frame:
# C  [libstdc++.so.6+0xa4a23]
#
# Failed to write core dump. Core dumps have been disabled. To enable core dumping, try "ulimit -c unlimited" before starting Java again
#
# An error report file with more information is saved as:
# /home/------------/fits-1.0.5/hs_err_pid2788.log
#
# If you would like to submit a bug report, please visit:
#   http://bugreport.java.com/bugreport/crash.jsp
# The crash happened outside the Java Virtual Machine in native code.
# See problematic frame for where to report the bug.
#
Aborted (core dumped)
daveneiman commented 6 years ago

Thanks for letting us know. However, without more information specific to FITS, it will be difficult to address this issue. It would be helpful to know from which point in FITS this happens. This might involve using a debugger and setting break points. Pretty sure many other FITS users are using the application on Ubuntu and have yet to hear about an issue such as this so wondering if it might be specific to your system.

Please consider posting this to the FITS Users Google Group so that others might be able to add their experiences using FITS on Ubuntu: https://groups.google.com/forum/#!forum/fits-users

gwiedeman commented 6 years ago

I am also having this issue on Ubuntu 16.04. Same result with multiple versions of openjdk 8 and oracle 8 and 9. fits -v and fits -h gives the correct output it crashes Java when you run it on a file.

daveneiman commented 6 years ago

Unfortunately, given that our development team is small, we don't have the resources to test FITS on all types of operating systems. We typically develop and test on OSX and Windows. As a result, we'd like to request that you try the following to help narrow down the origin of these JVM crashes.

FITS aggregates 13 different tools into its suite. Some of these tools are purely Java-based while others use Java to invoke system-level commands. For example, the FileUtility tool executes the "file" command on whichever operating system it is being used on.

In the fits.xml configuration file, these 13 tools are listed within the element. Try commenting-out each individual tool within this element, one at a time, and try running FITS on a file that causes the JVM crash. This would require 13 invocations of FITS on the same file, once for each commented-out tool. If FITS then succeeds with a particular tool commented-out, this would help to narrow down the problem.

Your help in this endeavor would be much appreciated.

Thanks, The FITS development team

gwiedeman commented 6 years ago

No problem, looks like its MediaInfo.

If I comment out this line it runs: <tool class="edu.harvard.hul.ois.fits.tools.mediainfo.MediaInfo" include-exts="avi,mov,mpg,mpeg,mkv,mp4,mxf,ogv,mj2,divx,dv,m4v,m2v,ismv,m2ts,mpeg4" classpath-dirs="lib/mediainfo" />

This is on FITS 1.0.5

daveneiman commented 6 years ago

Thanks so much for finding this. Though I'm barely familiar with the MediaInfo tool since I did not develop it, I do know that there are OS-specific system level binaries that are part of the FITS deployment. These are contained in FITS in subdirectories of tools/mediainfo/ There are subdirectories for window, mac, and linux. In looking at the FITS website here, it appears that the MediaInfo tool only supports the RedHat 6.x 64-bit flavor of Linux.

gwiedeman commented 6 years ago

Yeah it looks weird. Thanks for responding. This might be okay for us since our prod is CentOS and I haven't tested it there yet. Commenting it out solved my immediate problem.

However, this might eventually become an issue for people using BitCurator that want to run FITS. Looks like it uses FITS 0.10.2 by default, maybe because of this issue. (https://wiki.bitcurator.net/index.php?title=BitCurator_Environment_Releases)

irfanrahman commented 5 years ago

Same issue, FITS was working fine, then I installed mediainfo package for something and FITS started giving error, as soon as I removed mediainfo package, FITS working again on Ubuntu 16LTS.

If mediainfo is installed on your Ubuntu, fits mediainfo tool will crash, conflict with the libraries. it should not be that way.

Making symlink works, i.e. ln -s /usr/lib/x86_64-linux-gnu/libzen.so.0.4.37 fits/tools/mediainfo/linux/libzen.so.0 ln -s /usr/lib/x86_64-linux-gnu/libmediainfo.so.0.0.0 fits/tools/mediainfo/linux/libmediainfo.so.0

now both mediainfo and fits can live together happily. btw get latest mediainfo from their repo.

daveneiman commented 5 years ago

Thanks for a possible resolution to this problem. Please note that the latest MediaInfo provides somewhat different labels for the various metadata it returns, depending on the OS on which it is installed. The XSLT in FITS has not been modified to accommodate these changes so may not aggregate these metadata. There has not yet been a timeline established to modify FITS for these changes.

pwinckles commented 2 years ago

I made some changes to how MediaInfo was initialized. This problem may be resolved in the next release.