Menu

#16 Process bug - incorrect 'super' resolution

open
dsol (7)
4
2005-11-23
2005-11-23
nlang
No

In very particular cases, a running process may fail
to resolve 'super.<method>' correctly. Here is such a
particular example:

Consider the class hierarchy Process <- BaseProcess <-
ExtendedBaseProcess <- SuspendProcess. BaseProcess
defines the method 'start()', which calls 'resume()'.
ExtendedBaseProcess overrides 'start()' by printing
some comments and invoking 'super.start()'. The
SuspendProcess process is to suspend. Now, when such a
suspended process is attempted to be restarted from a
different process, say a ResumeProcess, the error
occurs. When ExtendedBaseProcess.start() is executed,
super.start() is again resolved into
ExtendedBaseProcess.start() rather than
BaseProcess.start(). As a sad consequence, an endless
loop results.

Calling start() DIRECTLY (i.e.: NOT from another
process) results in normal behavior (i.e. no endless
loop).

A detailed example reproducing this bug consistently
is attached.

Discussion

  • nlang

    nlang - 2005-11-23

    Process super() bug detailed example

     
  • nlang

    nlang - 2005-11-23

    Logged In: YES
    user_id=747091

    The DSOL / interpreter version used is a DSOL2.0 full
    snapshot dated September 1 2005.

     

Log in to post a comment.

MongoDB Logo MongoDB