libstdc++/4503: __enc_traits destructor crashes if initialisation failed
ben.hutchings@roundpoint.com
ben.hutchings@roundpoint.com
Mon Oct 8 08:56:00 GMT 2001
>Number: 4503
>Category: libstdc++
>Synopsis: __enc_traits destructor crashes if initialisation failed
>Confidential: no
>Severity: serious
>Priority: medium
>Responsible: unassigned
>State: open
>Class: sw-bug
>Submitter-Id: net
>Arrival-Date: Mon Oct 08 08:56:01 PDT 2001
>Closed-Date:
>Last-Modified:
>Originator: ben.hutchings@roundpoint.com
>Release: gcc-3.0.1
>Organization:
>Environment:
Solaris 8 on SPARC
>Description:
__enc_traits::~__enc_traits() calls iconv_close() on each of its iconv_t members. On Solaris, iconv_close crashes if given the error value (iconv_t)(-1), rather than doing nothing (as one might expect). I'm unclear on what public functions utilise__enc_traits. The test programs 22_locale/codecvt_unicode_*.cc use it directly and crash on Solaris (after I apply kluges so that _GLIBCPP_USE_WCHAR_T is defined), so I've written a trivial test case based on that.
>How-To-Repeat:
Compile and run the attached file test.cc
>Fix:
Make each iconv_close call conditional on the descriptor not being equal to (iconv_t)(-1).
>Release-Note:
>Audit-Trail:
>Unformatted:
----gnatsweb-attachment----
Content-Type: application/octet-stream; name="test.cc"
Content-Transfer-Encoding: base64
Content-Disposition: attachment; filename="test.cc"
I2luY2x1ZGUgPGxvY2FsZT4KaW50IG1haW4oKQp7CiAgICBzdGQ6Ol9fZW5jX3RyYWl0cyB0cmFp
dHMoImZvbyIsImJhciIpOyAvLyBub24tZXhpc3RlbnQgZW5jb2RpbmdzCiAgICB0cmFpdHMuX01f
aW5pdCgpOwp9Cg==
More information about the Gcc-prs
mailing list