Quantcast

Swig : JNI diffs between Win XP and 2K ???

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Swig : JNI diffs between Win XP and 2K ???

Dominic Coman
Hi,

I am not a Swig pro, just used it one year ago to make my life easier
with the JNI. Built a dll on Windows 2000, deployed on a production
Windows 2000 server to the client and it runs fine. The app is a java
application relying heavily on a C++ module. All the C++ calls from
Java pass via the Swig mapping. Now, the funny part : when I try to
execute the app on XP, it crashes with an EXCEPTION_ACCESS_VIOLATION
(see the copy below, my dll is called displanisSW.dll). There is no
specific XP call in my app, no MFC; the dll is built with Visual
Studio.

I just don't have any idea where to ask, where to begin my search.
Could someone give me an advice? Thanks a lot.

#
# An unexpected error has been detected by HotSpot Virtual Machine:
#
#  EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x7c921c20, pid=716, tid=2120
#
# Java VM: Java HotSpot(TM) Server VM (1.5.0_04-b05 mixed mode)
# Problematic frame:
# C  [ntdll.dll+0x11c20]
#

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

Current thread (0x00ac4188):  JavaThread "CompilerThread0" daemon
[_thread_in_native, id=2120]

siginfo: ExceptionCode=0xc0000005, writing address 0x00000038

Registers:
EAX=0x00000000, EBX=0x0000ac00, ECX=0x00000009, EDX=0x00000170
ESP=0x16ccf078, EBP=0x16ccf08c, ESI=0x17a15000, EDI=0x00030000
EIP=0x7c921c20, EFLAGS=0x00010283

Top of Stack: (sp=0x16ccf078)
0x16ccf078:   00030000 17a15000 00030006 00000000
0x16ccf088:   16ccf0b4 16ccf0c0 7c92825d 0000ac00
0x16ccf098:   10a15000 00000000 0000ab80 00000000
0x16ccf0a8:   00030000 00030106 000257f8 0000ac00
0x16ccf0b8:   177d0000 00000000 16ccf2f0 7c921c76
0x16ccf0c8:   04030000 00055c00 00055bf8 00055bf8
0x16ccf0d8:   17861008 00030000 00004002 1795e000
0x16ccf0e8:   16ccf318 7c922270 7c921596 7c9206eb

Instructions: (pc=0x7c921c20)
0x7c921c10:   07 40 0f 83 e5 c2 00 00 0f b6 46 07 8b 44 87 58
0x7c921c20:   89 70 38 8b 45 f8 8d 34 de 3b 70 24 73 13 83 7d


Stack: [0x16c90000,0x16cd0000),  sp=0x16ccf078,  free space=252k
Native frames: (J=compiled Java code, j=interpreted, Vv=VM code, C=native code)
C  [ntdll.dll+0x11c20]
C  [ntdll.dll+0x1825d]
C  [ntdll.dll+0x11c76]
C  [MSVCRT.dll+0x1c3c9]
C  [MSVCRT.dll+0x1c3e7]
C  [MSVCRT.dll+0x1c42e]


Current CompileTask:
opto: 96      com.displanis.shared.ser.BLTask.toString()Ljava/lang/String;
(542 bytes)


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

Java Threads: ( => current thread )
 0x16e71008 JavaThread "RMI
ConnectionExpiration-[192.168.1.115:2698]" daemon [_thread_blocked,
id=3808]
 0x17456280 JavaThread "RMI RenewClean-[192.168.1.115:2698]" daemon
[_thread_blocked, id=2696]
 0x173ccc38 JavaThread "RMI ConnectionExpiration-[dcxp2:1099]" daemon
[_thread_blocked, id=1380]
 0x16f1fcc0 JavaThread "RMI TCP Connection(2)-192.168.1.115" daemon
