*BSD News Article 49818


Return to BSD News archive

Newsgroups: comp.unix.bsd.bsdi.misc
Path: euryale.cc.adfa.oz.au!newshost.anu.edu.au!harbinger.cc.monash.edu.au!simtel!vtc.tacom.army.mil!news1.oakland.edu!news.concourse.com!braintree!news.sprintlink.net!newsfeed.internetmci.com!news.mathworks.com!tank.news.pipex.net!pipex!in2.uu.net!psinntp!psinntp!psinntp!psinntp!voder!nsc!news
From: Dennis de Champeaux <ddc@berlioz.nsc.com>
Subject: G++ program & process size
Content-Type: text/plain; charset=us-ascii
Message-ID: <DE58oC.CyM@nsc.nsc.com>
To: ddc@netcom.com
Sender: news@nsc.nsc.com (netnews maintenance)
Nntp-Posting-Host: london.nsc.com
Content-Transfer-Encoding: 7bit
Organization: National Semiconductor
Mime-Version: 1.0
Date: Wed, 30 Aug 1995 21:50:36 GMT
X-Mailer: Mozilla 1.1N (X11; I; SunOS 4.1.3_U1 sun4c)
X-Url: news:comp.unix.bsd.bsdi.misc#41cshk$aur@diablo.cet.co.jp
Lines: 14

I have written a C++ program with a class whose instances define a boolean
array of length 604800.  I take it that a boolean is represented by a byte.
Execution of this program crashes with a segment fault when the fourth
instance is created (through a declaration in the main program).

This surprises me. I have 16M of memory, I think I have over 40M of swap space.
4 instances consume about 2.5M.  Why a segment fault?  

Please cc a reply to my netcom address.

TX a lot,

Dennis de Champeaux