Message-ID: <3A53F7C4.4E2F3A0F@yesic.com>
From: Lew Pitcher <lpitcher@yesic.com>
X-Mailer: Mozilla 4.76 [en] (X11; U; Linux 2.2.15 i686)
X-Accept-Language: en, en-GB, en-US
MIME-Version: 1.0
Newsgroups: comp.os.minix
Subject: Re: Memory fault - core dumped
References: <92vtn5$20p4$1@spnode25.nerdc.ufl.edu>
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
Lines: 75
Organization: Information Highway.com Inc. -- http://www.ihiway.com
Date: Wed, 03 Jan 2001 23:10:44 -0500
Path: news.adfa.edu.au!clarion.carno.net.au!news0.optus.net.au!news1.optus.net.au!optus!news.mel.connect.com.au!news-spur1.maxwell.syr.edu!news.maxwell.syr.edu!newsfeed.stanford.edu!newsfeeder.randori.com!news.randori.com!merlin.l6s4x6.mydf.ca!nobody
Xref: news.adfa.edu.au comp.os.minix:36423

"Andrew A. Schilt" wrote:
> 
> 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.  I
> used the minix setup floppy with root and
> usr on it as my os.  I did a "umount /dev/fd0c"
> so the floppy wouldn't get accessed repeatedly.
> This is the /usr branch on the floppy.
> 
> 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.
> 
> file count.c
> used "cc count.c" to compile
> The development OS I used to compile
> was a DOSMinix system 2.0.2  32bit.
> I then transferred the a.out file to the
> the bootable floppy.
> 
> #include <stdio.h>
> #include <limits.h>
>
/*
> void main(void)
main() returns an int, always.
This should be...
*/

int main(void)
> {
>   int i;
> 
>   i = 0;
>   for(;;) {
>     printf("%x\t",i);
/* NB: buffered print w/o newline: relies on stdio
       library to flush the buffer. Hope the stdio
       library is robust (it should be ;-) )
*/

>     if( i < UINT_MAX )
>       ++i;
/* note, at some point, this will cause
   i to roll over from INT_MAX to INT_MIN
   NB: i never makes it to UINT_MAX
*/
>     else
/* this branch never executes. in this code
   i is _always_ less than UINT_MAX
*/
>       i = 0;
>   }

/* main() returns an int. return it here */
  return 0;
> }
> 
> ---------
> Andrew A. Schilt
> andrewNOSPAM@afn.org

-- 
Lew Pitcher

Master Codewright and JOAT-in-training
Registered Linux User #112576
