segfault on memory intensive programs

Dave Korn dave.korn@artimi.com
Thu Mar 30 11:08:00 GMT 2006


On 29 March 2006 21:22, 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];
> ...
> 

  Your testcase didn't even compile for me! It complained about those three
dots!
 
> 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.

  I guess we'll just have to take your word for that!
 
> However, it runs on VC++.  And a Java-ized port of the
> program runs fine under Sun and BEA java for N=600.

  Likewise!
 
> 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
> 
> 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? 

  Not really sure how you expect anyone else to know what's going on in your
code.

> VC++ and java can
> do it.  I'm sure cygwin can too.

  One thing that might help would be rebaseall (subject to usual provisos
about getting all relevant dlls).  Apart from that it's all going to be wild
guesswork.


    cheers,
      DaveK
-- 
Can't think of a witty .sigline today....


--
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/



More information about the Cygwin mailing list