MamasBoyGitHub / universal-media-server

Automatically exported from code.google.com/p/universal-media-server
GNU General Public License v2.0
0 stars 0 forks source link

JVM crash when Library Scanner scans some type of mp3 with jpeg cover #22

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1. Copy an mp3 file with embedded jpeg cover inside a shared folder
2. Start UMS and enable cache
3. Start "Scan all shared folder" button

What is the expected output?
The scan should complete without problems

What do you see instead?
JVM Crash, this is the output in stdout:
An irrecoverable stack overflow has occurred.
#
# A fatal error has been detected by the Java Runtime Environment:
#
#  SIGSEGV (0xb) at pc=0x00007f9cdcfd6bd6, pid=7599, tid=140310919546624
#
# JRE version: 6.0_35-b10
# Java VM: Java HotSpot(TM) 64-Bit Server VM (20.10-b01 mixed mode linux-amd64 
compressed oops)
# Problematic frame:
# C  [jna5674290214966971538.tmp+0x6bd6]  __int128+0x1b6
#
# An error report file with more information is saved as:
# /home/plasma/apps/ums-1.6.0/hs_err_pid7599.log
#
# If you would like to submit a bug report, please visit:
#   http://java.sun.com/webapps/bugreport/crash.jsp
# The crash happened outside the Java Virtual Machine in native code.
# See problematic frame for where to report the bug.
#
Aborted

What version of the product are you using? On what operating system?
I've made various test on 3 different Gentoo Linux servers:
32bit JDK6 - ums 1.6.0 -> Crash
32bit JDK7 - ums 1.6.0 -> Crash
32bit JDK6 - ums 1.5.2 -> Crash
32bit JDK6 - pms-linux-1.50.1-SB56 -> Crash
32bit JDK6 - pms-linux-1.40.0-SB45 -> Crash
32bit JDK6 - pms-linux-1.21.1 -> Scan complete!

Please provide any additional information below.
Mediainfo output of one of the mp3s causing the crash:
General
Complete name                            : Entre.mp3
Format                                   : MPEG Audio
File size                                : 3.20 MiB
Duration                                 : 2mn 6s
Overall bit rate mode                    : Variable
Overall bit rate                         : 177 Kbps
Album                                    : A Trip To Bikini Island
Album/Performer                          : Tanja La Croix
Track name                               : Entreé
Track name/Position                      : 01
Performer                                : Tanja La Croix
Genre                                    : House
Recorded date                            : 2007
Cover                                    : Yes
Cover type                               : Cover (front)
Cover MIME                               : image/jpg
Comment                                  : bananastreet.ru

Audio
Format                                   : MPEG Audio
Format version                           : Version 1
Format profile                           : Layer 3
Mode                                     : Joint stereo
Duration                                 : 2mn 6s
Bit rate mode                            : Variable
Bit rate                                 : 177 Kbps
Channel(s)                               : 2 channels
Sampling rate                            : 44.1 KHz
Compression mode                         : Lossy
Stream size                              : 2.67 MiB (83%)

If I remove the jpeg embedded cover image from the mp3 file, the Library 
Scanner is able to scan it without crash!

I've many mp3 that cause the crash, all with embedded jpeg cover

I can provide to you a download link of one mp3 file so you can make a test by 
yourself, just ask!

I attach the JVM crash report -> file hs_err_pid7599.log

Original issue reported on code.google.com by plasma...@gmail.com on 11 Oct 2012 at 10:40

Attachments:

GoogleCodeExporter commented 8 years ago
I forgot one other test I've made:
64bit JDK6 - ums 1.6.0 -> Crash

The attached log is from this last test

Original comment by plasma...@gmail.com on 11 Oct 2012 at 10:42

GoogleCodeExporter commented 8 years ago
I can add another (I hope) useful information:
Extracting cover jpegs from mp3 files, I can see that mp3 that make JVM crash 
have a much bigger jpeg embedded, about 300-500 kb. Mp3s that can be parsed 
without crash have a smaller one, about 10-20 kb!

Original comment by plasma...@gmail.com on 11 Oct 2012 at 11:03

