On 13.02.2017 21:28, Erich Steinböck wrote:
> Rony, I've built a 5.0 32-bit Debug installer and uploaded it to our files 
> section as
> oorexx/5.0.0beta/ooRexx.5.0.0.0-x86_32-debug.exe
Thank you *very* much for the debug build!

Still trying to set up the environment to have both functional, Rexx loading 
Java via BSF4ooRexx,
and starting with devenv according to Rick's advice.

>
>     does not run on ooRexx 4.2.0 as such an exception is thrown on the Rexx 
> side, but works on
>     ooRexx 5.0beta flawlessly
>
> Not sure I understand .. if it works on 5.0, then there's no need to debug
There is one Rexx sample using JavaFX that breaks on 4.2.0 and runs on 5.0.0.

Independent of this there is an exception using BSF4ooRexx support for 
javax.script on 5.0. The
exception is in rexx.dll, but could be caused by BSF4ooRexx as well.

The circumstances are as follows:

  * Rexx runs a Rexx program that uses BSF4ooRexx, which will load Java 
(jvm.dll),
  * then the Rexx program will use the javax.script package to create a new 
Rexx interpreter
    instance and run a "Rexx script" program, supplying a "ScriptContext",
      o The "Rexx script" program is a normal Rexx program that may have "Rexx 
script annotations"
        (in block comments) that will cause injection of Rexx code, before 
running the "Rexx script"
        on the new Rexx interpreter instance
      o The injected code will use a Rexx class (.JSR223) in the BSF.CLS 
package to get or set
        attributes in Bindings that the "ScriptContext" manages
          + in the case of a "get" operation, attribute entries in the (Java) 
Bindings will be
            incorporated as context Rexx variables
          + in the case of a "set" operation, context Rexx variables will be 
used to set their
            corresponding attribute entries in the (Java) Bindings

The main Rexx program as well as Java (and the Rexx script program) run in the 
same thread.

A test script with a sequence of such "get" and "set" annotations will cause an 
exception, if
debugging output in the methods of the .JSR223 class occur under some 
circumstances. Here a snippet
from that test script showing the injected Rexx code:

    ... cut ... say " |1|"~copies(20) say "setting all Rexx variables (only 'S' 
for which no
    attribute exists)" ; .jsr223~set(*arg(arg())**~scriptContext*, "", 
BSFContextVariables('get')) ;
    /* @set() */ say " |2|"~copies(20) say "setting all Rexx variables (only 
'S' for which no
    attribute exists)" ; .jsr223~set(*arg(arg())~scriptContext*, "s", 
BSFContextVariables('get')) ;
    /* @set(s) */ ... cut ...

There are two observations I could make from studying the error situation:

  * sometimes there is a Rexx error message that indicates that "arg(arg()" all 
of a sudden does not
    return the same object (BSF4ooRexx adds a Rexx directory object as the last 
argument, which in
    this case stores the Java ScriptContext object under the index name 
"SCRIPTCONTEXT") anymore,
    one such error message:

    38 *-* call BSFContextVariables 'set', 
.jsr223~get(arg(arg())~scriptContext, """d1"" d2") ;
    Error 97 running test_set_attributes.rex line 38: Object method not found. 
Error 97.1: Object "a
    Method" does not understand message "SCRIPTCONTEXT".], 
object.getClass()=[class
    org.rexxla.bsf.engines.rexx.RexxException] *-* Compiled routine "BSF". 1802 
*-* res=BSF(
    "invoke", "org.rexxla.bsf.engines.rexx.jsr223.RexxScriptEngine@6e1b77", 
"EVAL" , a.1 , a.2 )
    1804 *-* interpret code ")" -- execute this dynamically created Rexx string 
90 *-*
    obj=rse~eval(.bsf~new("java.io.FileReader",filename), sc) -- now let us 
execute the Rexx script
    Error 40 running 
F:\test\orx\rexxScript\RexxTestAttributes_with_blanks_host.rex line 90:
    Incorrect call to routine. Error 40.900: BSF4ooRexx/routine/BSF(), error 3: 
Java exception
    occurred: [org.rexxla.bsf.engines.rexx.RexxException:
    BSF4ooRexx/routine/jniRexxSendMessageToRexxObject(), error 4:? 38 *-* call 
BSFContextVariables
    'set', .jsr223~get(arg(arg())~scriptContext, """d1"" d2") ;?Error 97 running
    test_set_attributes.rex line 38: Object method not found.?Error 97.1: 
Object "a Method" does not
    understand message "SCRIPTCONTEXT".].

    Sometimes the empty string "" is returned instead.

    The notable thing here is that "arg(arg())" has been used successfully in 
the same sequence of
    invocations. E.g. the above code snippet would always allow the first 
invocation to be carried
    out correctly and a few code lines later when re-issuing the "arg(arg())" a 
different value gets
    returned yielding the above error message. However, this is only rarely the 
case as most of the
    times exceptions occur.


  * most of the times I only get the exception and Java's "hs_err_pidNNNN.log" 
where an exception is
    recorded like:

    # # A fatal error has been detected by the Java Runtime Environment: # #
    EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x622fb358, pid=2844, 
tid=0x00001d60 # # JRE
    version: Java(TM) SE Runtime Environment (8.0_121-b13) (build 
1.8.0_121-b13) # Java VM: Java
    HotSpot(TM) Client VM (25.121-b13 mixed mode windows-x86 ) # Problematic 
frame: # C
    [rexx.dll+0x2b358] # # Failed to write core dump. Minidumps are not enabled 
by default on client
    versions of Windows # # An error report file with more information is saved 
as: #
    F:\test\orx\rexxScript\hs_err_pid2844.log # # If you would like to submit a 
bug report, please
    visit: # http://bugreport.java.com/bugreport/crash.jsp # The crash happened 
outside the Java
    Virtual Machine in native code. # See problematic frame for where to report 
the bug. #

    It seems that this exception occurs upon return from the .JSR223-method. 
Will have to add debug
    code for the BSF4ooRexx external Rexx function BSFContextVariables() which 
allows to get, set
    and drop Rexx context variables.

If you have ideas what to look for in Visual Studio once I am able to get the 
debugging working, I
would appreciate it as I have no knowledge/expertise there.

---rony



------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, SlashDot.org! http://sdm.link/slashdot
_______________________________________________
Oorexx-devel mailing list
Oorexx-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/oorexx-devel

Reply via email to