Article View: net.4bsd-bugs
Article #1Bug in Pc
From: ucfwhm
Date: Wed, 11 Nov 1981 23:17
Date: Wed, 11 Nov 1981 23:17
49 lines
1877 bytes
1877 bytes
This describes a strange problem that I am having with pc.
The following program works just fine:
-------------------------------------
program x(input,output);
var mdate,stime,abcd: alfa ;
begin
writeln(' x.p test');
time(stime);
writeln(' time:',stime:10);
date(mdate);
writeln(' date:',mdate:10);
end.
While the following program gets "Illegal Instruction"
-------------------------------------
program x(input,output);
var mdate,stime,ctime: alfa ;
begin
writeln(' x.p test');
time(stime);
writeln(' time:',stime:10);
date(mdate);
writeln(' date:',mdate:10);
end.
-------------------------------------
Although I was getting "Illegal Instruction", I was getting no core dump.
I tried running it with adb and found that the trace back indicated that
_ctime was being called from _TIME at the time of failure.
I consulted the source for "time" in /usr/src/lib/pc/TIME.c and found that
ctime is declared as an extern. It is curious that the linker is getting
mixed up by this and not flagging it. I grepped in lib/pc for other externs
and found that index and malloc were also declared as externs. I tried
substituting malloc for ctime and found that ld flagged malloc as
multiply-defined.
Well, this seems like a fairly serious bug that needs to be fixed, although
it can be gotten around.
Bill Mitchell
Univ. of Central Florida
ps.
This was compiled under a 4.1 system that was shipped about one week ago.
We had a similar problem under 4.0, but that was just before we switched
over and I didn't have a chance to pursue it then.
[My apologies if this is mentioned in the documentation somewhere and I
missed it.]
Technical Details
Message-ID:
<anews.Aucf.212>Path:
arc1-ca.pugleaf.net!utzoo!decvax!duke!ucf!whmShow Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!decvax!duke!ucf!whm From: ucf!whm Newsgroups: net.4bsd-bugs Subject: Bug in Pc Date: Wed, 11 Nov 1981 23:17:26 +0000 Message-ID: <anews.Aucf.212>