[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

_Very_ strange problem with compiling



Hi,

I thought I'd found a gcc compiler error (and still may have).  The
following program crashes with a segmentation fault.

#define N 209677

int main(int argv, char **argc) {
  int
    i;
  double
    a[N],
    b[N],
    c[N],
    d[N], 
    e[N];

  c[0]=0.0;
  i=1;
  c[i]=c[i-1];
}

If I make N slightly less, or reduce the number of arrays defined, it
runs fine.  If I write instead "c[1]=c[0]" it runs fine.  Basically, I
simplified the original program as much as I could in ways which still
caused the Seg Fault to happen.

So I thought this must be a compiler error.  The program was called
"thick4.c".  I used emacs to paste the file into a new buffer called
"test.c".  But this one worked fine when I compiled!!!!  The two files
"thick4.c" and "test.c" are identical, as both diff and cmp prove.

The executables "thick4" and "test" differ very slightly however.

-rwxrwxr-x    1 mark     mark         4731 Mar  7 02:53 test*
-rw-rw-r--    1 mark     mark          162 Mar  7 02:53 test.c
-rwxrwxr-x    1 mark     mark         4733 Mar  7 02:53 thick4*
-rw-r--r--    1 mark     mark          162 Mar  7 02:51 thick4.c

and 

$ cmp thick4 test  
thick4 test differ: char 3061, line 2

Why would identical files compile to slightly different executables?
I have included gzipped versions of these executables with this email.

Has anyone got any idea what might be going on?  Or suggestions about
what I could investigate next!

Also, can anyone else replicate the error I got (using thick4.c as
your file name).

Thanks,

Mark.

-- 
_/~~~~~~~~\___/~~~~~~\____________________________________________________
____/~~\_____/~~\__/~~\__________________________Mark_Phillips____________
____/~~\_____/~~\________________________________mark@ist.flinders.edu.au_
____/~~\HE___/~~\__/~~\APTAIN_____________________________________________
____/~~\______/~~~~~~\____________________________________________________
__________________________________________________________________________
        "They told me I was gullible ... and I believed them!" 

Attachment: thick4.gz
Description: Binary data

?í¥:teståX[lTE?³{

´?ÛÃF%?Dm­?Z?^?Ú¤\¤+Á@<lwO»kv÷lvÏêâ%¶H©éC?SLÔhÄl¢?>TJDã%Äh0*	&????D?!®ß?3gÏìº$¾øä4³3ßüß?ÿÌæ?Kû¶i?ÆÜäc~FèÒ½¶
å[óE{°y¬?­e«PFyuÊ5È:²ù:eÈ(/C}??i2óåP&}V/ä¼m2äeó¤Ü?b
ò)È(?>)åºÌµè¤ö°^K9Pdñ?
?è½?x*?7²¶Ñ*ÚëåØzv<.}á%¿ì¿FÖuE¦Up+S?ò)øó?w ¯Fþøm?;?¿þe#2?Ãö?èµd£?-ñü%çÁLs(i§Ì¬Î8¦É0?Mc#Q+c
ų??13á¤eÆS?63{w??§Ì\Ö??F*R??§ÐRM­§¯·³Ël5??7èO|??ûª^?©>_Lò¸Ä/ã?Ì?£N ??q*á 	*á¼Ç?ÿ\¸º¼?¸ûÏÒ?çò¨ÏýA?ÏBcßg³¨ï?FqÝ1ü·¸?z?QõÊ¥"Ò:ê9F²+ç9&1Ö?@"¶üúäñ?
?oì
í?µÃ§1?~lOlº ×Î}Òõññ?ñ¤-¬8:ãø?ç1?ñRâÜÚÂ??)÷ð/?¯EQÛ¥_A?QV<Ï[
?Yîòô?ÑÉâÂÙë±Zçzañ\
)?#ѱèï³YQ~pJ(4ÎÞ?µOb¸\Ë­rîá«wýy?õ?;:³ñ=>ÏsGϺµàMê{4xóø?1ý[j?$Úèö?½ck¿ä
cÔpQ_tqmýè«ßÕÝ9J_|?¦9l¡ß¢S7ê/?/ÌÞ,<TÌ]ßç?U??ß6Ãñãs?üU,?ãçëDDÅóòûño(¿?[N)²Ó?ü??#¢M?k¬?>k?qÑ?¸¦X?FIqB¹%­ÁERo?ì?Æ2;4ú¬Ëy\1v;Åú¥z%Å^&KÌÄnC;?jÓX~CÙtÄ/ëéêz0Ð?íb} Õxà~£5ÐÚ?ÔÚÚhê¶âáTÂ
}´Ï¬ÿ?Ñ]?×?[?æéÑÿº?Ù?I'<?ÒÉ?2æÖâ)ìnif¤lÇ2::{ïuÂCÌ??³1fD¦ (J'Ã?¡TÎxÚÊdãvª??e¬?1d;¢?N8Ôs¿¼êXyü¢r;vÂè?ÿZ1±³2#âØ?,?EÁ»?Ýp2Áp²hã?;?´R?0û·i
óÎ#~þÊõì&÷,¹y¾äñsR?g?LîùF^­?<?¹&ðîQäî?º??¸#Åb¼RWcÞùúñH<?Ýi³UÆ×Ãøas»?¹&?Ø\»>×qJu?Õ6???j?Ry?«^È'V?μ»	á?£½a¿Oìº??ËËÉþiÉo]ÿ=§ð¦À?ok?ò°Â£»×%ðö+¿{Ö¾¨ðh/l?òÚ*vO0oìo¯îE?Ê??<ú&ü¾¥?Wò^Qxt&%ôò;?[]áÑé?¾?Ýw^¼ü-x§íáÃUæKù}éâñ{¡.î?5
?ú?aÞ?ØöV?\?"ù~?·²Êø>Wt(oµÒàV¿a"ÞÜ´?ÍW±Û mºé+ð¾¯Â«¼sÖÖÑuZÄÿ&æÅÛ??þ?¡ñ÷*ã«?hÿ`\_°h?XXn*aa!TÂÂ;Ó%,?ì??~q?çñ*°ðL¨?ÅJØ_Â8vJx!ÇS%¼?ãK%,V0Å?À?9Þ[ÂK8>0áâ¥'JXD[º?8Î?p#ÇÃ%,vØ©^.ìOºxE¾­ÌÏ~~QñÊ
¼ª¯®ÀkÄ^Wpï&u|.ö*äw+ú:»V䧨"§7Ht½?-e?ùk?7Ê?"ߥè?½AÅ?ôZ8HþRä#Ò+¹ü6öÊc??ö?S
~£¬¿¥ì=æ}
ߧÚ|êG¼ù|¬`êïJGÑ'{m#·¶w?y÷X?ÿµ?ùñýD±W¬2?iÅ¿ó4o½4`½,ÕÊß?Í?«+âx?æ­ÿF¬ÿ-Zùò?æ­ÿzô?¤yë­ö³?°¿?ë×±¼Vþæ?Ô¼x`¾'5o>???7+ú{WóÖÖÿ,pH?ª?¿a/(ý×????'@?C?H«?;O:?°¢??	å?Ëú,~µ?d?¬?4",mÜ?gkwhçn³¯·??w0i'À?mô¶Í¡?=N?ü¦e?sy´5·íîØ4;?=½; Dw53?K&2{à)+â--L¼?E+ÝîduÐÎD,Ó±M~¥3Í.Ÿj0¢ä?à?nNéV??@??u0'³û?Û{»ª¿Ç·nõäæ`Ú?=ÃL~÷¼Å³¿?/Üh?¸[ʺ|øWü+@U¢iº?üNkZbæ=};;;úÌ?Û¶õCf¨£³/?Y©è?ÿÓ öQþo?¿?>^·{

Reply to: