Bug 33633 - [4.3 Regression] -D_GLIBCXX_DEBUG vs ext/hash_*
Summary: [4.3 Regression] -D_GLIBCXX_DEBUG vs ext/hash_*
Status: RESOLVED FIXED
Alias: None
Product: gcc
Classification: Unclassified
Component: libstdc++ (show other bugs)
Version: 4.3.0
: P3 normal
Target Milestone: ---
Assignee: Benjamin Kosnik
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2007-10-02 22:26 UTC by Paolo Carlini
Modified: 2007-10-10 17:57 UTC (History)
2 users (show)

See Also:
Host:
Target:
Build:
Known to work:
Known to fail:
Last reconfirmed: 2007-10-03 00:37:10


Attachments
EXT to EXT_D (1.19 KB, patch)
2007-10-09 23:08 UTC, Benjamin Kosnik
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Paolo Carlini 2007-10-02 22:26:04 UTC
Hi. Likely due to the recent changes / extensions to the namespace association mechanisms to accomodate the parallel STL, the legacy hashed containers are not usable anymore in debug mode. Just compile with -D_GLIBCXX_DEBUG:

#include <ext/hash_map>
#include <ext/hash_set>
Comment 1 Benjamin Kosnik 2007-10-03 00:37:10 UTC
I'll take a look at this.
Comment 2 Benjamin Kosnik 2007-10-09 23:07:39 UTC
Here's my plan for the legacy hash containers:

1) port debug mode to tr1 associative containers
2) move ext/hash containers to deprecated

Thoughts?

Anyway.

This issue is a macro name mix-up. Here's I'll check in the attached fix shortly.

best,
benjamin
Comment 3 Benjamin Kosnik 2007-10-09 23:08:45 UTC
Created attachment 14333 [details]
EXT to EXT_D
Comment 4 Paolo Carlini 2007-10-10 09:19:15 UTC
(In reply to comment #2)
> Here's my plan for the legacy hash containers:
> 
> 1) port debug mode to tr1 associative containers
> 2) move ext/hash containers to deprecated
> 
> Thoughts?

Certainly, I agree with the (mid term?) plan!

> Anyway.
> 
> This issue is a macro name mix-up. Here's I'll check in the attached fix
> shortly.