GoogleCodeExporter commented 8 years ago
Can you please upload a MP3 file that causes the crash so I can test?

Original comment by subjunk on 5 Nov 2012 at 5:58

GoogleCodeExporter commented 8 years ago
Yes! :-)

If I good remember you are on Windows, I hope this is not an issue that happen 
on linux only!

Original comment by plasma...@gmail.com on 5 Nov 2012 at 8:39

Attachments:

GoogleCodeExporter commented 8 years ago
I tested and it works OK for me.
I have updated a lot of database stuff today though so please try the following 
version and if it still crashes, post your debug.log too:
http://www.spirton.com/uploads/UMS/UMS-plasma977.tgz

Original comment by subjunk on 6 Nov 2012 at 8:06

GoogleCodeExporter commented 8 years ago
Well, tried, and still a crash, some info and logs:

JVM:
java version "1.7.0_07"
Java(TM) SE Runtime Environment (build 1.7.0_07-b10)
Java HotSpot(TM) Server VM (build 23.3-b01, mixed mode)

Standard Output:
INFO  2012-11-07 11:10:30.194 [Library Scanner] The file 
/home/plasma/mediafiles/gallerie/Geek/P-06:13:2008-00:07:40.jpg was badly 
parsed. It will be hidden
INFO  2012-11-07 11:31:37.908 [Library Scanner] Error generating thumbnail of 
image
javax.imageio.IIOException: Invalid JPEG file structure: two SOF markers
        at com.sun.imageio.plugins.jpeg.JPEGImageReader.readImage(Native Method) ~[na:1.7.0_07]
        at com.sun.imageio.plugins.jpeg.JPEGImageReader.readInternal(Unknown Source) ~[na:1.7.0_07]
        at com.sun.imageio.plugins.jpeg.JPEGImageReader.read(Unknown Source) ~[na:1.7.0_07]
        at javax.imageio.ImageReader.read(Unknown Source) ~[na:1.7.0_07]
        at net.coobird.thumbnailator.tasks.io.FileImageSource.read(Unknown Source) ~[ums.jar:na]
        at net.coobird.thumbnailator.tasks.SourceSinkThumbnailTask.read(Unknown Source) ~[ums.jar:na]
        at net.coobird.thumbnailator.Thumbnailator.createThumbnail(Unknown Source) ~[ums.jar:na]
        at net.coobird.thumbnailator.Thumbnails$Builder.toFile(Unknown Source) ~[ums.jar:na]
        at net.pms.dlna.DLNAMediaInfo.parse(DLNAMediaInfo.java:609) ~[ums.jar:na]
        at net.pms.configuration.FormatConfiguration.parse(FormatConfiguration.java:81) [ums.jar:na]
        at net.pms.formats.Format.parse(Format.java:218) [ums.jar:na]
        at net.pms.dlna.RealFile.resolve(RealFile.java:177) [ums.jar:na]
        at net.pms.dlna.DLNAResource.run(DLNAResource.java:804) [ums.jar:na]
        at net.pms.dlna.RealFile.isValid(RealFile.java:58) [ums.jar:na]
        at net.pms.dlna.DLNAResource.addChild(DLNAResource.java:461) [ums.jar:na]
        at net.pms.dlna.MapFile.manageFile(MapFile.java:143) [ums.jar:na]
        at net.pms.dlna.MapFile.analyzeChildren(MapFile.java:196) [ums.jar:na]
        at net.pms.dlna.RootFolder.scan(RootFolder.java:236) [ums.jar:na]
        at net.pms.dlna.RootFolder.scan(RootFolder.java:246) [ums.jar:na]
        at net.pms.dlna.RootFolder.scan(RootFolder.java:195) [ums.jar:na]
        at net.pms.dlna.DLNAMediaDatabase.run(DLNAMediaDatabase.java:729) [ums.jar:na]
        at java.lang.Thread.run(Unknown Source) [na:1.7.0_07]
