[vlc-devel] problem using minwg32 to cross-compile libvlc.dll for use with java bindings

Michael Pujos pujos at audemat-aztec.com
Wed May 17 14:12:53 CEST 2006


Hi

I'm trying to compile java libvlc bindings using mingw32 as a cross 
compiler for linux.
The version is SVN vlc from a few days ago.

I successfully compiled libvlc.dll using :

./bootstrap && \
  PKG_CONFIG_LIBDIR=/usr/win32/lib/pkgconfig \
  CPPFLAGS="-I/usr/win32/include -I/usr/win32/include/ebml" \
  LDFLAGS=-L/usr/win32/lib \
  CC=i586-mingw32msvc-gcc CXX=i586-mingw32msvc-g++ \
  ./configure --host=i586-mingw32msvc --build=i386-linux \
      --disable-gtk --disable-wxwidgets --disable-qt --disable-kde\
      --enable-nls --enable-sdl --with-sdl-config-path=/usr/win32/bin \
      --enable-ffmpeg --with-ffmpeg-mp3lame --with-ffmpeg-faac \
      --with-ffmpeg-zlib --enable-faad --disable-mkv \
      --enable-livedotcom --with-livedotcom-tree=/usr/win32/live.com \
      --with-xml2-config-path=/usr/win32/bin \
      --disable-cddax --disable-vcdx --disable-goom \
      --enable-twolame --enable-shared-libvlc --disable-activex 
--enable-mozilla

Then, after some Makefile.am editing in bindings/java I was able to 
build libjvlc.dll statically linked with
libvlc.dll.a. For the windows JVM to see the symbols in the generated 
DLL I had to use the -Wl,-add-stdcall-alias linker option
but when I launch the java app enbedding the JVLC component I have a 
crash in createInstance() (full log below).

So there is a problem with the mingw32 generated DLL which does not 
please the JVM DLL loader. In the instructions to build
the java bindings it is said to generate pic libraries. Should I do that 
for the java  windows bindings and if so how ?

If nothing works I'm considering using the libvlc.dll from the win32 vlc 
binaries and compile only the JNI bindings.

#
# An unexpected error has been detected by HotSpot Virtual Machine:
#
#  EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x0b58b91f, pid=2272, tid=3624
#
# Java VM: Java HotSpot(TM) Client VM (1.5.0_06-b05 mixed mode)
# Problematic frame:
# C  [libjvlc.dll+0x2b91f]
#

---------------  T H R E A D  ---------------

Current thread (0x0aceaba8):  JavaThread "AWT-EventQueue-0" [_thread_in_native, id=3624]

siginfo: ExceptionCode=0xc0000005, reading address 0x00000000

Registers:
EAX=0x00000000, EBX=0x0b0c99a0, ECX=0x0b43f2e8, EDX=0x0b43f494
ESP=0x0b43f070, EBP=0xffffff01, ESI=0x00000000, EDI=0x00000000
EIP=0x0b58b91f, EFLAGS=0x00210202

Top of Stack: (sp=0x0b43f070)
0x0b43f070:   7c923281 7c923288 00000000 00000000
0x0b43f080:   00000000 0b43f32c 0b43f078 7c9263a8
0x0b43f090:   0b43f0c4 00350000 7c920732 00000002
0x0b43f0a0:   003506e8 00350000 00000000 0b43f09c
0x0b43f0b0:   7c926315 0b43f2e0 7c91ee18 7c920738
0x0b43f0c0:   ffffffff 00000fa0 7c921596 0b43f100
0x0b43f0d0:   00350000 7c920732 00000002 003506e8
0x0b43f0e0:   00350000 00000000 0b43f0d8 00000000 

Instructions: (pc=0x0b58b91f)
0x0b58b90f:   90 56 53 81 ec c4 02 00 00 8b 84 24 d8 02 00 00
0x0b58b91f:   8b 10 85 d2 0f 84 1a 01 00 00 89 14 24 8d 5c 24 