[_thread_in_Java, id=3960]
 0x1741a8e8 JavaThread "Thread-2" daemon [_thread_blocked, id=2904]
 0x0003cf20 JavaThread "DestroyJavaVM" [_thread_blocked, id=708]
 0x16f15988 JavaThread "RMI LeaseChecker" daemon [_thread_blocked, id=3516]
 0x16f12a68 JavaThread "RMI TCP Connection(1)-192.168.1.115" daemon
[_thread_in_native, id=1212]
 0x16df1ae8 JavaThread "RMI Reaper" [_thread_blocked, id=1656]
 0x16df1400 JavaThread "Timer-0" daemon [_thread_blocked, id=3388]
 0x16df11a8 JavaThread "RMI TCP Accept-0" daemon [_thread_in_native, id=180]
 0x16ede3d0 JavaThread "RMI
ConnectionExpiration-[192.168.1.115:1098]" daemon [_thread_blocked,
id=452]
 0x16e978c0 JavaThread "GC Daemon" daemon [_thread_blocked, id=3292]
 0x16e975e8 JavaThread "RMI RenewClean-[192.168.1.115:1098]" daemon
[_thread_blocked, id=1252]
 0x00ac62e0 JavaThread "Low Memory Detector" daemon [_thread_blocked, id=3280]
 0x00ac4fe8 JavaThread "CompilerThread1" daemon [_thread_blocked, id=3848]
=>0x00ac4188 JavaThread "CompilerThread0" daemon [_thread_in_native, id=2120]
 0x00036f80 JavaThread "AdapterThread" daemon [_thread_blocked, id=2772]
 0x00ac26f8 JavaThread "Signal Dispatcher" daemon [_thread_blocked, id=3340]
 0x00ab9dd8 JavaThread "Finalizer" daemon [_thread_blocked, id=1248]
 0x00ab9148 JavaThread "Reference Handler" daemon [_thread_blocked, id=2504]

Other Threads:
 0x00ab7008 VMThread [id=2852]
 0x00ac74b8 WatcherThread [id=1728]

VM state:not at safepoint (normal execution)

VM Mutex/Monitor currently owned by a thread: None

Heap
 def new generation   total 6592K, used 4781K [0x02ad0000, 0x031f0000,
0x04740000)
 eden space 5888K,  69% used [0x02ad0000, 0x02ecb720, 0x03090000)
 from space 704K, 100% used [0x03090000, 0x03140000, 0x03140000)
 to   space 704K,   0% used [0x03140000, 0x03140000, 0x031f0000)
 tenured generation   total 58304K, used 1825K [0x04740000,
0x08030000, 0x12ad0000)
  the space 58304K,   3% used [0x04740000, 0x04908720, 0x04908800, 0x08030000)
 compacting perm gen  total 16384K, used 8849K [0x12ad0000,
0x13ad0000, 0x16ad0000)
  the space 16384K,  54% used [0x12ad0000, 0x13374768, 0x13374800, 0x13ad0000)
No shared spaces configured.

