Thread View: net.4bsd-bugs
1 messages
1 total messages
Started by ucfwhm
Wed, 11 Nov 1981 23:17
Bug in Pc
Author: 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.]
Thread Navigation
This is a paginated view of messages in the thread with full content displayed inline.
Messages are displayed in chronological order, with the original post highlighted in green.
Use pagination controls to navigate through all messages in large threads.
Back to All Threads