Stack: [0x0b400000,0x0b440000),  sp=0x0b43f070,  free space=252k
Native frames: (J=compiled Java code, j=interpreted, Vv=VM code, C=native code)
C  [libjvlc.dll+0x2b91f]

[error occurred during error reporting, step 120, id 0xc0000005]

Java frames: (J=compiled Java code, j=interpreted, Vv=VM code)
j  org.videolan.jvlc.JVLC.createInstance()J+0
j  org.videolan.jvlc.JVLC.<init>()V+6
j  org.videolan.jvlc.JVLCCanvas.<init>(II)V+9
j  org.videolan.jvlc.JVLCPanel.<init>(II)V+11
j  subPanels.realtime.streaming.RealtimeStreamingPage.<init>(Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;LmainWindow/AppContext;)V+219
j  subPanels.realtime.RealtimeSubPanel.<init>(LmainWindow/AppContext;)V+58
j  mainWindow.MainContentPanel.switchPanel(I)V+249
j  mainWindow.ToolBar.actionPerformed(Ljava/awt/event/ActionEvent;)V+70
j  javax.swing.AbstractButton.fireActionPerformed(Ljava/awt/event/ActionEvent;)V+84
j  javax.swing.AbstractButton$Handler.actionPerformed(Ljava/awt/event/ActionEvent;)V+5
j  javax.swing.DefaultButtonModel.fireActionPerformed(Ljava/awt/event/ActionEvent;)V+35
j  javax.swing.JToggleButton$ToggleButtonModel.setPressed(Z)V+148
j  javax.swing.plaf.basic.BasicButtonListener.mouseReleased(Ljava/awt/event/MouseEvent;)V+35
j  java.awt.AWTEventMulticaster.mouseReleased(Ljava/awt/event/MouseEvent;)V+8
j  java.awt.Component.processMouseEvent(Ljava/awt/event/MouseEvent;)V+64
j  javax.swing.JComponent.processMouseEvent(Ljava/awt/event/MouseEvent;)V+23
j  java.awt.Component.processEvent(Ljava/awt/AWTEvent;)V+81
j  java.awt.Container.processEvent(Ljava/awt/AWTEvent;)V+18
j  java.awt.Component.dispatchEventImpl(Ljava/awt/AWTEvent;)V+477
j  java.awt.Container.dispatchEventImpl(Ljava/awt/AWTEvent;)V+42
j  java.awt.Component.dispatchEvent(Ljava/awt/AWTEvent;)V+2
j  java.awt.LightweightDispatcher.retargetMouseEvent(Ljava/awt/Component;ILjava/awt/event/MouseEvent;)V+304
j  java.awt.LightweightDispatcher.processMouseEvent(Ljava/awt/event/MouseEvent;)Z+139
j  java.awt.LightweightDispatcher.dispatchEvent(Ljava/awt/AWTEvent;)Z+50
j  java.awt.Container.dispatchEventImpl(Ljava/awt/AWTEvent;)V+12
j  java.awt.Window.dispatchEventImpl(Ljava/awt/AWTEvent;)V+19
j  java.awt.Component.dispatchEvent(Ljava/awt/AWTEvent;)V+2
j  java.awt.EventQueue.dispatchEvent(Ljava/awt/AWTEvent;)V+46
j  java.awt.EventDispatchThread.pumpOneEventForHierarchy(ILjava/awt/Component;)Z+233
j  java.awt.EventDispatchThread.pumpEventsForHierarchy(ILjava/awt/Conditional;Ljava/awt/Component;)V+26
j  java.awt.EventDispatchThread.pumpEvents(ILjava/awt/Conditional;)V+4
j  java.awt.EventDispatchThread.pumpEvents(Ljava/awt/Conditional;)V+3
j  java.awt.EventDispatchThread.run()V+9
v  ~StubRoutines::call_stub

---------------  P R O C E S S  ---------------

