public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug libstdc++/65909] New: check_v3_target_namedlocale blows up on targets that don't support command-line arguments
@ 2015-04-27 22:20 sandra at gcc dot gnu.org
  2015-04-27 22:46 ` [Bug libstdc++/65909] " sandra at gcc dot gnu.org
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: sandra at gcc dot gnu.org @ 2015-04-27 22:20 UTC (permalink / raw)
  To: gcc-bugs

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.


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

* [Bug libstdc++/65909] check_v3_target_namedlocale blows up on targets that don't support command-line arguments
  2015-04-27 22:20 [Bug libstdc++/65909] New: check_v3_target_namedlocale blows up on targets that don't support command-line arguments sandra at gcc dot gnu.org
  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
  2 siblings, 0 replies; 4+ messages in thread
From: redi at gcc dot gnu.org @ 2015-04-27 22:46 UTC (permalink / raw)
  To: gcc-bugs

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

Jonathan Wakely <redi at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |NEW
   Last reconfirmed|                            |2015-04-27
     Ever confirmed|0                           |1

--- Comment #1 from Jonathan Wakely <redi at gcc dot gnu.org> ---
Ouch! The quick fix patch is OK to commit if you want to do so, it's certainly
an improvement over what we have now.


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

* [Bug libstdc++/65909] check_v3_target_namedlocale blows up on targets that don't support command-line arguments
  2015-04-27 22:20 [Bug libstdc++/65909] New: check_v3_target_namedlocale blows up on targets that don't support command-line arguments sandra at gcc dot gnu.org
@ 2015-04-27 22:46 ` 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
  2 siblings, 0 replies; 4+ messages in thread
From: sandra at gcc dot gnu.org @ 2015-04-27 22:46 UTC (permalink / raw)
  To: gcc-bugs

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

sandra at gcc dot gnu.org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |UNCONFIRMED
   Last reconfirmed|2015-04-27 00:00:00         |
     Ever confirmed|1                           |0

--- Comment #2 from sandra at gcc dot gnu.org ---
Whoops, make that 2.4GB, not TB; I just realized I was confusing 1k blocks with
bytes.


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

* [Bug libstdc++/65909] check_v3_target_namedlocale blows up on targets that don't support command-line arguments
  2015-04-27 22:20 [Bug libstdc++/65909] New: check_v3_target_namedlocale blows up on targets that don't support command-line arguments sandra at gcc dot gnu.org
  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
  2 siblings, 0 replies; 4+ messages in thread
From: sandra at gcc dot gnu.org @ 2015-04-28  2:41 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #3 from sandra at gcc dot gnu.org ---
Author: sandra
Date: Tue Apr 28 02:40:56 2015
New Revision: 222497

URL: https://gcc.gnu.org/viewcvs?rev=222497&root=gcc&view=rev
Log:
2015-04-27  Sandra Loosemore  <sandra@codesourcery.com>

        PR libstdc++/65909

        libstdc++-v3/
        * testsuite/lib/libstdc++.exp (check_v3_target_namedlocale):
        Make the generated test program fail gracefully if the target
        doesn't support passing command-line arguments.

Modified:
    trunk/libstdc++-v3/ChangeLog
    trunk/libstdc++-v3/testsuite/lib/libstdc++.exp


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

end of thread, other threads:[~2015-04-28  2:41 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-04-27 22:20 [Bug libstdc++/65909] New: check_v3_target_namedlocale blows up on targets that don't support command-line arguments sandra at gcc dot gnu.org
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

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