... short term, however, seems a good idea manage to keep the ext facilities working (well, our own testsuite infrastructure still uses the hash_* containers and adding -D_GLIBCXX_DEBUG to the testing switches broke testing completely, that's how I actually noticed ;)
Comment 5 Benjamin Kosnik 2007-10-10 15:24:15 UTC
Subject: Bug 33633

Author: bkoz
Date: Wed Oct 10 15:23:59 2007
New Revision: 129210

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=129210
Log:
2007-10-10  Benjamin Kosnik  <bkoz@redhat.com>

	PR libstdc++/33633
	* include/debug/hash_multimap.h: Change _GLIBCXX_EXT to _GLIBCXX_EXT_D.
	* include/debug/hash_set.h: Same.
	* include/debug/hash_multiset.h: Same.
	* include/debug/hash_map.h: Same.

2007-10-10  Benjamin Kosnik  <bkoz@redhat.com>

	* include/parallel/losertree.h (loser_tree_traits_unguarded): To 
	loser_tree_unguarded_traits.
	* include/parallel/multiway_merge.h (__gnu_parallel): Same.


Modified:
    trunk/libstdc++-v3/ChangeLog
    trunk/libstdc++-v3/include/debug/hash_map.h
    trunk/libstdc++-v3/include/debug/hash_multimap.h
    trunk/libstdc++-v3/include/debug/hash_multiset.h
    trunk/libstdc++-v3/include/debug/hash_set.h
    trunk/libstdc++-v3/include/parallel/losertree.h
    trunk/libstdc++-v3/include/parallel/multiway_merge.h

Comment 6 Benjamin Kosnik 2007-10-10 15:49:05 UTC
Fixed. 

Current debug mode results (ie, with make CXXFLAGS="-D_GLIBCXX_DEBUG" check)

FAIL: 20_util/pair/moveable.cc execution test
FAIL: 23_containers/deque/moveable.cc execution test
FAIL: 23_containers/headers/bitset/synopsis.cc (test for excess errors)
FAIL: 23_containers/headers/deque/synopsis.cc (test for excess errors)
FAIL: 23_containers/headers/list/synopsis.cc (test for excess errors)
FAIL: 23_containers/headers/map/synopsis.cc (test for excess errors)
FAIL: 23_containers/headers/set/synopsis.cc (test for excess errors)
FAIL: 23_containers/headers/vector/synopsis.cc (test for excess errors)
FAIL: 23_containers/list/moveable.cc execution test
FAIL: 23_containers/map/moveable.cc execution test
FAIL: 23_containers/map/operators/1_neg.cc  (test for errors, line 210)
FAIL: 23_containers/map/operators/1_neg.cc  (test for errors, line 214)
FAIL: 23_containers/multimap/moveable.cc execution test
FAIL: 23_containers/multiset/moveable.cc execution test
FAIL: 23_containers/set/moveable.cc execution test
FAIL: 23_containers/set/operators/1_neg.cc  (test for errors, line 285)
FAIL: 23_containers/set/operators/1_neg.cc  (test for errors, line 289)
FAIL: 23_containers/vector/bool/capacity/29134.cc (test for excess errors)
WARNING: 23_containers/vector/bool/capacity/29134.cc compilation failed to produce executable
FAIL: 23_containers/vector/bool/modifiers/insert/31370.cc (test for excess errors)
WARNING: 23_containers/vector/bool/modifiers/insert/31370.cc compilation failed to produce executable
FAIL: 23_containers/vector/moveable.cc execution test
WARNING: program timed out.
FAIL: 25_algorithms/nth_element/2.cc execution test
XPASS: 26_numerics/headers/cmath/c99_classification_macros_c.cc (test for excess errors)
WARNING: program timed out.
FAIL: ext/pb_ds/example/erase_if.cc execution test
FAIL: ext/pb_ds/example/hash_illegal_resize.cc execution test
FAIL: ext/pb_ds/example/hash_mod.cc execution test
FAIL: ext/pb_ds/example/hash_shift_mask.cc execution test
FAIL: ext/pb_ds/example/ranged_hash.cc execution test
FAIL: ext/pb_ds/regression/hash_data_map_rand.cc execution test
FAIL: ext/pb_ds/regression/hash_no_data_map_rand.cc execution test
FAIL: ext/pb_ds/regression/priority_queue_rand.cc execution test
FAIL: ext/pb_ds/regression/tree_data_map_rand.cc execution test
FAIL: ext/pb_ds/regression/tree_no_data_map_rand.cc execution test
FAIL: ext/pb_ds/regression/trie_data_map_rand.cc execution test
FAIL: ext/pb_ds/regression/trie_no_data_map_rand.cc execution test

                === libstdc++ Summary ===

# of expected passes            5328
# of unexpected failures        33
# of unexpected successes       1
# of expected failures          57
# of unsupported tests          18


The pb_ds code fails are related to _GLIBCXX_DEBUG, but not debug-mode. 

The "synopsis.cc" fails are actually testing something illegal: user-defined forward declarations, so they can be ignored. 

These are decent results, but not spectacular.

-benjamin
Comment 7 Paolo Carlini 2007-10-10 15:52:54 UTC
Yes, time to fix the moveable.cc tests in debug-mode. Thanks.
Comment 8 Paolo Carlini 2007-10-10 17:36:32 UTC
The moveable.cc fails are now fixed. Otherwise, a couple of fails are also trivial

23_containers/vector/bool/capacity/29134.cc
23_containers/vector/bool/modifiers/insert/31370.cc

_S_word_size in the wrong namespace. 

And

25_algorithms/nth_element/2.cc

it's just slow in debug-mode, succeeds after ~1 min for me.
Comment 9 Benjamin Kosnik 2007-10-10 17:56:34 UTC
Sweet, thanks. Any chance you could put in the 

23_containers/vector/bool/capacity/29134.cc
23_containers/vector/bool/modifiers/insert/31370.cc

fix too? My sources are in pre-deprecate mode right now...

best,
benjamin
Comment 10 Paolo Carlini 2007-10-10 17:57:40 UTC
I don't have a fix ;) Everything seems rather ugly and not worth the trouble...