Java Threads: ( => current thread )
  0x003567b8 JavaThread "DestroyJavaVM" [_thread_blocked, id=3080]
  0x0ad32dc8 JavaThread "Thread-3" daemon [_thread_in_native, id=3804]
  0x0ae1d9b0 JavaThread "TimerQueue" daemon [_thread_blocked, id=400]
=>0x0aceaba8 JavaThread "AWT-EventQueue-0" [_thread_in_native, id=3624]
  0x0acdde70 JavaThread "Image Fetcher 3" daemon [_thread_blocked, id=3400]
  0x0acc1c18 JavaThread "Java2D Disposer" daemon [_thread_blocked, id=2020]
  0x0acb92b8 JavaThread "AWT-Windows" daemon [_thread_in_native, id=3072]
  0x0acb8dc8 JavaThread "AWT-Shutdown" [_thread_blocked, id=1548]
  0x00a2c6a8 JavaThread "Low Memory Detector" daemon [_thread_blocked, id=1436]
  0x00a2b3a0 JavaThread "CompilerThread0" daemon [_thread_blocked, id=2232]
  0x00a2a5f0 JavaThread "Signal Dispatcher" daemon [_thread_blocked, id=1928]
  0x00a216a0 JavaThread "Finalizer" daemon [_thread_blocked, id=1040]
  0x00a20208 JavaThread "Reference Handler" daemon [_thread_blocked, id=3052]

Other Threads:
  0x00a1c068 VMThread [id=3560]
  0x00a2d9b8 WatcherThread [id=4060]

VM state:not at safepoint (normal execution)

VM Mutex/Monitor currently owned by a thread: None

Heap
 def new generation   total 576K, used 527K [0x02a70000, 0x02b10000, 0x02f50000)
  eden space 512K,  90% used [0x02a70000, 0x02ae3ed0, 0x02af0000)
  from space 64K, 100% used [0x02af0000, 0x02b00000, 0x02b00000)
  to   space 64K,   0% used [0x02b00000, 0x02b00000, 0x02b10000)
 tenured generation   total 3952K, used 2489K [0x02f50000, 0x0332c000, 0x06a70000)
   the space 3952K,  62% used [0x02f50000, 0x031be6f0, 0x031be800, 0x0332c000)
 compacting perm gen  total 10496K, used 10460K [0x06a70000, 0x074b0000, 0x0aa70000)
   the space 10496K,  99% used [0x06a70000, 0x074a70f0, 0x074a7200, 0x074b0000)
No shared spaces configured.