INFO  2012-11-07 11:31:38.459 [Library Scanner] Error generating thumbnail of 
image
javax.imageio.IIOException: Invalid JPEG file structure: two SOF markers
        at com.sun.imageio.plugins.jpeg.JPEGImageReader.readImage(Native Method) ~[na:1.7.0_07]
        at com.sun.imageio.plugins.jpeg.JPEGImageReader.readInternal(Unknown Source) ~[na:1.7.0_07]
        at com.sun.imageio.plugins.jpeg.JPEGImageReader.read(Unknown Source) ~[na:1.7.0_07]
        at javax.imageio.ImageReader.read(Unknown Source) ~[na:1.7.0_07]
        at net.coobird.thumbnailator.tasks.io.FileImageSource.read(Unknown Source) ~[ums.jar:na]
        at net.coobird.thumbnailator.tasks.SourceSinkThumbnailTask.read(Unknown Source) ~[ums.jar:na]
        at net.coobird.thumbnailator.Thumbnailator.createThumbnail(Unknown Source) ~[ums.jar:na]
        at net.coobird.thumbnailator.Thumbnails$Builder.toFile(Unknown Source) ~[ums.jar:na]
        at net.pms.dlna.DLNAMediaInfo.parse(DLNAMediaInfo.java:609) [ums.jar:na]
        at net.pms.dlna.DLNAMediaInfo.generateThumbnail(DLNAMediaInfo.java:312) [ums.jar:na]
        at net.pms.dlna.DLNAResource.checkThumbnail(DLNAResource.java:1748) [ums.jar:na]
        at net.pms.dlna.RealFile.checkThumbnail(RealFile.java:268) [ums.jar:na]
        at net.pms.dlna.RealFile.isValid(RealFile.java:75) [ums.jar:na]
        at net.pms.dlna.DLNAResource.addChild(DLNAResource.java:461) [ums.jar:na]
        at net.pms.dlna.MapFile.manageFile(MapFile.java:143) [ums.jar:na]
        at net.pms.dlna.MapFile.analyzeChildren(MapFile.java:196) [ums.jar:na]
        at net.pms.dlna.RootFolder.scan(RootFolder.java:236) [ums.jar:na]
        at net.pms.dlna.RootFolder.scan(RootFolder.java:246) [ums.jar:na]
        at net.pms.dlna.RootFolder.scan(RootFolder.java:195) [ums.jar:na]
        at net.pms.dlna.DLNAMediaDatabase.run(DLNAMediaDatabase.java:729) [ums.jar:na]
        at java.lang.Thread.run(Unknown Source) [na:1.7.0_07]
An irrecoverable stack overflow has occurred.
#
# A fatal error has been detected by the Java Runtime Environment:
#
#  SIGSEGV (0xb) at pc=0x3705c7ae, pid=4577, tid=845122368
#
# JRE version: 7.0_07-b10
# Java VM: Java HotSpot(TM) Server VM (23.3-b01 mixed mode linux-x86 )
# Problematic frame:
# C  [jna6887335371587211492.tmp+0x57ae]  newJavaString+0x6e
#
# 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/plasma/ums-2.0.1/hs_err_pid4577.log
#
# If you would like to submit a bug report, please visit:
#   http://bugreport.sun.com/bugreport/crash.jsp
#
Aborted

I attach the last 100 lines of debug.log (the whole file is really big!) and 
virtual machine crash report!

Original comment by plasma...@gmail.com on 7 Nov 2012 at 11:12

Attachments:

GoogleCodeExporter commented 8 years ago
Maybe an important info:
Don't get confused about the "Invalid JPEG file structure" is not related to 
the file that cause the crash!
Enabling TRACE level in debug.log file, I can see that the JPEG error happen 
10-15 seconds before the crash.
last 4 line of debug.log with TRACE active after crash:
TRACE 2012-11-08 12:03:04.783 [Library Scanner] Matched format MP3 to 
"/home/plasma/mediafiles/incoming/London Sounds Exposed 100 (Two Year 
Anniversary Special) (1).mp3"
TRACE 2012-11-08 12:03:04.783 [Library Scanner] Adding London Sounds Exposed 
100 (Two Year Anniversary Special) (1).mp3 / class: net.pms.dlna.RealFile
TRACE 2012-11-08 12:03:04.783 [Library Scanner] Matched format MP3 to 
"/home/plasma/mediafiles/incoming/Skaven 252 - Hap Hazard - 06 Time's Up!.mp3"

