Bug 166564 - Wrong default allocator in ext/hash_map
Wrong default allocator in ext/hash_map
Status: CLOSED WONTFIX
Product: Fedora
Classification: Fedora
Component: gcc (Show other bugs)
3
i386 Linux
medium Severity medium
: ---
: ---
Assigned To: Benjamin Kosnik
http://gcc.gnu.org/bugzilla/show_bug....
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2005-08-23 08:08 EDT by Mattias Ellert
Modified: 2013-08-09 01:47 EDT (History)
3 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2006-07-12 13:36:19 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)
The testcase that exemplifies the error (438 bytes, text/plain)
2005-08-23 08:11 EDT, Mattias Ellert
no flags Details
Patch against the gcc 3.4.4 STL headers (889 bytes, patch)
2005-08-23 08:11 EDT, Mattias Ellert
no flags Details | Diff


External Trackers
Tracker ID Priority Status Summary Last Updated
GNU Compiler Collection 23528 None None None Never

  None (edit)
Description Mattias Ellert 2005-08-23 08:08:57 EDT
From Bugzilla Helper:
User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.7.10) Gecko/20050720 Fedora/1.0.6-1.1.fc3 Firefox/1.0.6

Description of problem:
he attached testcase compiles and runs correctly with gcc 3.3.4, but gives the
following compilation errors with gcc 3.4.4:

hashtest.cxx: In function `int main()':
hashtest.cxx:11: error: cannot convert `int*' to `std::pair<const int, int>*' in
initialization
hashtest.cxx:12: error: no matching function for call to
`std::allocator<int>::construct(std::pair<const int, int>*&, std::pair<const
int, int>&)'
/usr/lib/gcc/i386-redhat-linux/3.4.4/../../../../include/c++/3.4.4/ext/new_allocator.h:96:
note: candidates are: void __gnu_cxx::new_allocator<_Tp>::construct(_Tp*, const
_Tp&) [with _Tp = int]
hashtest.cxx:17: error: no matching function for call to
`std::allocator<int>::destroy(std::pair<const int, int>*&)'
/usr/lib/gcc/i386-redhat-linux/3.4.4/../../../../include/c++/3.4.4/ext/new_allocator.h:99:
note: candidates are: void __gnu_cxx::new_allocator<_Tp>::destroy(_Tp*) [with
_Tp = int]
hashtest.cxx:18: error: no matching function for call to
`std::allocator<int>::deallocate(std::pair<const int, int>*&, int)'
/usr/lib/gcc/i386-redhat-linux/3.4.4/../../../../include/c++/3.4.4/ext/new_allocator.h:86:
note: candidates are: void __gnu_cxx::new_allocator<_Tp>::deallocate(_Tp*,
size_t) [with _Tp = int]

The reason for the errors are wrong default allocators in ext/hash_map. A patch
that fixes the problem is attached.

Version-Release number of selected component (if applicable):
libstdc++-devel-3.4.4-2.fc3

How reproducible:
Always

Steps to Reproduce:
Compile the testcase attached.

Additional info:

The bug has been reported to gcc gnu bugzilla too:

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=23528
Comment 1 Mattias Ellert 2005-08-23 08:11:14 EDT
Created attachment 117998 [details]
The testcase that exemplifies the error

It fails with gcc 3.4.4 but works correctly with gcc 3.3.4
Comment 2 Mattias Ellert 2005-08-23 08:11:51 EDT
Created attachment 117999 [details]
Patch against the gcc 3.4.4 STL headers

With this patch applied to gcc 3.4.4 it compiles correctly with this compiler
too.
Comment 3 Benjamin Kosnik 2005-09-06 15:14:39 EDT
This is fixed in the current gcc-3_4-branch libstdc++ with:

2005-08-29  Paolo Carlini  <pcarlini@suse.de>

        PR libstdc++/23528
        Port from HEAD/4_0-branch:
	2004-07-28  Matt Austern  <austern@apple.com>
	* include/ext/hashtable.h: Use rebind so that allocator_type
	has correct type for a container's allocator.
	* testsuite/ext/23528.cc: New.
Comment 4 Matthew Miller 2006-07-10 16:59:33 EDT
Fedora Core 3 is now maintained by the Fedora Legacy project for security
updates only. If this problem is a security issue, please reopen and
reassign to the Fedora Legacy product. If it is not a security issue and
hasn't been resolved in the current FC5 updates or in the FC6 test
release, reopen and change the version to match.

Thank you!
Comment 5 Benjamin Kosnik 2006-07-12 13:36:19 EDT
3.4.0 libstdc++ is currently in deep freeze. Since this is fixed in upstream, ok
to close.

Note You need to log in before you can comment on or make changes to this bug.