After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 317754 - Test convert-test violates assertion test_one_half on Solaris 9
Test convert-test violates assertion test_one_half on Solaris 9
Status: RESOLVED DUPLICATE of bug 790698
Product: glib
Classification: Platform
Component: i18n
2.8.x
Other opensolaris
: Normal normal
: ---
Assigned To: gtkdev
gtkdev
: 318019 (view as bug list)
Depends on:
Blocks:
 
 
Reported: 2005-10-02 17:23 UTC by David Hollenberg
Modified: 2018-02-01 14:15 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description David Hollenberg 2005-10-02 17:23:38 UTC
Distribution/Version: 5.9

Compiling glib-2.8.2 on Solaris 9 (with gcc 3.3.2) works fine,
but when I run the tests via "gmake check", one test fails.
The test that fails is convert-test.  Output is
** ERROR **: file convert-test.c: line 80 (test_one_half): assertion failed:
(error && error->code == G_CONVERT_ERROR_ILLEGAL_SEQUENCE)
Comment 1 Matthias Clasen 2005-10-26 14:45:53 UTC
*** Bug 318019 has been marked as a duplicate of this bug. ***
Comment 2 Matthias Clasen 2006-12-18 03:21:39 UTC
It would be good to know if the problem is simply that the iconv implementation on your system does not support the encoding that is used in the test.
Comment 3 Thomas Klausner 2006-12-18 07:00:37 UTC
I ran the test for glib-2.12.3 on NetBSD-4.99.6/amd64, it still dumps core.
I grepped the output of "iconv -l":
# iconv -l | grep -i -e  UTF-8 -e CP1255 -e ISO-8859-1 -e ISO-8859-15 -e UTF-16 
cp1255
iso-8859-1
iso-8859-10
iso-8859-11
iso-8859-13
iso-8859-14
iso-8859-15
iso-8859-16
mscp1255
utf-16
utf-16be
utf-16le
utf-8

It seems that all used encodings are supported.
Comment 4 Niels Thykier 2009-05-14 08:43:38 UTC
Our university's Solaris machine also fails this test though at line 81 (I am trying to compile glib2.12.12 instead 2.8.2, so I assume that is the reason for the off by one, since the statement is identical)

OS: SunOS dev1 5.10 Generic_137137-09 sun4u sparc SUNW,A70
I have tried with both
  cc: Sun C 5.9 SunOS_sparc Patch 124867-09 2008/11/25
and
  gcc/(gccfss): sparc-sun-solaris2.10-gcc (GCC) 4.2.0 (gccfss)

I believe the latter is actually just a GCC front-end for a Solaris C-compiler.

With a bit of commenting and compiling I have learned that only the last two (out of three tests) of test_one_half() in "convert-test.c" fails. As far as I can tell, the problem seems to be that "ISO-8859-15" -> "UTF-8" does not trigger an "Illegal Sequence" error in the input "\xc2\xbd". Changing "ISO-8859-15" into "ASCII" (which I assumed did not know those byte-values) does not trigger this error either. 

Furthermore, I got the following warnings:


"convert-test.c", line 104: warning: initializer does not fit or is out of range: 254
... (+2 more for that line)
"convert-test.c", line 105: warning: initializer does not fit or is out of range: 255
...(+2 more for that line)

Replacing 104 and 105 with this:
  gchar in_be[4] = { (gchar) (0xfe & 0xff), (gchar)(0xff & 0xff), 0x03, (gchar)(0x93 & 0xff)}; /* capital gamma */
  gchar in_le[4] = { (gchar)(0xff & 0xff), (gchar)(0xfe & 0xff), (gchar)(0x93 & 0xff), 0x03};

Removed the issue. The test is successful with and without this change on this machine, but I figured it might cause issues on other machines.

~NT
Comment 5 Philip Withnall 2018-02-01 14:15:35 UTC
This looks very suspiciously similar to bug #790698, which is caused by the iconv() behaviour differing between Linux and other platforms in how input is handled which contains characters which are valid in the input encoding, but have no representation in the output encoding.

There’s a set of patches to fix this in bug #790698. I’ll close this bug as a duplicate of that one; if those patches do not fix the issue here, please reopen this bug. Thanks.

*** This bug has been marked as a duplicate of bug 790698 ***