PR# 17924 Finalized program with assertions off: random feature call on void target
Problem Report Summary
Submitter: soapy2357
Category: Runtime
Priority: High
Date: 2011/10/29
Class: Bug
Severity: Serious
Number: 17924
Release: 7.0.8.7451 and 6.7.8.5123
Confidential: No
Status: Analyzed
Responsible:
Environment: Linux, 32 bit
Synopsis: Finalized program with assertions off: random feature call on void target
Description
I attached an excerpt of a REAL_96 class (12 bit; Linux's "long double") and a TESTBED class that uses it. The test is a loop that adds 0.001 to the variable and prints it. This works a certain amount of times (e.g. ~34.000 or ~69.000) and then fails with a feature call on void target. REAL_96.mp is Void even though it's created in "default_create". Disabling the GC or doing "crate Result" for the expanded REAL_96 makes the problem go away (see TESTBED). This only fails in finalized mode without assertions. Otherwise it works (at least it doesn't crash).
To Reproduce
Run the attached program in finalized mode without assertions.
Problem Report Interactions
I've added eweasel test#expanded011 to cover the case when it was not working with MANAGED_POINTER.
It seems attachments are not saved (or I just don't see them). So here the two classes in plain text:
class
TESTBED
create
make
feature
make
local
r: REAL_96
do
--(create {MEMORY}).collection_off -- would work with this
from until False loop
r := r + real_96_from_real_64 (0.001)
Io.put_string (r.out + "%N")
end
end
real_96_from_real_64 (a_value: REAL_64): REAL_96
do
--create Result -- would work with this
Result.set_from_real_64 (a_value)
end
end
expanded class
REAL_96
inherit
ANY
redefine
default_create,
out
end
feature {NONE}
default_create
do
create mp.make (12)
end
mp: MANAGED_POINTER
feature {ANY}
c_pointer: POINTER
do
Result := mp.item
end
feature {ANY}
set_from_real_64 (a_value: REAL_64)
do
c_set_from_real_64 (c_pointer, a_value)
end
plus alias "+" (other: REAL_96): REAL_96
do
c_plus (Result.c_pointer, c_pointer, other.c_pointer)
end
o
....
Output truncated, Click download to get the full message
The mentioned testapplication.