public inbox for gcc-help@gcc.gnu.org
 help / color / mirror / Atom feed
From: Shriramana Sharma <samjnaa@gmail.com>
To: GCC Help List <gcc-help@gcc.gnu.org>
Subject: Curious segmentation fault...
Date: Mon, 22 May 2006 17:35:00 -0000	[thread overview]
Message-ID: <200605222305.04058.samjnaa@gmail.com> (raw)

[-- Attachment #1: Type: text/plain, Size: 1287 bytes --]

Dear list,

Namaste (hello). This is my first post. I wonder if I have found a bug or at 
least an anomalous behaviour in GCC. Please download the file segfault.tar.gz 
from:

http://www.yousendit.com/transfer.php?action=download&ufid=0D3E9B791AE99BEA

(available for seven days from now). Do make and test both monthpan and 
monthpan-bug with any date range that contains a Sunday (which is where the 
bug lies). You should find that monthpan creates an output file called 
monthpan.txt whereas monthpan-bug creates a segmentation fault at 
grahanaama[0] (grahanaama means "weekday name").

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.

This problem confirmed on gcc-4.1/glibc-2.4 and gcc-3.35/glibc-2.34.

Please can anyone enlighten me as to what exactly causes this bug? Is it a bug 
with GCC? If yes, where do I report it?

Thanks.

-- 

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

[-- Attachment #2: Type: application/pgp-signature, Size: 189 bytes --]

             reply	other threads:[~2006-05-22 17:35 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-05-22 17:35 Shriramana Sharma [this message]
2006-05-22 18:11 ` Shriramana Sharma
2006-05-23 13:40 ` Andrew Haley
2006-05-24 12:59   ` Curious segmentation fault... SOLVED Shriramana Sharma
2006-05-24 13:16     ` Andrew Haley
2006-05-25 13:14       ` Shriramana Sharma

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=200605222305.04058.samjnaa@gmail.com \
    --to=samjnaa@gmail.com \
    --cc=gcc-help@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).