VLCJ crash with some audio formats.

This forum is about all development around libVLC.
computermike
New Cone
New Cone
Posts: 3
Joined: 13 Mar 2012 18:51

VLCJ crash with some audio formats.

Postby computermike » 14 Mar 2012 12:11

Hi, I am trying to use vlcj to replace java sound (and then introducing video) in an opensource project, running on Windows I have no problems at all. On Ubuntu however I have some weird behaviour which I have been trying to solve for several days. It is Ubuntu 11.10 running on a (32 bit) Samsung R730 laptop with dual-core pentium. The behaviour is exhibited using the vlcj test jar so it is not my java code.

I have three audio files, same music but in different formats: wav, flac and mp3. Normal VLC identifies itself as "VLC media player 2.1.0-git Rincewind", and comes from the overnight build repository, though I have removed and reinstalled a couple of times to check. This plays all three files all the way through without problem. When I run the vlcj test using the command

Code: Select all

$> LD_LIBRARY_PATH=/usr/lib/jvm/jdk1.7.0/jre/lib/i386:/usr/lib java -Dvlcj.log=DEBUG -Xms256M -Xmx768M -jar vlcj-1.2.2-test.jar
then the flac file plays OK, but both the wav and the mp3 cause a crash, e.g.


vlcj: (TestPlayer.java:428) | DEBUG | mediaDurationChanged(mediaPlayer=uk.co.caprica.vlcj.player.embedded.DefaultEmbeddedMediaPlayer@471b7f,newDuration=206054)
#
# A fatal error has been detected by the Java Runtime Environment:
#
# SIGSEGV (0xb) at pc=0xb76bc0c9, pid=6286, tid=2081844080
#
# JRE version: 7.0-b147
# Java VM: Java HotSpot(TM) Server VM (21.0-b17 mixed mode linux-x86 )
# Problematic frame:
# C [libc.so.6+0x1110c9] _IO_file_close_it+0x59
#
# 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:
# /host/mike/openJEANSource/systemlib/hs_err_pid6286.log
#
# If you would like to submit a bug report, please visit:
# http://bugreport.sun.com/bugreport/crash.jsp
#
Aborted


The log files show nothing I can see as useful. In my code I have tried all the media options for creating a MediaPlayer that I have seen without change. I am running out of ideas! I thought that as vlcj was just a wrapper then if vlc played it so would vlcj, but that is not the case here. Is vlcj managing to pick up different libraries somehow?

I can see that it is crashing within the native libraries, not in Java. The line

Code: Select all

# Problematic frame: # C [libc.so.6+0x1110c9] _IO_file_close_it+0x59
seems to imply that it is in a file close operation, but apart from that I cannot see what file or when, let alone how to prevent or catch it. I would have thought playing a wav or mp3 on a popular distro like Ubuntu 11.10 would be straightforward.

Please help if you can!

regards
Mike

sherington
Cone that earned his stripes
Cone that earned his stripes
Posts: 491
Joined: 10 Sep 2008 11:57
VLC version: master
Operating System: Linux

Re: VLCJ crash with some audio formats.

Postby sherington » 14 Mar 2012 13:26

You need a full native stack trace if you have any hope of someone helping you.

computermike
New Cone
New Cone
Posts: 3
Joined: 13 Mar 2012 18:51

Re: VLCJ crash with some audio formats.

Postby computermike » 14 Mar 2012 13:37

How can I get one?

Mike

Rémi Denis-Courmont
Developer
Developer
Posts: 14998
Joined: 07 Jun 2004 16:01
VLC version: master
Operating System: Linux
Contact:

Re: VLCJ crash with some audio formats.

Postby Rémi Denis-Courmont » 14 Mar 2012 15:18

This is probably the dread _IO_stdin_used missing symbol bug, e.g.: https://bugs.launchpad.net/ubuntu/+sour ... bug/810214
Your main executable (probably the Java VM in this case) is not linked correctly against GNU/libc. Obviously, neither vlcj nor libvlc can fix this.

Checking is easy. For instance, VLC does not suffer from this bug:

Code: Select all

# readelf -a /usr/bin/vlc | grep _IO_stdin_used 40: 08049ca4 4 OBJECT GLOBAL DEFAULT 16 _IO_stdin_used
But if there is no response from that command, then the bug is present.
Rémi Denis-Courmont
https://www.remlab.net/
Private messages soliciting support will be systematically discarded

sherington
Cone that earned his stripes
Cone that earned his stripes
Posts: 491
Joined: 10 Sep 2008 11:57
VLC version: master
Operating System: Linux

Re: VLCJ crash with some audio formats.

Postby sherington » 14 Mar 2012 17:23

For what it's worth, mp3 has always worked for me just fine with libvlc/vlcj...

Following Rémi's tip:

$readelf -a /home/java/jdk1.7.0_02/bin/java | grep _IO_stdin_used
56: 00000000004007b8 4 OBJECT GLOBAL DEFAULT 17 _IO_stdin_used

I use a 64bit JDK on Ubuntu 11.10, with vlc 2.0 (I build this myself from git), and it works very nicely.

Maybe you're using OpenJDK, if so I'd recommend you switch to an Oracle JDK.

computermike
New Cone
New Cone
Posts: 3
Joined: 13 Mar 2012 18:51

Re: VLCJ crash with some audio formats.

Postby computermike » 14 Mar 2012 17:52

Alas, it is the Oracle JVM and


$ readelf -a /usr/lib/jvm/jdk1.7.0/bin/java | grep _IO_stdin_used
15: 0804868c 4 OBJECT LOCAL DEFAULT 17 _IO_stdin_used

I will try with the OpenJDK and see if that makes a difference though.
After that I suppose I had better try and build my own vlc.

Thanks
Mike


Return to “Development around libVLC”

Who is online

Users browsing this forum: No registered users and 5 guests