Dynamic libraries:
0x00400000 - 0x0040c000 	C:\Program Files\Java\jre1.5.0_06\bin\javaw.exe
0x7c910000 - 0x7c9c7000 	C:\WINDOWS\system32\ntdll.dll
0x7c800000 - 0x7c904000 	C:\WINDOWS\system32\kernel32.dll
0x77da0000 - 0x77e4c000 	C:\WINDOWS\system32\ADVAPI32.dll
0x77e50000 - 0x77ee1000 	C:\WINDOWS\system32\RPCRT4.dll
0x77d10000 - 0x77da0000 	C:\WINDOWS\system32\USER32.dll
0x77ef0000 - 0x77f37000 	C:\WINDOWS\system32\GDI32.dll
0x77be0000 - 0x77c38000 	C:\WINDOWS\system32\MSVCRT.dll
0x6d670000 - 0x6d804000 	C:\Program Files\Java\jre1.5.0_06\bin\client\jvm.dll
0x76ae0000 - 0x76b0f000 	C:\WINDOWS\system32\WINMM.dll
0x6d280000 - 0x6d288000 	C:\Program Files\Java\jre1.5.0_06\bin\hpi.dll
0x76ba0000 - 0x76bab000 	C:\WINDOWS\system32\PSAPI.DLL
0x6d640000 - 0x6d64c000 	C:\Program Files\Java\jre1.5.0_06\bin\verify.dll
0x6d300000 - 0x6d31d000 	C:\Program Files\Java\jre1.5.0_06\bin\java.dll
0x6d660000 - 0x6d66f000 	C:\Program Files\Java\jre1.5.0_06\bin\zip.dll
0x6d000000 - 0x6d167000 	C:\Program Files\Java\jre1.5.0_06\bin\awt.dll
0x72f50000 - 0x72f76000 	C:\WINDOWS\system32\WINSPOOL.DRV
0x76320000 - 0x7633d000 	C:\WINDOWS\system32\IMM32.dll
0x774a0000 - 0x775dd000 	C:\WINDOWS\system32\ole32.dll
0x5b090000 - 0x5b0c8000 	C:\WINDOWS\system32\uxtheme.dll
0x736b0000 - 0x736f9000 	C:\WINDOWS\system32\ddraw.dll
0x73b10000 - 0x73b16000 	C:\WINDOWS\system32\DCIMAN32.dll
0x73890000 - 0x73960000 	C:\WINDOWS\system32\D3DIM700.DLL
0x7c9d0000 - 0x7d1f3000 	C:\WINDOWS\system32\shell32.dll
0x77f40000 - 0x77fb6000 	C:\WINDOWS\system32\SHLWAPI.dll
0x77390000 - 0x77492000 	C:\WINDOWS\WinSxS\x86_Microsoft.Windows.Common-Controls_6595b64144ccf1df_6.0.2600.2180_x-ww_a84f1ff9\comctl32.dll
0x58b50000 - 0x58be7000 	C:\WINDOWS\system32\comctl32.dll
0x6d240000 - 0x6d27d000 	C:\Program Files\Java\jre1.5.0_06\bin\fontmanager.dll
0x6d4c0000 - 0x6d4d3000 	C:\Program Files\Java\jre1.5.0_06\bin\net.dll
0x719f0000 - 0x71a07000 	C:\WINDOWS\system32\WS2_32.dll
0x719e0000 - 0x719e8000 	C:\WINDOWS\system32\WS2HELP.dll
0x6d4e0000 - 0x6d4e9000 	C:\Program Files\Java\jre1.5.0_06\bin\nio.dll
0x76d10000 - 0x76d29000 	C:\WINDOWS\system32\iphlpapi.dll
0x71990000 - 0x719d0000 	C:\WINDOWS\system32\mswsock.dll
0x62e40000 - 0x62e99000 	C:\WINDOWS\system32\hnetcfg.dll
0x719d0000 - 0x719d8000 	C:\WINDOWS\System32\wshtcpip.dll
0x0b560000 - 0x0b731000 	F:\Mathieu\WorkSpace\easyDVB\libjvlc.dll
0x6d360000 - 0x6d366000 	C:\Program Files\Java\jre1.5.0_06\bin\jawt.dll

VM Arguments:
java_command: mainWindow.easyDVB
Launcher Type: SUN_STANDARD

Environment Variables:
PATH=C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;c:\cygwin\bin;C:\Program Files\Bitvise Tunnelier
USERNAME=MD
OS=Windows_NT
PROCESSOR_IDENTIFIER=x86 Family 15 Model 4 Stepping 3, GenuineIntel



---------------  S Y S T E M  ---------------

OS: Windows XP Build 2600 Service Pack 2

CPU:total 2 family 15, cmov, cx8, fxsr, mmx, sse, sse2, ht

Memory: 4k page, physical 1038404k(70388k free), swap 2496964k(1550300k free)

vm_info: Java HotSpot(TM) Client VM (1.5.0_06-b05) for windows-x86, built on Nov 10 2005 11:12:14 by "java_re" with MS VC++ 6.0


-- 
This is the vlc-devel mailing-list, see http://www.videolan.org/vlc/
To unsubscribe, please read http://developers.videolan.org/lists.html



More information about the vlc-devel mailing list