Then the JVM crash...

Hope it helps!

Original comment by plasma...@gmail.com on 8 Nov 2012 at 1:28

GoogleCodeExporter commented 8 years ago
OK I have fixed more stuff now, let me know how this one goes :)
http://www.spirton.com/uploads/UMS/UMS-plasma977-2.tgz

Original comment by subjunk on 18 Nov 2012 at 10:40

GoogleCodeExporter commented 8 years ago
I'm closing this issue now because I assume it's fixed. It can be re-opened if 
not.

Original comment by subjunk on 20 Nov 2012 at 10:22

GoogleCodeExporter commented 8 years ago
Hi! sorry! I was really busy with work in these days!
I've tried now the UMS-plasma977-2.tgz package but no luck! still crash!
I've raised to TRACE all possible log level to have as much information as 
possible.. 
Now debug.log and standard output in console are identical:
***************************************************
TRACE 2012-11-20 23:41:56.063 [Library Scanner] Switching RSI LA 2 HD - 
Sportsera.ts-.ts to player tsMuxeR for transcoding
TRACE 2012-11-20 23:41:56.063 [Library Scanner] Duplicate RSI LA 2 HD - 
Sportsera.ts-.ts with player: tsMuxeR
TRACE 2012-11-20 23:41:56.064 [Library Scanner] Adding RSI LA 2 HD - 
Sportsera.ts-.ts / class: net.pms.dlna.FileTranscodeVirtualFolder
TRACE 2012-11-20 23:41:56.064 [Library Scanner] Could not match any format to 
"/home/plasma/download/shmat_ccs12.pdf"
TRACE 2012-11-20 23:41:56.065 [Library Scanner] Could not match any format to 
"/home/plasma/download/shmat_ccs12.pdf"
TRACE 2012-11-20 23:41:56.065 [Library Scanner] Matched format MP3 to 
"/home/plasma/download/Skaven 252 - Hap Hazard - 07 Loader.mp3"
An irrecoverable stack overflow has occurred.
#
# A fatal error has been detected by the Java Runtime Environment:
#
#  SIGSEGV (0xb) at pc=0x00007fca38356bd6, pid=20528, tid=140505904690944
#
# JRE version: 6.0_37-b06
# Java VM: Java HotSpot(TM) 64-Bit Server VM (20.12-b01 mixed mode linux-amd64 
compressed oops)
# Problematic frame:
# C  [jna5971648025566251438.tmp+0x6bd6]  __int128+0x1b6
#
# An error report file with more information is saved as:
# /mnt/data/apps/ums-2.0.1/hs_err_pid20528.log
#
# If you would like to submit a bug report, please visit:
#   http://java.sun.com/webapps/bugreport/crash.jsp
# The crash happened outside the Java Virtual Machine in native code.
# See problematic frame for where to report the bug.
#
Aborted

I've tried also with ICEd Tea open source Virtual machine, same error, same 
crash report!

Java crash report attached

I would like to help you much more providing you more information, but I don't 
know how to get more info from the JVM!

Original comment by plasma...@gmail.com on 20 Nov 2012 at 11:28

Attachments:

GoogleCodeExporter commented 8 years ago
hey, solved!
the problem is caused by the startup script (UMS.sh) provided with the package! 
The startup script has the java option -Xss set to 1024k and this is not enough 
for the library native thread scanner when he must scan the problematic MP3 
files (with big Cover jpeg). I've raised this parameter to 2048k and now the 
library scanner thread complete all the scanning without crashes! :-)
Please change this parameter in linux package distribution!

here I've found the info to understand the problem:
http://stackoverflow.com/questions/4967885/jvm-option-xss-what-does-it-do-exactl
y

Original comment by plasma...@gmail.com on 20 Nov 2012 at 11:41

GoogleCodeExporter commented 8 years ago
Cool, thanks! The fix will be in the next version

Original comment by subjunk on 20 Nov 2012 at 11:49