BETA runtime error stack dump

Runtime errors are errors in the program detected during its execution. In this case an error message is given and a dump of the call stack of objects is generated on the file foo.dump if the program is named foo.

Consider the following fragments (note that the name of the fragments are complete UNIX file paths)

/usr/smith/mylib.bet

ORIGIN '~beta/basiclib/betaenv'
--LIB: attributes--
lib1: (# do INNER #);
lib2: lib1 
  (# T: (# x: @integer #);
     R: ^T
  do (* &T[]->R[] *) 
     111->R.x; (* R[] is NONE *)
     INNER
  #);
lib3: lib2(# do 'hello'->putLine #) 

/usr/smith/runtimeerr.bet

ORIGIN '~beta/basiclib/betaenv'; 
INCLUDE 'mylib' 
--PROGRAM: descriptor--
(# foo1: (# do foo2 #);
   foo2: (# do foo.foo3 #);
   foo: @(# foo3: (# do lib3 #)#)
do foo1
#)

Execution of this program on a SPARC Solaris (sun4s) machine will result in the following file:

runtimeerr.dump

Beta execution aborted: Reference is none.

Call chain: (sun4s)

  item lib3#<lib2#>lib1# in /usr/smith/mylib
  item lib3#lib2#<lib1#> in /usr/smith/mylib
  item <foo3#> in /usr/smith/runtimeerr
  item <foo2#> in /usr/smith/runtimeerr
  item <foo1#> in /usr/smith/runtimeerr
  comp <PROGRAM-~> in /usr/smith/runtimeerr

  basic component in ~beta/basiclib/betaenv


Low level information:

Call chain: (sun4s)

  item lib3#<lib2#>lib1# in /usr/smith/mylib
  { PC  0x278e8 <M2MYLIB+0xc>, object 0x10010b78, proto 0x56c98 "lib3#" <T4MYLIB> }
    -- BETAENV-~ in ~beta/basiclib/betaenv
    { Surrounding object 0x10010038, proto 0x53a98 "BETAENV-~" <T1BETAENV> }
  ... Rest of low level dump left out ...

Call Chain

The information in runtimeerr.dump has the following meaning:

External Activation Parts

External functions may also be involved in the call chain (not shown in the above example):

Low Level Information

After the simple call chain follows a section titled Low level information. This section shows the call chain again, but with much more details than the simple call chain. The extra information is: If the low level trace is considered more confusing than helpful, one can prevent it from appearing in future dumps by setting the BETART environment variable to include SimpleDump. See The BETART Environment Variable for details.

The low level trace takes some time for the BETA runtime system to produce. The time is proportional to the size of the executable. This is the reason that a substantial time may pass from the time the crashing program has printed out BETA Execution Aborted until it actually exits. Please do not interrupt the process during this time, since the dump will then be incomplete.


BETA runtime error stack dump
© Mjølner Informatics