Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm 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 Date: Thu, 12 Aug 2004 13:11:32 +0200 From: "Gerrit P. Haase" Reply-To: "Gerrit @ cygwin" Organization: Esse keine toten Tiere Message-ID: <1535099350.20040812131132@familiehaase.de> To: user AT lngs DOT infn DOT it CC: cygwin AT cygwin DOT com Subject: Re: simple C program crashes at run time In-Reply-To: <200408121041.MAA00181@gsnet0.lngs.infn.it> References: <1092304835 DOT 13420 DOT ezmlm AT cygwin DOT com> <200408121041 DOT MAA00181 AT gsnet0 DOT lngs DOT infn DOT it> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-IsSubscribed: yes Hallo user, Am Donnerstag, 12. August 2004 um 12:47 schriebst du: > #include > #include > #include > #define TAGLIA 415 > main() > { > int i, j, k, iran; > unsigned int seed; > float unran; > float mata[TAGLIA][TAGLIA], > matb[TAGLIA][TAGLIA], > matc[TAGLIA][TAGLIA]; > srand(seed); > printf("init start...\n"); > /* this should init all elements with pseudo-random float values */ > for(i=0;i { > for(j=0;j { > iran=rand(); unran = iran / 1.0E10; > mata[i][j]=unran; > iran=rand(); unran = iran / 1.0E10; > matb[i][j]=unran; matc[i][j] = 0.0; > } > } > printf("init end.....\n"); > /* do something to grab cpu-time */ > for(i=0;i { > for(j=0;j { > for (k=0;k matc[i][j]=matc[i][j]+mata[i][k]*matb[k][j]; > } > } > printf("all done.....\n"); > } > No informational and/or warnings while building it: > gcc unlucky.c -o unlucky.exe > It works for TAGLIA < 416 > With TAGLIA = 416 it looks unusually fast and without outputs > with TAGLIA > 416 it crashes: > sysnaz AT wngsnt ~ > $ ./unlucky.exe > Segmentation fault (core dumped) > $ more unlucky.exe.stackdump > Exception: STATUS_STACK_OVERFLOW at eip=00401593 > eax=00001774 ebx=00000004 ecx=00032064 edx=00401098 esi=610F3060 > edi=61005AC0 > ebp=0022F068 esp=0022F05C program=d:\cygwin\home\sysnaz\unlucky.exe, > pid 1232, thread main > cs=001B ds=0023 es=0023 fs=0038 gs=0000 ss=0023 > Stack trace: > Frame Function Args > 0022F068 00401593 (00000001, 616D5310, 0A0500A8, 0022F0C0) > 0022F0A8 61005F54 (0022F0C0, 00000000, 00000000, 00000000) > 0022FF88 6100616B (00000000, 00000000, 00000000, 00000000) > End of stack trace > What does it happen? the same code built on linux doesn't > crashes.. See stackdump: STATUS_STACK_OVERFLOW > Thanks in advance for help. bye. Increase the stack (only possible during buildtime): $ gcc -o unlucky unlucky.c -Wl,--stack,8388608 $ ./unlucky.exe init start... init end..... all done..... Gerrit -- =^..^= -- 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/