public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "peter dot hedinger at st dot com" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug libstdc++/17200] New: Reading from a istrstream seg faults when using -malign-double flag
Date: Thu, 26 Aug 2004 11:55:00 -0000	[thread overview]
Message-ID: <20040826115542.17200.peter.hedinger@st.com> (raw)

>g++ -v
Reading specs from /pd/gcc/2.95.2/lib/gcc-lib/i686-pc-linux-gnu/2.95.2/specs
gcc version 2.95.2 19991024 (release)

--------------------------- test.cpp ------------------------
#include <iostream>
#include <strstream>
using namespace std;

int main( ) 
{
    char *tmp = "This is a test";
    char tag[100];
    tag[0] = '\0';
    
    istrstream inputStream((const char*)tmp);
    inputStream >> tag;
    cout << tag << endl;
}
-------------------------------- Works ------------------------
> g++ test.cpp
> ./a.out
This
-------------------------------- Crashes ----------------------
> g++ -malign-double test.cpp
> ./a.out
Segmentation fault
-------------------------------- Cause ------------------------
The bit that causes the seg fault is "inputStream >> tag;"

-- 
           Summary: Reading from a istrstream seg faults when using -malign-
                    double flag
           Product: gcc
           Version: 2.95.2
            Status: UNCONFIRMED
          Severity: normal
          Priority: P2
         Component: libstdc++
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: peter dot hedinger at st dot com
                CC: gcc-bugs at gcc dot gnu dot org
  GCC host triplet: Linux hicks 2.4.7-10custom #4 SMP Thu Nov 28 16:10:26
                    GMT 2002 i


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=17200


             reply	other threads:[~2004-08-26 11:55 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-08-26 11:55 peter dot hedinger at st dot com [this message]
2004-08-26 12:13 ` [Bug libstdc++/17200] " pcarlini at suse dot de
2004-08-26 12:41 ` reichelt at gcc dot gnu dot org
2004-08-26 12:41 ` reichelt at gcc dot gnu dot org

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=20040826115542.17200.peter.hedinger@st.com \
    --to=gcc-bugzilla@gcc.gnu.org \
    --cc=gcc-bugs@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).