public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "sandra at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug libstdc++/65909] New: check_v3_target_namedlocale blows up on targets that don't support command-line arguments
Date: Mon, 27 Apr 2015 22:20:00 -0000	[thread overview]
Message-ID: <bug-65909-4@http.gcc.gnu.org/bugzilla/> (raw)

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=65909

            Bug ID: 65909
           Summary: check_v3_target_namedlocale blows up on targets that
                    don't support command-line arguments
           Product: gcc
           Version: 4.9.2
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: libstdc++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: sandra at gcc dot gnu.org
  Target Milestone: ---

Created attachment 35410
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=35410&action=edit
proposed patch

The test program written by check_v3_target_namedlocale in lib/libstdc++.exp
accesses the string at *(argv + 1) without first checking that argc >= 2.  Some
embedded targets don't support command-line arguments, so even though the
testsuite may always invoke the test program with the required number of
arguments, the program may not receive them.

I'm working with a new simulator provided by a customer that prints an error
message for accesses to unmapped memory and then continues execution instead of
terminating with an exception.  I ended up with a 2.4TB log file from running
the libstdc++ testsuite because of this problem.  :-(

I hacked up the attached patch as a quick fix; it has the effect of making it
think the requested locale is unsupported if the target has this problem.  A
better solution might be to write and compile a fresh program every time with a
hard-coded locale name to test for.  I guess it depends on whether you think
embedded targets that don't support programs with command-line arguments will
still be able to support named locales.

I ran into this in a local GCC 4.9.2 build but the code is the same on mainline
head.


             reply	other threads:[~2015-04-27 22:20 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-04-27 22:20 sandra at gcc dot gnu.org [this message]
2015-04-27 22:46 ` [Bug libstdc++/65909] " sandra at gcc dot gnu.org
2015-04-27 22:46 ` redi at gcc dot gnu.org
2015-04-28  2:41 ` sandra at gcc dot gnu.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=bug-65909-4@http.gcc.gnu.org/bugzilla/ \
    --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).