Newsgroups: comp.os.minix
Subject: Re: Memory fault - core dumped
References: <92vtn5$20p4$1@spnode25.nerdc.ufl.edu> <93078b$3ak0$1@spnode25.nerdc.ufl.edu>
Organization: Rochester Institute of Technology, Rochester, NY
From: aje9383@osfmail.isc.rit.edu (Andrew Erickson)
NNTP-Posting-Host: grace.isc.rit.edu
X-Original-NNTP-Posting-Host: grace.isc.rit.edu
Message-ID: <3a53aefd@news.isc.rit.edu>
Date: 3 Jan 2001 18:00:13 -0500
X-Trace: 3 Jan 2001 18:00:13 -0500, grace.isc.rit.edu
Lines: 67
XPident: aje9383
X-Original-NNTP-Posting-Host: 129.21.4.100
XPident: Unknown
Path: news.adfa.edu.au!clarion.carno.net.au!news0.optus.net.au!news1.optus.net.au!optus!intgwpad.nntp.telstra.net!news-spur1.maxwell.syr.edu!news.maxwell.syr.edu!news.syr.edu!newsstand.cit.cornell.edu!news.acsu.buffalo.edu!bingnews.binghamton.edu!news-nysernet-16.sprintlink.net!news.sprintlink.net!news.isc.rit.edu!aje9383
Xref: news.adfa.edu.au comp.os.minix:36420

In article <93078b$3ak0$1@spnode25.nerdc.ufl.edu>,
Andrew A. Schilt <andrewNOSPAM@afn.org> wrote:
>Update:
>The program crashed with the same message on
>a "pure" DOSMinix 2.0.2 setup as well.
>
>--Andrew
>
>"Andrew A. Schilt" <andrewNOSPAM@afn.org> wrote in message
>news:92vtn5$20p4$1@spnode25.nerdc.ufl.edu...
>> As a test of Minix 2.0.2 stability I ran the
>> program count.c below.  After a few hours
>> it terminated abruptly with the message
>> "Memory fault - core dumped"  The same
>> error happened on another computer.

<snip>

>> Is this a Minix flaw or have I made a mistake ?
>> I am also currently doing this test on a slower
>> computer using a freshly installed DOSMinix
>> setup.
>>
>> It looks like a memory leak somewhere.  I
>> saved the "core" file.  If anyone wants to
>> examine it let me know.

<snip again>

>> #include <stdio.h>
>> #include <limits.h>
>>
>> void main(void)
>> {
>>   int i;

Methinks perhaps you should have an unsigned int instead of an int
here, since you are comparing with UINT_MAX.  (That shouldn't cause
the system to dump core, however.)

>>
>>   i = 0;
>>   for(;;) {
>>     printf("%x\t",i);
>>     if( i < UINT_MAX )
>>       ++i;
>>     else
>>       i = 0;
>>   }
>> }

What are the values printed out before the crash?  If you start the counter
at that point, does it repeatably crash there?  (Since printf is buffered,
the value which is printed at the point of the crash is probably a bit lower
than the actual value of i at that point; adding an fflush( stdout ) after
the printf would solve that, but would slow things down quite a bit.)  I'd
tend to suspect that you've found some bizzare bug in printf, either in the
%x conversion, or in handling the caching and flushing of its output.

[Perhaps printf( "%x", 0x80000000 ) doesn't work?]

>> ---------
>> Andrew A. Schilt
>> andrewNOSPAM@afn.org

-- 
Andrew Erickson
