On 12.07.2024 15:05, Rick McGuire wrote:


On Fri, Jul 12, 2024 at 8:49 AM Rony G. Flatscher <rony.flatsc...@wu.ac.at> 
wrote:

    Unfortunately, when doing a global trace (e.g. "::options trace i") there 
are crashes with the
    refactored version, hence I uncommitted the changes.

    The problem is in RexxActivation.cpp where in global trace "this" is NULL.

    Even if checking for NULL and supplying defaults for that situation there 
is problem in trying
    to invoke Activity::traceOutput(...) as there is no activity available if 
in RexxActivation
    "this" is NULL.

    What would be the proper solution for this situation?

Figure out why the RexxActivation is NULL, it's called debugging. The first step would be to figure out how you got to that point by examining the stack trace.

OK, here the call stack:

        rexx.dll!RexxActivation::createTraceObject(RexxString * 
traceline=0x000002129b4987e0, RexxActivation::TracePrefix 
tracePrefix=TRACE_OUTPUT, RexxString * tag=0x0000000000000000, RexxObject * 
value=0x0000000000000000) Line 5134       C++
        rexx.dll!RexxActivation::processTraceInfo(RexxString * 
traceLine=0x000002129b4987e0, RexxActivation::TracePrefix 
tracePrefix=TRACE_OUTPUT, RexxString * tag=0x0000000000000000, RexxObject * 
value=0x0000000000000000) Line 5175        C++
        rexx.dll!RexxActivation::displayUsingTraceOutput(RexxString * 
traceLine=0x000002129b4987e0) Line 5187   C++
        rexx.dll!Activity::display(DirectoryClass * exobj=0x000002129b497870) 
Line 1384 C++
        rexx.dll!Activity::displayCondition(DirectoryClass * 
errorInfo=0x000002129b497870) Line 549     C++
   > rexx.dll!DisplayCondition(RexxThreadContext_ * c=0x000002129b47fed8) Line 
1943  C++
        rexx.exe!RexxThreadContext_::DisplayCondition() Line 1624       C++
        rexx.exe!main(int argc=2, char * * argv=0x00000212993a52b0) Line 231    
C++
        rexx.exe!invoke_main() Line 65  C++
        rexx.exe!__scrt_common_main_seh() Line 253      C++
        rexx.exe!__scrt_common_main() Line 296  C++
        rexx.exe!mainCRTStartup() Line 17       C++
        kernel32.dll!BaseThreadInitThunk()     Unknown
        ntdll.dll!RtlUserThreadStart() Unknown

Here the Locals:

   -            c       0x000002129b47fed8 {instance=0x000002129b480470 
{functions=0x00007ff9b5c699a0 {rexx.dll!RexxInstanceInterface 
InterpreterInstance::interfaceVector} {...} ...} ...}     RexxThreadContext_ *
   -            instance        0x000002129b480470 
{functions=0x00007ff9b5c699a0 {rexx.dll!RexxInstanceInterface 
InterpreterInstance::interfaceVector} {...} ...}       RexxInstance_ *
   +            functions       0x00007ff9b5c699a0 
{rexx.dll!RexxInstanceInterface InterpreterInstance::interfaceVector} 
{interfaceVersion=...} RexxInstanceInterface *
                applicationData 0x0000000000000000      void *
   +            functions       0x00007ff9b5c69b00 
{rexx.dll!RexxThreadInterface Activity::threadContextFunctions} 
{interfaceVersion=...}       RexxThreadInterface *
   -            context {activity=0x000002129b47feb0 
{instance=0x000002129b480450 
{context={instanceContext={functions=0x00007ff9b5c699a0 
{rexx.dll!RexxInstanceInterface InterpreterInstance::interfaceVector} {...} 
...} ...} ...} ...} ...}  ApiContext
   +            activity        0x000002129b47feb0 {instance=0x000002129b480450 
{context={instanceContext={functions=0x00007ff9b5c699a0 
{rexx.dll!RexxInstanceInterface InterpreterInstance::interfaceVector} {...} 
...} ...} ...} ...} Activity *
   +            context 0x000002129b480cf0 {activity=0x000002129b47feb0 
{instance=0x000002129b480450 {context={instanceContext=...} ...} ...} ...}      
NativeActivation *
                releaseLock     true    bool
                clearConditions false   bool

The call comes from "RexxActivation::displayUsingTraceOutput(RexxString * traceLine=0x000002129b4987e0)" which uses

     currentRexxFrame->displayUsingTraceOutput(text);

Activity.hpp defines currentRexxFrame as (with the preceeding hint):

        // the following two fields represent the current top of the activation 
stack
        // and the top Rexx frame in the stack.  Generally, if executing Rexx 
code,
        // then currentRexxFrame == topStackFrame.  If we're at the base of the 
stack
        // topStackFrame will be the root stack element (a NativeActivation 
instance)
        // and the currentRexxFrame will be OREF_NULL.  If we've made a callout 
from a
        // Rexx context, then the topStackFrame will be the NativeActivation 
that
        // made the callout and the currentRexxFrame will be the predecessor 
frame.
        RexxActivation     *currentRexxFrame;
        ActivationBase     *topStackFrame;  // top-most activation frame (can 
be either native or Rexx).

So ATM at the end of my Latin.

---rony
_______________________________________________
Oorexx-devel mailing list
Oorexx-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/oorexx-devel

Reply via email to