public inbox for gcc-prs@sourceware.org
help / color / mirror / Atom feed
* Re: c/5033: non const char *'s initial pointee data left on read only segment, causes seg. fault.
@ 2001-12-06  6:31 neil
  0 siblings, 0 replies; 3+ messages in thread
From: neil @ 2001-12-06  6:31 UTC (permalink / raw)
  To: gcc-bugs, gcc-gnats, gcc-prs, nobody, rs025019

Synopsis: non const char *'s initial pointee data left on read only segment, causes seg. fault.

State-Changed-From-To: open->closed
State-Changed-By: neil
State-Changed-When: Thu Dec  6 06:31:49 2001
State-Changed-Why:
    Not a bug.  This is not a property of the type assigned to,
    it is a property of the type of string literals.
    
    See -fwritable-strings and -Wwrite-strings in the manual.

http://gcc.gnu.org/cgi-bin/gnatsweb.pl?cmd=view%20audit-trail&pr=5033&database=gcc


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: c/5033: non const char *'s initial pointee data left on read only segment, causes seg. fault.
@ 2001-12-06  6:36 neil
  0 siblings, 0 replies; 3+ messages in thread
From: neil @ 2001-12-06  6:36 UTC (permalink / raw)
  To: nobody; +Cc: gcc-prs

The following reply was made to PR c/5033; it has been noted by GNATS.

From: neil@gcc.gnu.org
To: gcc-bugs@gcc.gnu.org, gcc-gnats@gcc.gnu.org, gcc-prs@gcc.gnu.org,
  nobody@gcc.gnu.org, rs025019@se.ritsumei.ac.jp
Cc:  
Subject: Re: c/5033: non const char *'s initial pointee data left on read only segment, causes seg. fault.
Date: 6 Dec 2001 14:31:50 -0000

 Synopsis: non const char *'s initial pointee data left on read only segment, causes seg. fault.
 
 State-Changed-From-To: open->closed
 State-Changed-By: neil
 State-Changed-When: Thu Dec  6 06:31:49 2001
 State-Changed-Why:
     Not a bug.  This is not a property of the type assigned to,
     it is a property of the type of string literals.
     
     See -fwritable-strings and -Wwrite-strings in the manual.
 
 http://gcc.gnu.org/cgi-bin/gnatsweb.pl?cmd=view%20audit-trail&pr=5033&database=gcc


^ permalink raw reply	[flat|nested] 3+ messages in thread

* c/5033: non const char *'s initial pointee data left on read only segment, causes seg. fault.
@ 2001-12-06  4:26 rs025019
  0 siblings, 0 replies; 3+ messages in thread
From: rs025019 @ 2001-12-06  4:26 UTC (permalink / raw)
  To: gcc-gnats


>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:


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2001-12-06 14:36 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2001-12-06  6:31 c/5033: non const char *'s initial pointee data left on read only segment, causes seg. fault neil
  -- strict thread matches above, loose matches on Subject: below --
2001-12-06  6:36 neil
2001-12-06  4:26 rs025019

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).