X-Spam-Check-By: sourceware.org Message-ID: <97b0303c0603300509h2e4a0968k2594fdc0226e2b8f@mail.gmail.com> Date: Thu, 30 Mar 2006 20:09:29 +0700 From: "Alexander Herrmann" To: cygwin AT cygwin DOT com Subject: Re: segfault on memory intensive programs In-Reply-To: <20060329202148.42196.qmail@web34802.mail.mud.yahoo.com> MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Disposition: inline References: <20060329202148 DOT 42196 DOT qmail AT web34802 DOT mail DOT mud DOT yahoo DOT com> X-IsSubscribed: yes Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm Precedence: bulk List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner AT cygwin DOT com Mail-Followup-To: cygwin AT cygwin DOT com Delivered-To: mailing list cygwin AT cygwin DOT com Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by delorie.com id k2UD9b1u004025 On 3/30/06, Pete wrote: > I have some benchmarkign code > > #define N 600 // Matrix rank > #define ITERATIONS 2000 > > > > int main( void ) > { > // Set up the timer and start it ticking. > Timer timer; > timer.startTimer(); > > // We multiply m1 and m2, and put the result in m3. > int m1[N][N]; > int m2[N][N]; > int m3[N][N]; > ... > > > On Cygwin, the code runs fine for a matrix rank > between 400 and 0. Somewhere N=400 and N=600, the > program segfaults under Cygwin. m1[N][N], m2[N][N] and m3[N][N] is static memory so why should it fail? Additionaly you can make it static but the problem is somewhere else in your code so you may malloc or something else without testing the proper returncode != NULL > However, it runs on VC++. And a Java-ized port of the > program runs fine under Sun and BEA java for N=600. Ok, and what's the point? > > I've tried increasing the heap and stack size for > Cygwin as per the FAQ, but the FAQ's solution doesn't > seem to be working: I tried adding the key to the > registery as per You don't seem to make any recursion. calling main from main ?! > > http://cygwin.com/cygwin-ug-net/setup-maxmem.html > > and compiling with: > > gcc -Wl,--heap,4096,--stack,4096 -o foo foo.c > > but nothing seems to prevent the application for > segfaulting under cygwin when N=600. > > Any ideas on how I can make this program not crash > under cygwin for high matrix rank? VC++ and java can > do it. I'm sure cygwin can too. > > Thanks. > Pete > > __________________________________________________ > Do You Yahoo!? > Tired of spam? Yahoo! Mail has the best spam protection around > http://mail.yahoo.com > > -- > Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple > Problem reports: http://cygwin.com/problems.html > Documentation: http://cygwin.com/docs.html > FAQ: http://cygwin.com/faq/ > > -- Take a look - not only for computer people ;) http://www.seabreeze.co.th -- Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple Problem reports: http://cygwin.com/problems.html Documentation: http://cygwin.com/docs.html FAQ: http://cygwin.com/faq/