Curious segmentation fault...

Shriramana Sharma samjnaa@gmail.com
Mon May 22 18:11:00 GMT 2006


Monday 22 May 2006 23:05 samaye, Shriramana Sharma alekhiit:

> The only difference between the two source files monthpan.c and
> monthpan-bug.c is that the latter contains the line:
> char spicanaama[] = "Spica";
> *before* the start of the declarations of the two-dimensional arrays, which
> for some reason seems to cause the zero element of the first
> two-dimensional array to be out-of-bounds.

I further investigated this and it becomes more and more curious. 

If I place spica-name before graha-name then it faults, but not if I place it 
before tithi-name. If I push it to before nakshatra-name it faults again, but 
does not fault before yoga-name, and again faults before karana-name but does 
not fault *after* karana-name. 

In all the cases, it is memory location 0x726956 which faults with <Address 
0x726956 out of bounds> ...

-- 

Tux #395953 resides at http://samvit.org
playing with KDE 3.51 on SUSE Linux 10.1
$ date [] CCE +2006-05-22 W21-1 UTC+0530
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
URL: <https://gcc.gnu.org/pipermail/gcc-help/attachments/20060522/28fc947c/attachment-0001.sig>


More information about the Gcc-help mailing list