From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 103301 invoked by alias); 2 Aug 2015 13:57:41 -0000 Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-bugs-owner@gcc.gnu.org Received: (qmail 103271 invoked by uid 48); 2 Aug 2015 13:57:37 -0000 From: "gnugcc at marino dot st" To: gcc-bugs@gcc.gnu.org Subject: [Bug libstdc++/67096] New: libstdc++ testsuite, codecvt: many UTF-8 tests illegal (testing bytes 5 and 6) Date: Sun, 02 Aug 2015 13:57:00 -0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: libstdc++ X-Bugzilla-Version: 6.0 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: gnugcc at marino dot st X-Bugzilla-Status: UNCONFIRMED X-Bugzilla-Resolution: X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: bug_id short_desc product version bug_status bug_severity priority component assigned_to reporter target_milestone Message-ID: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 7bit X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 X-SW-Source: 2015-08/txt/msg00039.txt.bz2 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=67096 Bug ID: 67096 Summary: libstdc++ testsuite, codecvt: many UTF-8 tests illegal (testing bytes 5 and 6) Product: gcc Version: 6.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: libstdc++ Assignee: unassigned at gcc dot gnu.org Reporter: gnugcc at marino dot st Target Milestone: --- Using the pending locale patch set for DragonFly[1], I've been running testsuite frequently. After an update to libc to support LC_CTYPE better, we suffered a large test regression. For example, 22_locale/codecvt/length/wchar_t/4.cc started failing. I modified the test noting that as long as int_type is limited to < 0x200000, the test passes. If it's over 0x200000, it fails. This test, and many similar to it tests: 0x200000 0x400000 0x800000 0x1000000 0x2000000 0x4000000 0x8000000 0x10000000 0x20000000 0x40000000 The reason for the failure is the libc rejects > 4 bytes as illegal, as it should. According to wiki[2]: "The original specification covered numbers up to 31 bits (the original limit of the Universal Character Set). In November 2003, UTF-8 was restricted by RFC 3629 to end at U+10FFFF, in order to match the constraints of the UTF-16 character encoding. This removed all 5- and 6-byte sequences, and about half of the 4-byte sequences." The test is setting the locale to "en_US.UTF-8" which by definition is limited to 4-byte numbers. Thus, testing any number 0x200000 or greater is illegal and should not be done. This probably affects several tests that are making the same mistake. [1] https://gcc.gnu.org/ml/gcc-patches/2015-07/msg02678.html [2] https://en.wikipedia.org/wiki/UTF-8