Crash with undefined function variables 
Author Message
 Crash with undefined function variables

I am very impressed by the security offered by the oberon system and
especially the oberon language (type guars, index checks etc.). I even
thought about reactivating my Amiga if the port of the oberon system comes
out (no GURU's anymore :) ).

But there is one hole in this security:

If you call an undefined procedure variable like

PROCEDURE test*;

VAR function: PROCEDURE;

BEGIN
    function;
END test;

The system crashes (on the MACoberon). On DECoberon, it results in a trap,
because the UNIX signal is caught by the oberon system (segmentation fault
or bus error).

I would like to know, what happens in this case on the original
Ceres-machine and whether there is anyting to avoid a total crash (besides
programming correctly of course:) ).

Jochen Riehm



Tue, 31 Oct 1995 20:21:01 GMT  
 Crash with undefined function variables
The current version of MacOberon initializes local pointer variables to
NIL so that the reported effect no longer happens. This can be turned
off by a compiler option if you don't want the associated overhead.
Pointers to nowhere lead to bus errors, that unfortunately cannot be
caught by application programs on the Macintosh.

Michael Franz



Tue, 31 Oct 1995 23:57:15 GMT  
 Crash with undefined function variables

Quote:
Michael Franz writes:
> Pointers to nowhere lead to bus errors, that unfortunately cannot be
> caught by application programs on the Macintosh.

Certainly they can -- simply put a pointer to your error handling routine
into the appropriate 68000 bus error vector location:

        movea.l #myErrorRoutine, a0

        move.l a0,$8    ;bus error
        move.l a0,$C    ;address error
        move.l a0,$10   ;illegal instruction
        move.l a0,$14   ;zero divide
        move.l a0,$18   ;CHK, CHK2
        move.l a0,$1C   ;TRAPcc, TRAPV



Wed, 01 Nov 1995 16:41:45 GMT  
 
 [ 3 post ] 

 Relevant Pages 

1. Error: Unbound variable or undefined function ?

2. Tcl_EvalObjv() crashes Mac if proc undefined

3. Undefined Variable %&^#$^%

4. ON and OFF now undefined variables

5. undefined variable checking

6. Checking Undefined Variables (was: INITIAL COMMENT)

7. undefined variables

8. undefined variables (was Top 10 Language Constructs (Modula-2))

9. detecting undefined variables

10. Undefined variables

11. Testing whether variable is undefined

12. undefined reference to nonexistent variable

 

 
Powered by phpBB® Forum Software