public inbox for gcc-prs@sourceware.org
help / color / mirror / Atom feed
From: rs025019@se.ritsumei.ac.jp
To: gcc-gnats@gcc.gnu.org
Subject: c/5033: non const char *'s initial pointee data left on read only segment, causes seg. fault.
Date: Thu, 06 Dec 2001 04:26:00 -0000	[thread overview]
Message-ID: <20011206121728.17648.qmail@sources.redhat.com> (raw)


>Number:         5033
>Category:       c
>Synopsis:       non const char *'s initial pointee data left on read only segment, causes seg. fault.
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    unassigned
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Thu Dec 06 04:26:03 PST 2001
>Closed-Date:
>Last-Modified:
>Originator:     rs025019@se.ritsumei.ac.jp
>Release:        gcc 2.95.2
>Organization:
>Environment:
1. Debian GNU/Linux 2.2r4 (gcc 2.95.2 20000220), PentiumII
2. Cygwin (gcc 2.95.3-5 cygwin special), Pentium III
3. SunOS? (gcc 2.81?), UltraSparcII
>Description:
Like attached source, auto variable of char * p's initial pointee data is placed on code (or rodata) segment, and be operated still on the same segment, not stack or data segment, and causes segmentation fault.
This may be ok if that char * is implicitly processed as const char * (I don't know much about the standard, sorry), but even with -Wall, gcc listed at "Environment" seems not to report this (cf. lint reports this).
>How-To-Repeat:
gcc [-Wall] <attached file>
./a.out
>Fix:
non const auto pointer's pointee data placed on .text (or .rodata) should be copyed to data or stack segment, or gcc should just warn it at least when -Wall flag is on.
>Release-Note:
>Audit-Trail:
>Unformatted:


             reply	other threads:[~2001-12-06 12:26 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2001-12-06  4:26 rs025019 [this message]
2001-12-06  6:31 neil
2001-12-06  6:36 neil

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=20011206121728.17648.qmail@sources.redhat.com \
    --to=rs025019@se.ritsumei.ac.jp \
    --cc=gcc-gnats@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).