From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 28823 invoked by alias); 14 Feb 2012 14:58:02 -0000 Received: (qmail 28804 invoked by uid 22791); 14 Feb 2012 14:58:00 -0000 X-SWARE-Spam-Status: No, hits=-2.8 required=5.0 tests=ALL_TRUSTED,AWL,BAYES_00,SUBJ_OBFU_PUNCT_FEW X-Spam-Check-By: sourceware.org Received: from localhost (HELO sourceware.org) (127.0.0.1) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Tue, 14 Feb 2012 14:57:06 +0000 From: "matz at suse dot de" To: glibc-bugs@sources.redhat.com Subject: [Bug localedata/13691] New: Assertion with vi_VN.tcvn locale Date: Tue, 14 Feb 2012 14:58:00 -0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: glibc X-Bugzilla-Component: localedata X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: matz at suse dot de X-Bugzilla-Status: NEW X-Bugzilla-Priority: P2 X-Bugzilla-Assigned-To: libc-locales at sources dot redhat.com X-Bugzilla-Target-Milestone: --- X-Bugzilla-Changed-Fields: Message-ID: X-Bugzilla-URL: http://sourceware.org/bugzilla/ Auto-Submitted: auto-generated Content-Type: text/plain; charset="UTF-8" MIME-Version: 1.0 Mailing-List: contact glibc-bugs-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Post: List-Help: , Sender: glibc-bugs-owner@sourceware.org X-SW-Source: 2012-02/txt/msg00075.txt.bz2 http://sourceware.org/bugzilla/show_bug.cgi?id=13691 Bug #: 13691 Summary: Assertion with vi_VN.tcvn locale Product: glibc Version: 2.15 Status: NEW Severity: normal Priority: P2 Component: localedata AssignedTo: libc-locales@sources.redhat.com ReportedBy: matz@suse.de Classification: Unclassified The following program result in an assertion failure in __mbsnrtowcs: % cat bug.c #include #include #include #include #include int main() { const char * string = "Z"; size_t len; wchar_t ignore[1]; const char *str2 = string; const char *strend = string + 1; mbstate_t ps; printf("Locale: %s\n", setlocale(LC_ALL, "vi_VN.tcvn")); memset (&ps, '\0', sizeof (ps)); while (str2 != NULL && str2 < strend) if (mbsnrtowcs (ignore, &str2, strend - str2, 1, &ps) == (size_t) -1) break; return 0; } # ./elf/ld.so --library-path . ./a.out Locale: vi_VN.tcvn a.out: mbsnrtowcs.c:124: __mbsnrtowcs: Assertion `result > 0' failed. Aborted The reason is that the gconv loop doesn't make progress. I.e. somewhere there's a problem in ./iconvdata/tcvn5712-1.c . The assert is here in wcsmbs/mbsnrtowcs.c : status = DL_CALL_FCT (fct, (towc, &data, (const unsigned char **) src, srcend, NULL, &dummy, 0, 1)); result = (wchar_t *) data.__outbuf - dst; /* We have to determine whether the last character converted is the NUL character. */ if ((status == __GCONV_OK || status == __GCONV_EMPTY_INPUT) && (assert (result > 0), status is __GCONV_EMPTY_INPUT, but nothing is written to the output buffer (and it's not incremented). I _think_ this is because of the handling of the buffered character in state->__count. After the iconv call above data.__state->__count is 720, which is 90 << 3, which is the value of the "Z" character. So it's buffered, but it doesn't seem to be emitted to outbuf when the input comes to an end. -- Configure bugmail: http://sourceware.org/bugzilla/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug.