PR# 16625 Void-safe system with class with no externals that violates assertion can get call on Void target
Problem Report Summary
Submitter: prestoat2000
Category: Compiler
Priority: Medium
Date: 2010/02/12
Class: Bug
Severity: Serious
Number: 16625
Release: 6.5.81777
Confidential: No
Status: Analyzed
Responsible:
Environment: Mozilla/5.0 (X11; U; SunOS sun4u; en-US; rv:1.9.0.10) Gecko/2009042715 Firefox/3.0.10
Solaris 10 on SPARC
Synopsis: Void-safe system with class with no externals that violates assertion can get call on Void target
Description
If you don't consider this a bug you can close this report, but I thought I would share it just in case. Perhaps the void-safety claim is really "a void-safe system cannot get a call on Void target if no assertions are violated and there are no external routines that return Void when they claim to return an attached type, unless there is a bug in the compiler or run-time". A class in a system compiled with complete void safety creates an ARRAY [STRING], using make_filled (1, 10). It then accesses element 11. When the system is finalized and assertions are discarded, system execution crashes with a call on Void target. In workbench mode, system execution gives an "index out of bounds" error instead. I don't see any way to prevent this unless you always include run-time checks for access to array items. Of course, one can also get a call on Void target if a misbehaving external is called, but that seems more obvious to me.
To Reproduce
Finalize with attached class and config file, using ec -config test.ecf -experiment -finalize -c_compile Execute system. Gets call on Void target.
Problem Report Interactions
We do indeed considered that if you disable assertions all our guarantees about void-safety are indeed lost since we use assertions for CAPs. However your post trigger something that have been asked by others, that is to say having the SPECIAL out-of-bound checks enabled in finalized mode even if no assertions are set. I'm planning to do that shortly.