This is the mail archive of the cygwin mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

RE: segfault on memory intensive programs


On 30 March 2006 14:34, Pete wrote:

> The executable is produced with:
> 
> $ make
> g++ -W -Wall -O9 -funroll-loops -mtune=pentium4   -c
> -o matrix_mult_r.o matrix_mult_r.cc

  Heh.


matrix_mult_r.cc:5:19: Timer.h: No such file or directory
matrix_mult_r.cc: In function `int main()':
matrix_mult_r.cc:20: error: `Timer' undeclared (first use this function)
matrix_mult_r.cc:20: error: (Each undeclared identifier is reported only once
for each function it appears in.)
matrix_mult_r.cc:20: error: expected `;' before "timer"
matrix_mult_r.cc:21: error: `timer' undeclared (first use this function)

> g++ -W -Wall -O9 -funroll-loops -mtune=pentium4   -c
> -o Timer.o Timer.cc

  Ah, yes.  I had a bit of a problem with that particular stage of the
proceedings as well....

  However, it's straightforward enough.  The default thread stack is 1Mb (or
is it 2, I can't remember off the top of my head).  Once your stack-based auto
vars exceed the size of the stack, it go BOOOOOM!

  Your problem can be fixed /either/ by making them of static storage duration
(move them out of the function body OR add the 'static' qualifier depending on
scoping considerations), or by using the -Wl,--stack flag.  Correctly.  You
told ld to provide an 8kB stack.  Try 80 meg instead, it works a lot beter!

    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/


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]