Dynamic libraries:
0x00400000 - 0x0040c000         C:\Progs\Java\jre\bin\java.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
0x77be0000 - 0x77c38000         C:\WINDOWS\system32\MSVCRT.dll
0x6d840000 - 0x6dbcf000         C:\Progs\Java\jre\bin\server\jvm.dll
0x77d10000 - 0x77da0000         C:\WINDOWS\system32\USER32.dll
0x77ef0000 - 0x77f36000         C:\WINDOWS\system32\GDI32.dll
0x76ae0000 - 0x76b0f000         C:\WINDOWS\system32\WINMM.dll
0x6d2f0000 - 0x6d2f8000         C:\Progs\Java\jre\bin\hpi.dll
0x76ba0000 - 0x76bab000         C:\WINDOWS\system32\PSAPI.DLL
0x6d680000 - 0x6d68c000         C:\Progs\Java\jre\bin\verify.dll
0x6d370000 - 0x6d38d000         C:\Progs\Java\jre\bin\java.dll
0x6d6a0000 - 0x6d6af000         C:\Progs\Java\jre\bin\zip.dll
0x6d660000 - 0x6d666000         C:\Progs\Java\jre\bin\rmi.dll
0x6d530000 - 0x6d543000         C:\Progs\Java\jre\bin\net.dll
0x719f0000 - 0x71a07000         C:\WINDOWS\system32\WS2_32.dll
0x719e0000 - 0x719e8000         C:\WINDOWS\system32\WS2HELP.dll
0x71990000 - 0x719d0000         C:\WINDOWS\System32\mswsock.dll
0x76ed0000 - 0x76ef7000         C:\WINDOWS\system32\DNSAPI.dll
0x76f60000 - 0x76f68000         C:\WINDOWS\System32\winrnr.dll
0x76f10000 - 0x76f3d000         C:\WINDOWS\system32\WLDAP32.dll
0x76f70000 - 0x76f76000         C:\WINDOWS\system32\rasadhlp.dll
0x16f90000 - 0x16fb8000         C:\WINDOWS\system32\rsaenh.dll
0x76960000 - 0x76a15000         C:\WINDOWS\system32\USERENV.dll
0x6fee0000 - 0x6ff34000         C:\WINDOWS\system32\netapi32.dll
0x20b00000 - 0x20b45000         C:\WINDOWS\system32\imon.dll
0x71a10000 - 0x71a1a000         C:\WINDOWS\system32\WSOCK32.dll
0x77650000 - 0x77671000         C:\WINDOWS\system32\NTMARTA.DLL
0x774a0000 - 0x775dd000         C:\WINDOWS\system32\ole32.dll
0x71b50000 - 0x71b63000         C:\WINDOWS\system32\SAMLIB.dll
0x62e40000 - 0x62e99000         C:\WINDOWS\system32\hnetcfg.dll
0x719d0000 - 0x719d8000         C:\WINDOWS\System32\wshtcpip.dll
0x6d070000 - 0x6d1d7000         C:\Progs\Java\jre\bin\awt.dll
0x72f50000 - 0x72f76000         C:\WINDOWS\system32\WINSPOOL.DRV
0x76320000 - 0x7633d000         C:\WINDOWS\system32\IMM32.dll
0x190f0000 - 0x19336000         C:\Progs\Displanis\dll\DisplanisSW.dll
0x76010000 - 0x76075000         C:\WINDOWS\system32\MSVCP60.dll

VM Arguments:
jvm_args: -DuseLoca=false -Djava.runtime.name=Java(TM) 2 Runtime
Environment, Standard Edition
-Dsun.boot.library.path=C:\Progs\Java\jre\bin
-Djava.vm.version=1.5.0_04-b05 -Djava.vendor.url=http://java.sun.com/
-Djava.vm.vendor=Sun Microsystems Inc. -Dpath.separator=;
-Djava.vm.name=Java HotSpot(TM) Client VM -Dfile.encoding.pkg=sun.io
-Duser.country=FR -Dsun.os.patch.level=Service Pack 2
-Djava.vm.specification.name=Java Virtual Machine Specification
-Duser.dir=C:\Progs\Displanis -Djava.runtime.version=1.5.0_04-b05
-Djava.awt.graphicsenv=sun.awt.Win32GraphicsEnvironment
-Djava.endorsed.dirs=C:\Progs\Java\jre\lib\endorsed -Dos.arch=x86
-Djava.io.tmpdir=C:\DOCUME~1\Dominic\LOCALS~1\Temp\ -Dline.separator=
 -Djava.vm.specification.vendor=Sun Microsystems Inc. -Duser.variant=
