Short: Segmentation fault beim mehrfachen Erben von heart_beat's
Date: Wed, 4 Oct 2000 03:19:37 +0200
From: gnomi@UNItopia.rus.uni-stuttgart.de (Gnomi)
Type: Bug
State: Done - fixed in 3.2.9-dev.236
See also: b-000616
Driver: 3.2.9-dev.234
Ich habe den Grund der letzten Crashs auf folgende 3 Dateien reduzieren
koennen: (test.c ist die zu ladende Datei.)
---test.c---------
inherit "testi1";
inherit "testi2";
void create()
{
set_heart_beat(1);
}
---testi1.c-------
private void heart_beat()
{
}
---testi2.c-------
void heart_beat()
{
}
Der Grund liegt also am private des 1. heart_beats. (Wenn man beide inherits
vertauscht, gibt's keinen Crash.)
----- Analysis:
In the compiled object, the private heart_beat() was cross-defined to the
non-private one, and the 'heart_beat' index in the program structure pointed
at the cross-definition. setup_new_frame1() didn't expect this and tried to
resolve the cross-definition offset as inheritance offset -> boom.
The same could happen when the compiler encountered heart_beat() prototypes.
Note that for other functions this is not a problem as their function index
is looked up by name, which wouldn't find the private inherit.