kimr@eiffel.UUCP (Kim Rochat) (05/18/91)
A defect has been found and fixed in the garbage collector of Interactive
Software's release of Eiffel version 2.3.4.
This defect results in a segmentation fault in some Eiffel applications
using both garbage collection and class ARRAY. It most commonly occurs
if the "force" routine of class ARRAY is used to dynamically grow an
array, but other ARRAY operations which result in an ARRAY object being
copied may also cause the problem. The segmentation fault is a
consequence of the array operation, but may occur later in the system
execution when the ARRAY object is scanned by the garbage collector.
The context diff for the fix is included at the end of this article.
Use the following instructions to apply to fix to your Eiffel installation.
Assume that $EIFFEL contains the full pathname of the "Eiffel" subdirectory
in the Eiffel installation directory.
1) Extract the context diff from the end of this message, placing it in
/tmp/diffs.
2) cd $EIFFEL/files
3) make a backup copy of _basic.c
4) Apply the patch to _basic.c using the "patch" utility:
patch < /tmp/diffs
or apply the diffs to _basic.c by hand.
Recompile _basic.c and recreate the runtime library _run_time.a:
5) After making a backup copy of "_makeD", Edit "_makeD" and make
certain that the CFLAGS macro includes either "-DBSD" or "-DSYSTEMV",
as appropriate for your platform. (CFLAGS is usually
CFLAGS = -O -DBSD -DDARRAY
but should be set to
CFLAGS = -O -DSYSTEM -DDARRAY
for Unix System V and other non-BSD Unix systems).
6) Move _run_time.a to a backup file.
7) rebuild the run_time_library:
make -f _makeD
This will take a few minutes while the run time files recompile.
8) Rebuild your Eiffel system using the new runtime:
rm <root_class_name>; es
9) If you have a C package for your application, the files in
the C package directory can be updated by removing the files
"_run_time.a" and "_basic.c" from the
C package directory and re-running the "es" command that
originally generated the C package directory.
Kim Rochat
Interactive Software Engineering
Responses to: eiffel@eiffel.com
-------------------------------------------------------------------------------
-------------------------------------------------------------------------------
*** _basic.c.old Fri May 17 15:57:56 1991
--- _basic.c Fri May 17 15:58:22 1991
***************
*** 9,15 ****
#include "_mem.h"
extern int16 str_DT;
extern int16 gac_flag, gac_option;
- extern void strcpy ();
extern void str_lower ();
extern int16 db_DT, int_DT, real_DT, bool_DT, char_DT;
extern uint32 _rt_40a, _rt_40d;
--- 9,14 ----
***************
*** 117,122 ****
--- 116,123 ----
int range, start, nbelem;
{
OBJPTR new_area;
+ register OBJPTR element;
+ register int32 i;
new_area = spAllocate (range, gentest (oldarea, 0));
#ifdef SYSTEMV
memcpy((char *) (Access (new_area)+start),(char *) (Access (oldarea)),nbelem*_rt_40d);
***************
*** 124,129 ****
--- 125,137 ----
#ifdef BSD
bcopy((char *) (Access (oldarea)),(char *) (Access (new_area)+start),nbelem*_rt_40d);
#endif
+ if (gac_option && gentest (new_area, 0) &&
+ ISBLACK(new_area) && !ISBLACK(oldarea)) {
+ for (i=0;i<nbelem;i++) {
+ if (element=(OBJPTR)(*(Access (new_area)+start+i)))
+ SHADE (element);
+ }
+ }
return (new_area);
}
OBJPTR MakeStr(s)