-Dos.name=Windows XP -Dsun.jnu.encoding=Cp1252
-Ddisplanis.command=start -Ddisplanis.demo=false
-Djava.library.path=C:\Progs\Java\bin;.;C:\WINDOWS\system32;C:\WINDOWS;C:\Progs\Java\bin;.\dll
-Djava.class.version=49.0 -Djava.specification.name=Java Platform API
Specification -DwithStats=true -Dsun.management.compiler=HotSpot
Client Compiler -Dos.version=5.1 -Duser.home=C:\Documents and
Settings\Dominic -Duser.timezone=Europe/Paris
-Djava.security.policy=java.policy
-Djava.awt.printerjob=sun.awt.windows.WPrinterJob
-Dfile.encoding=Cp1252 -Djava.specification.version=1.5
-Duser.name=Dominic -Ddisplanis.AdxService=false
-Djava.vm.specification.version=1.0 -Dsun.arch.data.model=32
-Djava.home=C:\Progs\Java\jre -Duser.language=fr
-Djava.specification.vendor=Sun Microsystems Inc.
-Dawt.toolkit=sun.awt.windows.WToolkit -Djava.vm.info=mixed mode
-Ddisplanis.adminMode=false -Djava.version=1.5.0_04
-Djava.ext.dirs=C:\Progs\Java\jre\lib\ext
-Dsun.boot.class.path=C:\Progs\Java\jre\lib\rt.jar;C:\Progs\Java\jre\lib\i18n.jar;C:\Progs\Java\jre\lib\sunrsasign.jar;C:\Progs\Java\jre\lib\jsse.jar;C:\Progs\Java\jre\lib\jce.jar;C:\Progs\Java\jre\lib\charsets.jar;C:\Progs\Java\jre\classes
-Ddisplanis.horizonLength=60
java_command: sun.rmi.server.ActivationGroupInit

Environment Variables:
JAVA_HOME=C:\Progs\Java
PATH=C:\Progs\Java\bin;.\dll
USERNAME=Dominic
OS=Windows_NT
PROCESSOR_IDENTIFIER=x86 Family 15 Model 3 Stepping 4, GenuineIntel



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

OS: Windows XP Build 2600 Service Pack 2

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

Memory: 4k page, physical 720368k(206244k free), swap 1763188k(1110116k free)

vm_info: Java HotSpot(TM) Server VM (1.5.0_04-b05) for windows-x86,
built on Jun  3 2005 01:53:13 by "java_re" with MS VC++ 6.0


-------------------------------------------------------
SF.Net email is sponsored by:
Tame your development challenges with Apache's Geronimo App Server. Download
it for free - -and be entered to win a 42" plasma tv or your very own
Sony(tm)PSP.  Click here to play: http://sourceforge.net/geronimo.php
_______________________________________________
Swig-user mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/swig-user
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Swig : JNI diffs between Win XP and 2K ???

William S Fulton
Dominic Coman wrote:

> Hi,
>
> I am not a Swig pro, just used it one year ago to make my life easier
> with the JNI. Built a dll on Windows 2000, deployed on a production
> Windows 2000 server to the client and it runs fine. The app is a java
> application relying heavily on a C++ module. All the C++ calls from
> Java pass via the Swig mapping. Now, the funny part : when I try to
> execute the app on XP, it crashes with an EXCEPTION_ACCESS_VIOLATION
> (see the copy below, my dll is called displanisSW.dll). There is no
> specific XP call in my app, no MFC; the dll is built with Visual
> Studio.
>
> I just don't have any idea where to ask, where to begin my search.
> Could someone give me an advice? Thanks a lot.
>
Debug it as you would any other code that crashes. Not very insightful
advice, but SWIG is just a code generator for which you have the code.
Look out for early garbage collection of Java objects resulting in
dangling pointers, eg if you return a pointer to a member variable and
the containing class gets collected.

Otherwise the bug is likely to be in your C++ library. The fact that the
problem occurs on XP and not Win2000 just means you have previously been
lucky that your bug has not surfaced.

William


-------------------------------------------------------
SF.Net email is sponsored by:
Tame your development challenges with Apache's Geronimo App Server. Download
it for free - -and be entered to win a 42" plasma tv or your very own
Sony(tm)PSP.  Click here to play: http://sourceforge.net/geronimo.php
_______________________________________________
Swig-user mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/swig-user
Loading...