On Thu, Feb 9, 2012 at 7:13 AM, Rony G. Flatscher
<[email protected]> wrote:
> While debugging new code I stumbled over the following observation:
>
> fetching a RexxObjectPtr from .local with:
> bsfClz=rtc->SendMessage0(rtc->GetLocalEnvironment(), "BSF");
>
> getting the string representation (for debugging) of that ooRexx class
> object works with:
> rtc->CString(rtc->SendMessage0(clzBSF,"STRING"));
>
> whereas the following causes a crash:
> rtc->CString(rtc->SendMessage0(clzBSF,"MAKESTRING"));

This one is likely an error in your code.  Unless your class
implements a MAKESTRING method, this will raise an exception and give
you a NULL return.  The appropriate way to use MAKESTRING is to send
the REQUEST message with an argument of "STRING".  However, that will
give you a .nil return if the object does not implement MAKESTRING.
The String method (and by extension, ObjectToString() or
ObjectToStringValue()) are the appropriate ways to obtain a string
value from an object.

Rick

>
> whereas the following causes a crash:
> const char *str=rtc->ObjectToStringValue(clzBSF);
>
> whereas the following causes a crash:
> const char *str=rtc->CString(rtc->ObjectToString(clzBSF));
>
> As sending messages to "bsfClz" works reliably, I can proceed with my work,
> however, I wonder why sending "MAKESTRING" or invoking the APIs
> ObjectToStringValue() and ObjectToString() in this scenario might cause a
> crash in native code?
>
> TIA,
>
> ---rony
>
> P.S.: Here's the hs-log file from Java for case # 3, ie. sending MAKESTRING
> to "bsfClz"; unfortunately, I have no debug versions of ooRexx available to
> me and due to extrem tight time restrictions only would be able to set that
> up in about ten days, if necessary, as I am about to leave for that time
> frame:
>
> #
> # An unexpected error has been detected by HotSpot Virtual Machine:
> #
> #  EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x02ec502f, pid=5292,
> tid=3480
> #
> # Java VM: Java HotSpot(TM) Client VM (1.4.2_12-b03 mixed mode)
> # Problematic frame:
> # C  [rexx.dll+0x1502f]
> #
>
> ---------------  T H R E A D  ---------------
>
> Current thread (0x00035f10):  JavaThread "main" [_thread_in_native, id=3480]
>
> siginfo: ExceptionCode=0xc0000005, reading address 0x0000000c
>
> Registers:
> EAX=0x00000000, EBX=0x7eee5978, ECX=0x02fbd530, EDX=0x00000000
> ESP=0x0007e4ec, EBP=0x0007e4f0, ESI=0x7eee564c, EDI=0x00035fac
> EIP=0x02ec502f, EFLAGS=0x00010246
>
> Top of Stack: (sp=0x0007e4ec)
> 0x0007e4ec:   00000000 0007e504 02ec83d6 02fbd530
> 0x0007e4fc:   0007e530 00000000 0007e54c 02f1939b
> 0x0007e50c:   43532cfd 00035fac 7eee564c 7eee5978
> 0x0007e51c:   00035fac 7f175e38 00000000 00000000
> 0x0007e52c:   7eee5638 7eee5638 7f175a38 0007e501
> 0x0007e53c:   0007e50c 0007e970 02f8e44f 00000001
> 0x0007e54c:   0007e828 02e93d75 7eee564c 00000000
> 0x0007e55c:   0007ef44 00035fac 7f175b58 0007e828
>
> Instructions: (pc=0x02ec502f)
> 0x02ec501f:   c3 55 8b ec 51 89 4d fc 8b 45 fc 8b 4d 08 33 d2
> 0x02ec502f:   3b 48 0c 0f 94 c2 8a c2 8b e5 5d c2 04 00 cc cc
>
>
> Stack: [0x00040000,0x00080000),  sp=0x0007e4ec,  free space=249k
> Native frames: (J=compiled Java code, j=interpreted, Vv=VM code, C=native
> code)
> C  [rexx.dll+0x1502f]
> C  [rexx.dll+0x183d6]
> C  [rexx.dll+0x6939b]
> C  [BSF4ooRexx.dll+0x3d75]
>
> Java frames: (J=compiled Java code, j=interpreted, Vv=VM code)
> j
> org.rexxla.bsf.engines.rexx.RexxAndJava.jniRaiseCondition([Ljava/lang/Object;Ljava/lang/String;Ljava/lang/String;[Ljava/lang/Object;Ljava/lang/Object;)V+0
> j
> org.rexxla.bsf.engines.rexx.RexxHandler.raiseCondition([Ljava/lang/Object;Ljava/lang/String;Ljava/lang/String;[Ljava/lang/Object;Ljava/lang/Object;)V+12
> j
> JavaRunRexxWithCommandExits$JavaTestConditionCommandHandler.handleCommand(Ljava/lang/String;Ljava/lang/String;[Ljava/lang/Object;)Ljava/lang/Object;+124
> v  ~StubRoutines::call_stub
> j
> org.rexxla.bsf.engines.rexx.RexxAndJava.jniRexxRunProgram(Ljava/lang/String;ILjava/lang/String;Ljava/lang/String;[Ljava/lang/Object;)Ljava/lang/Object;+0
> j
> org.rexxla.bsf.engines.rexx.RexxEngine.apply(Ljava/lang/String;IILjava/lang/Object;Ljava/util/Vector;Ljava/util/Vector;)Ljava/lang/Object;+570
> j  JavaRunRexxWithCommandExits.main([Ljava/lang/String;)V+250
> v  ~StubRoutines::call_stub
>
> ---------------  P R O C E S S  ---------------
>
> Java Threads: ( => current thread )
>   0x009d0578 JavaThread "CompilerThread0" daemon [_thread_blocked, id=3584]
>   0x009cf878 JavaThread "Signal Dispatcher" daemon [_thread_blocked, id=856]
>   0x009cce60 JavaThread "Finalizer" daemon [_thread_blocked, id=3744]
>   0x009cbad8 JavaThread "Reference Handler" daemon [_thread_blocked,
> id=2440]
> =>0x00035f10 JavaThread "main" [_thread_in_native, id=3480]
>
> Other Threads:
>   0x00a0b6f8 VMThread [id=3560]
>   0x00a0cd70 WatcherThread [id=3900]
>
> VM state:not at safepoint (normal execution)
>
> VM Mutex/Monitor currently owned by a thread: None
>
> Heap
>  def new generation   total 576K, used 551K [0x10010000, 0x100b0000,
> 0x104f0000)
>   eden space 512K,  95% used [0x10010000, 0x10089d90, 0x10090000)
>   from space 64K, 100% used [0x100a0000, 0x100b0000, 0x100b0000)
>   to   space 64K,   0% used [0x10090000, 0x10090000, 0x100a0000)
>  tenured generation   total 1408K, used 49K [0x104f0000, 0x10650000,
> 0x14010000)
>    the space 1408K,   3% used [0x104f0000, 0x104fc468, 0x104fc600,
> 0x10650000)
>  compacting perm gen  total 4096K, used 1950K [0x14010000, 0x14410000,
> 0x18010000)
>    the space 4096K,  47% used [0x14010000, 0x141f7af0, 0x141f7c00,
> 0x14410000)
>
> Dynamic libraries:
> 0x00400000 - 0x0040b000       E:\jdk1.4.2_12\bin\java.exe
> 0x7c910000 - 0x7c9c9000       D:\WINDOWS\system32\ntdll.dll
> 0x7c800000 - 0x7c908000       D:\WINDOWS\system32\kernel32.dll
> 0x77da0000 - 0x77e4a000       D:\WINDOWS\system32\ADVAPI32.dll
> 0x77e50000 - 0x77ee3000       D:\WINDOWS\system32\RPCRT4.dll
> 0x77fc0000 - 0x77fd1000       D:\WINDOWS\system32\Secur32.dll
> 0x77be0000 - 0x77c38000       D:\WINDOWS\system32\MSVCRT.dll
> 0x08000000 - 0x08140000       E:\jdk1.4.2_12\jre\bin\client\jvm.dll
> 0x7e360000 - 0x7e3f1000       D:\WINDOWS\system32\USER32.dll
> 0x77ef0000 - 0x77f39000       D:\WINDOWS\system32\GDI32.dll
> 0x76af0000 - 0x76b1e000       D:\WINDOWS\system32\WINMM.dll
> 0x76330000 - 0x7634d000       D:\WINDOWS\system32\IMM32.DLL
> 0x62e10000 - 0x62e19000       D:\WINDOWS\system32\LPK.DLL
> 0x75790000 - 0x757fb000       D:\WINDOWS\system32\USP10.dll
> 0x10000000 - 0x10007000       E:\jdk1.4.2_12\jre\bin\hpi.dll
> 0x76bb0000 - 0x76bbb000       D:\WINDOWS\system32\PSAPI.DLL
> 0x003c0000 - 0x003ce000       E:\jdk1.4.2_12\jre\bin\verify.dll
> 0x003d0000 - 0x003e9000       E:\jdk1.4.2_12\jre\bin\java.dll
> 0x003f0000 - 0x003fe000       E:\jdk1.4.2_12\jre\bin\zip.dll
> 0x02e90000 - 0x02eb0000
>       F:\work\svn\bsf4oorexx\trunk\bsf4oorexx\BSF4ooRexx.dll
> 0x02eb0000 - 0x02fe2000       D:\Programme\ooRexx\rexx.dll
> 0x5d450000 - 0x5d4ea000       D:\WINDOWS\system32\COMCTL32.dll
> 0x02ff0000 - 0x0303f000       D:\Programme\ooRexx\REXXAPI.dll
> 0x71a30000 - 0x71a3a000       D:\WINDOWS\system32\WSOCK32.dll
> 0x71a10000 - 0x71a27000       D:\WINDOWS\system32\WS2_32.dll
> 0x71a00000 - 0x71a08000       D:\WINDOWS\system32\WS2HELP.dll
> 0x03110000 - 0x03224000       E:\jdk1.4.2_12\jre\bin\awt.dll
> 0x72f70000 - 0x72f96000       D:\WINDOWS\system32\WINSPOOL.DRV
> 0x774b0000 - 0x775ee000       D:\WINDOWS\system32\ole32.dll
> 0x6b1f0000 - 0x6b235000       D:\Programme\ooRexx\OREXXOLE.dll
> 0x770f0000 - 0x7717b000       D:\WINDOWS\system32\OLEAUT32.dll
> 0x6b120000 - 0x6b17a000       D:\Programme\ooRexx\rexxutil.dll
> 0x77f40000 - 0x77fb6000       D:\WINDOWS\system32\SHLWAPI.dll
> 0x719b0000 - 0x719f0000       D:\WINDOWS\system32\mswsock.dll
> 0x66710000 - 0x66769000       D:\WINDOWS\system32\hnetcfg.dll
> 0x719f0000 - 0x719f8000       D:\WINDOWS\System32\wshtcpip.dll
> 0x76ee0000 - 0x76f07000       D:\WINDOWS\system32\DNSAPI.dll
> 0x76d20000 - 0x76d39000       D:\WINDOWS\system32\iphlpapi.dll
> 0x76f70000 - 0x76f78000       D:\WINDOWS\System32\winrnr.dll
> 0x76f20000 - 0x76f4d000       D:\WINDOWS\system32\WLDAP32.dll
> 0x750f0000 - 0x7510e000       D:\WINDOWS\system32\wshbth.dll
> 0x778f0000 - 0x779e4000       D:\WINDOWS\system32\SETUPAPI.dll
> 0x64000000 - 0x64021000       D:\Programme\Bonjour\mdnsNSP.dll
> 0x76f80000 - 0x76f86000       D:\WINDOWS\system32\rasadhlp.dll
>
> VM Arguments:
> java_command: JavaRunRexxWithCommandExits
> Launcher Type: SUN_STANDARD
>
> Environment Variables:
> JAVA_HOME=E:\jdk1.4.2_12
> CLASSPATH=F:\work\svn\bsf4oorexx\trunk;F:\work\svn\bsf4oorexx\trunk\samples\Java\handlers\.
> PATH=E:\jdk1.4.2_12\bin;D:\WINDOWS\system32;D:\WINDOWS;D:\WINDOWS\System32\Wbem;E:\Programme\GNU\GnuPG\pub;D:\Programme\Gemeinsame
> Dateien\GTK\2.0\bin;D:\WINDOWS\system32;D:\WINDOWS;D:\WINDOWS\System32\Wbem;E:\rony\tools\sysinternals;e:\cygwin\bin;e:\rony\tools;D:\Programme\ooRexx;E:\vslick\win;D:\Programme\QuickTime\QTSystem\;D:\Programme\TortoiseSVN\bin;D:\Programme\SSH
> Communications Security\SSH Secure
> Shell;E:\jdk1.4.2_12\jre\bin\client;F:\work\svn\bsf4oorexx\trunk;F:\work\svn\bsf4oorexx\trunk;F:\work\svn\bsf4oorexx\trunk\bsf4oorexx
> USERNAME=Administrator
> OS=Windows_NT
> PROCESSOR_IDENTIFIER=x86 Family 6 Model 15 Stepping 6, GenuineIntel
>
>
> ---------------  S Y S T E M  ---------------
>
> OS: Windows XP Build 2600 Service Pack 3
>
> CPU:total 2 family 6, cmov, cx8, fxsr, mmx, sse, sse2
>
> Memory: 4k page, physical 2095176k(587904k free), swap 4034684k(2367504k
> free)
>
> vm_info: Java HotSpot(TM) Client VM (1.4.2_12-b03) for windows-x86, built on
> May  9 2006 12:30:51 by "java_re" with MS VC++ 6.0
>
>
>
>
>
>
>
>
> ------------------------------------------------------------------------------
> Virtualization & Cloud Management Using Capacity Planning
> Cloud computing makes use of virtualization - but cloud computing
> also focuses on allowing computing to be delivered as a service.
> http://www.accelacomm.com/jaw/sfnl/114/51521223/
> _______________________________________________
> Oorexx-devel mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/oorexx-devel
>

------------------------------------------------------------------------------
Virtualization & Cloud Management Using Capacity Planning
Cloud computing makes use of virtualization - but cloud computing 
also focuses on allowing computing to be delivered as a service.
http://www.accelacomm.com/jaw/sfnl/114/51521223/
_______________________________________________
Oorexx-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/oorexx-devel

Reply via email to