public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug libstdc++/21674] New: basic_string vs debug_mode
@ 2005-05-20 2:08 pcarlini at suse dot de
2005-05-21 14:14 ` [Bug libstdc++/21674] " pinskia at gcc dot gnu dot org
` (9 more replies)
0 siblings, 10 replies; 12+ messages in thread
From: pcarlini at suse dot de @ 2005-05-20 2:08 UTC (permalink / raw)
To: gcc-bugs
Just to keep track of this tough issue, discussed in:
http://gcc.gnu.org/ml/libstdc++/2005-05/msg00192.html
In a nutshell, this testcase doesn't assert and should:
#define _GLIBCXX_DEBUG
#include <string>
int main()
{
std::string s;
s[1];
}
(change std::string to std::basic_string<short> and it does)
--
Summary: basic_string vs debug_mode
Product: gcc
Version: 4.0.0
Status: UNCONFIRMED
Severity: normal
Priority: P2
Component: libstdc++
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: pcarlini at suse dot de
CC: gcc-bugs at gcc dot gnu dot org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=21674
^ permalink raw reply [flat|nested] 12+ messages in thread
* [Bug libstdc++/21674] basic_string vs debug_mode
2005-05-20 2:08 [Bug libstdc++/21674] New: basic_string vs debug_mode pcarlini at suse dot de
@ 2005-05-21 14:14 ` pinskia at gcc dot gnu dot org
2005-05-24 4:35 ` bkoz at gcc dot gnu dot org
` (8 subsequent siblings)
9 siblings, 0 replies; 12+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2005-05-21 14:14 UTC (permalink / raw)
To: gcc-bugs
------- Additional Comments From pinskia at gcc dot gnu dot org 2005-05-21 14:13 -------
Confirmed.
--
What |Removed |Added
----------------------------------------------------------------------------
Status|UNCONFIRMED |NEW
Ever Confirmed| |1
Last reconfirmed|0000-00-00 00:00:00 |2005-05-21 14:13:55
date| |
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=21674
^ permalink raw reply [flat|nested] 12+ messages in thread
* [Bug libstdc++/21674] basic_string vs debug_mode
2005-05-20 2:08 [Bug libstdc++/21674] New: basic_string vs debug_mode pcarlini at suse dot de
2005-05-21 14:14 ` [Bug libstdc++/21674] " pinskia at gcc dot gnu dot org
@ 2005-05-24 4:35 ` bkoz at gcc dot gnu dot org
2005-05-24 9:27 ` pcarlini at suse dot de
` (7 subsequent siblings)
9 siblings, 0 replies; 12+ messages in thread
From: bkoz at gcc dot gnu dot org @ 2005-05-24 4:35 UTC (permalink / raw)
To: gcc-bugs
------- Additional Comments From bkoz at gcc dot gnu dot org 2005-05-24 04:22 -------
Dudes, just a quick pass at this.
a.out:
/usr/lib/gcc/i386-redhat-linux/3.4.3/../../../../include/c++/3.4.3/bits/basic_string.h:643:
typename _Alloc::reference std::basic_string<_CharT, _Traits,
_Alloc>::operator[](typename _Alloc::size_type) [with _CharT = char, _Traits =
std::char_traits<char>, _Alloc = std::allocator<char>]: Assertion `__pos <
size()' failed.
Abort (core dumped)
I get this with 3.4 to mainline with -O1 or -O2.
-benjamin
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=21674
^ permalink raw reply [flat|nested] 12+ messages in thread
* [Bug libstdc++/21674] basic_string vs debug_mode
2005-05-20 2:08 [Bug libstdc++/21674] New: basic_string vs debug_mode pcarlini at suse dot de
2005-05-21 14:14 ` [Bug libstdc++/21674] " pinskia at gcc dot gnu dot org
2005-05-24 4:35 ` bkoz at gcc dot gnu dot org
@ 2005-05-24 9:27 ` pcarlini at suse dot de
2005-05-27 19:28 ` cvs-commit at gcc dot gnu dot org
` (6 subsequent siblings)
9 siblings, 0 replies; 12+ messages in thread
From: pcarlini at suse dot de @ 2005-05-24 9:27 UTC (permalink / raw)
To: gcc-bugs
------- Additional Comments From pcarlini at suse dot de 2005-05-24 08:38 -------
Indeed, Benjamin, I also get this, and that't why probably the issue is not
serious as I was afraid it was. However, we are basically relying on inlining
to happen for this to work, and that's brittle (as Jonathan also pointed out).
At minimum, we have to document this behavior of string debug-mode in the docs...
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=21674
^ permalink raw reply [flat|nested] 12+ messages in thread
* [Bug libstdc++/21674] basic_string vs debug_mode
2005-05-20 2:08 [Bug libstdc++/21674] New: basic_string vs debug_mode pcarlini at suse dot de
` (2 preceding siblings ...)
2005-05-24 9:27 ` pcarlini at suse dot de
@ 2005-05-27 19:28 ` cvs-commit at gcc dot gnu dot org
2005-09-14 1:02 ` bkoz at gcc dot gnu dot org
` (5 subsequent siblings)
9 siblings, 0 replies; 12+ messages in thread
From: cvs-commit at gcc dot gnu dot org @ 2005-05-27 19:28 UTC (permalink / raw)
To: gcc-bugs
------- Additional Comments From cvs-commit at gcc dot gnu dot org 2005-05-27 19:20 -------
Subject: Bug 21674
CVSROOT: /cvs/gcc
Module name: gcc
Changes by: bkoz@gcc.gnu.org 2005-05-27 19:19:47
Modified files:
libstdc++-v3 : ChangeLog
Log message:
2005-05-27 Benjamin Kosnik <bkoz@redhat.com>
PR libstdc++/21674
* include/bits/c++config: Remove extern template use when in debug
mode, disable for non-weak systems.
Patches:
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/libstdc++-v3/ChangeLog.diff?cvsroot=gcc&r1=1.3021&r2=1.3022
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=21674
^ permalink raw reply [flat|nested] 12+ messages in thread
* [Bug libstdc++/21674] basic_string vs debug_mode
2005-05-20 2:08 [Bug libstdc++/21674] New: basic_string vs debug_mode pcarlini at suse dot de
` (3 preceding siblings ...)
2005-05-27 19:28 ` cvs-commit at gcc dot gnu dot org
@ 2005-09-14 1:02 ` bkoz at gcc dot gnu dot org
2005-09-14 3:22 ` cvs-commit at gcc dot gnu dot org
` (4 subsequent siblings)
9 siblings, 0 replies; 12+ messages in thread
From: bkoz at gcc dot gnu dot org @ 2005-09-14 1:02 UTC (permalink / raw)
To: gcc-bugs
--
What |Removed |Added
----------------------------------------------------------------------------
AssignedTo|unassigned at gcc dot gnu |bkoz at gcc dot gnu dot org
|dot org |
Status|NEW |ASSIGNED
Last reconfirmed|2005-05-21 14:13:55 |2005-09-14 01:02:35
date| |
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=21674
^ permalink raw reply [flat|nested] 12+ messages in thread
* [Bug libstdc++/21674] basic_string vs debug_mode
2005-05-20 2:08 [Bug libstdc++/21674] New: basic_string vs debug_mode pcarlini at suse dot de
` (4 preceding siblings ...)
2005-09-14 1:02 ` bkoz at gcc dot gnu dot org
@ 2005-09-14 3:22 ` cvs-commit at gcc dot gnu dot org
2005-09-15 19:00 ` cvs-commit at gcc dot gnu dot org
` (3 subsequent siblings)
9 siblings, 0 replies; 12+ messages in thread
From: cvs-commit at gcc dot gnu dot org @ 2005-09-14 3:22 UTC (permalink / raw)
To: gcc-bugs
------- Additional Comments From cvs-commit at gcc dot gnu dot org 2005-09-14 03:22 -------
Subject: Bug 21674
CVSROOT: /cvs/gcc
Module name: gcc
Changes by: bkoz@gcc.gnu.org 2005-09-14 03:22:17
Modified files:
libstdc++-v3 : ChangeLog
Added files:
libstdc++-v3/testsuite/21_strings/basic_string/element_access/char:
21674.cc
libstdc++-v3/testsuite/21_strings/basic_string/element_access/wchar_t:
21674.cc
Log message:
2005-09-13 Jonathan Wakely <cow@compsoc.man.ac.uk>
Benjamin Kosnik <bkoz@redhat.com>
PR libstdc++/21674
* testsuite/21_strings/basic_string/element_access/char/21674.cc: New.
* testsuite/21_strings/basic_string/element_access/wchar_t/21674.cc:
New.
Patches:
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/libstdc++-v3/ChangeLog.diff?cvsroot=gcc&r1=1.3104&r2=1.3105
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/libstdc++-v3/testsuite/21_strings/basic_string/element_access/char/21674.cc.diff?cvsroot=gcc&r1=NONE&r2=1.1
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/libstdc++-v3/testsuite/21_strings/basic_string/element_access/wchar_t/21674.cc.diff?cvsroot=gcc&r1=NONE&r2=1.1
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=21674
^ permalink raw reply [flat|nested] 12+ messages in thread
* [Bug libstdc++/21674] basic_string vs debug_mode
2005-05-20 2:08 [Bug libstdc++/21674] New: basic_string vs debug_mode pcarlini at suse dot de
` (5 preceding siblings ...)
2005-09-14 3:22 ` cvs-commit at gcc dot gnu dot org
@ 2005-09-15 19:00 ` cvs-commit at gcc dot gnu dot org
2005-09-22 8:28 ` bkoz at gcc dot gnu dot org
` (2 subsequent siblings)
9 siblings, 0 replies; 12+ messages in thread
From: cvs-commit at gcc dot gnu dot org @ 2005-09-15 19:00 UTC (permalink / raw)
To: gcc-bugs
------- Additional Comments From cvs-commit at gcc dot gnu dot org 2005-09-15 18:59 -------
Subject: Bug 21674
CVSROOT: /cvs/gcc
Module name: gcc
Changes by: bkoz@gcc.gnu.org 2005-09-15 18:58:04
Modified files:
libstdc++-v3 : ChangeLog
libstdc++-v3/include/bits: c++config
libstdc++-v3/testsuite/21_strings/basic_string/element_access/char:
21674.cc
libstdc++-v3/testsuite/21_strings/basic_string/element_access/wchar_t:
21674.cc
libstdc++-v3/testsuite/lib: dg-options.exp libstdc++.exp
Log message:
2005-09-15 Benjamin Kosnik <bkoz@redhat.com>
PR libstdc++/21674
PR libstdc++/22205
PR libstdc++/22222
* include/bits/c++config: Set _GLIBCXX_STD regardless of __GXX_WEAK__.
Add in check for __NO_INLINE__ for warning.
* testsuite/lib/dg-options.exp (dg-require-debug-mode): New.
* testsuite/lib/libstdc++.exp (check_v3_target_debug_mode): New.
* testsuite/21_strings/basic_string/element_access/char/21674.cc:
Use it.
* testsuite/21_strings/basic_string/element_access/wchar_t/21674.cc:
Use it.
Patches:
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/libstdc++-v3/ChangeLog.diff?cvsroot=gcc&r1=1.3107&r2=1.3108
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/libstdc++-v3/include/bits/c++config.diff?cvsroot=gcc&r1=1.1408&r2=1.1409
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/libstdc++-v3/testsuite/21_strings/basic_string/element_access/char/21674.cc.diff?cvsroot=gcc&r1=1.1&r2=1.2
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/libstdc++-v3/testsuite/21_strings/basic_string/element_access/wchar_t/21674.cc.diff?cvsroot=gcc&r1=1.1&r2=1.2
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/libstdc++-v3/testsuite/lib/dg-options.exp.diff?cvsroot=gcc&r1=1.5&r2=1.6
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/libstdc++-v3/testsuite/lib/libstdc++.exp.diff?cvsroot=gcc&r1=1.48&r2=1.49
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=21674
^ permalink raw reply [flat|nested] 12+ messages in thread
* [Bug libstdc++/21674] basic_string vs debug_mode
2005-05-20 2:08 [Bug libstdc++/21674] New: basic_string vs debug_mode pcarlini at suse dot de
` (6 preceding siblings ...)
2005-09-15 19:00 ` cvs-commit at gcc dot gnu dot org
@ 2005-09-22 8:28 ` bkoz at gcc dot gnu dot org
2005-09-22 8:49 ` pcarlini at suse dot de
2005-09-22 8:59 ` bkoz at gcc dot gnu dot org
9 siblings, 0 replies; 12+ messages in thread
From: bkoz at gcc dot gnu dot org @ 2005-09-22 8:28 UTC (permalink / raw)
To: gcc-bugs
------- Additional Comments From bkoz at gcc dot gnu dot org 2005-09-22 08:27 -------
Hey Paolo. I consider this fixed for mainline.
I don't want to port this to gcc-4_0-branch. First of all, this isn't a
regression since debug mode was introduced in 3.4 and refined in 4.0.x, but is
essentially the same. In addition, this turned out to be a messy area. Fixing
this took a lot, including the header work to remove cassert and moving all
those patches over to the stable branch is more movement and change than I feel
comfortable with.
So, permission to change to WONTFIX for gcc-4_0-branch and leave as fixed for
gcc-4.1.0?
-benjamin
--
What |Removed |Added
----------------------------------------------------------------------------
Target Milestone|--- |4.1.0
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=21674
^ permalink raw reply [flat|nested] 12+ messages in thread
* [Bug libstdc++/21674] basic_string vs debug_mode
2005-05-20 2:08 [Bug libstdc++/21674] New: basic_string vs debug_mode pcarlini at suse dot de
` (7 preceding siblings ...)
2005-09-22 8:28 ` bkoz at gcc dot gnu dot org
@ 2005-09-22 8:49 ` pcarlini at suse dot de
2005-09-22 8:59 ` bkoz at gcc dot gnu dot org
9 siblings, 0 replies; 12+ messages in thread
From: pcarlini at suse dot de @ 2005-09-22 8:49 UTC (permalink / raw)
To: gcc-bugs
------- Additional Comments From pcarlini at suse dot de 2005-09-22 08:49 -------
Sure! And thanks a lot for your concise and very effective fix!
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=21674
^ permalink raw reply [flat|nested] 12+ messages in thread
* [Bug libstdc++/21674] basic_string vs debug_mode
2005-05-20 2:08 [Bug libstdc++/21674] New: basic_string vs debug_mode pcarlini at suse dot de
` (8 preceding siblings ...)
2005-09-22 8:49 ` pcarlini at suse dot de
@ 2005-09-22 8:59 ` bkoz at gcc dot gnu dot org
9 siblings, 0 replies; 12+ messages in thread
From: bkoz at gcc dot gnu dot org @ 2005-09-22 8:59 UTC (permalink / raw)
To: gcc-bugs
------- Additional Comments From bkoz at gcc dot gnu dot org 2005-09-22 08:58 -------
This is WONTFIX for 4.0.x, but is fixed in 4.1.x and later.
--
What |Removed |Added
----------------------------------------------------------------------------
Status|ASSIGNED |RESOLVED
Resolution| |WONTFIX
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=21674
^ permalink raw reply [flat|nested] 12+ messages in thread
* [Bug libstdc++/21674] basic_string vs debug_mode
[not found] <bug-21674-16141@http.gcc.gnu.org/bugzilla/>
@ 2008-12-14 0:44 ` howarth at nitro dot med dot uc dot edu
0 siblings, 0 replies; 12+ messages in thread
From: howarth at nitro dot med dot uc dot edu @ 2008-12-14 0:44 UTC (permalink / raw)
To: gcc-bugs
------- Comment #10 from howarth at nitro dot med dot uc dot edu 2008-12-14 00:43 -------
Should really be XFAIL'ing this test on targets that don't use glibc? We have
been seeing...
XPASS: 21_strings/basic_string/element_access/char/21674.cc execution test
XPASS: 21_strings/basic_string/element_access/wchar_t/21674.cc execution test
...for this on darwin for ages now. Can't we use something like...
// { dg-do run { xfail *-*-![darwin]* } }
I noticed that testsuite/22_locale/ctype/is/char/2.cc is using a construct of
that form.
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=21674
^ permalink raw reply [flat|nested] 12+ messages in thread
end of thread, other threads:[~2008-12-14 0:44 UTC | newest]
Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2005-05-20 2:08 [Bug libstdc++/21674] New: basic_string vs debug_mode pcarlini at suse dot de
2005-05-21 14:14 ` [Bug libstdc++/21674] " pinskia at gcc dot gnu dot org
2005-05-24 4:35 ` bkoz at gcc dot gnu dot org
2005-05-24 9:27 ` pcarlini at suse dot de
2005-05-27 19:28 ` cvs-commit at gcc dot gnu dot org
2005-09-14 1:02 ` bkoz at gcc dot gnu dot org
2005-09-14 3:22 ` cvs-commit at gcc dot gnu dot org
2005-09-15 19:00 ` cvs-commit at gcc dot gnu dot org
2005-09-22 8:28 ` bkoz at gcc dot gnu dot org
2005-09-22 8:49 ` pcarlini at suse dot de
2005-09-22 8:59 ` bkoz at gcc dot gnu dot org
[not found] <bug-21674-16141@http.gcc.gnu.org/bugzilla/>
2008-12-14 0:44 ` howarth at nitro dot med dot uc dot edu
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).