Bug 76779

Summary: Source: testsuite: bad test roundtrip.c
Product: [Retired] Red Hat Linux Reporter: Sysoltsev Slawa <vyatcheslav.sysoltsev>
Component: libunicodeAssignee: Owen Taylor <otaylor>
Status: CLOSED RAWHIDE QA Contact: Brian Brock <bbrock>
Severity: medium Docs Contact:
Priority: medium    
Version: 7.2   
Target Milestone: ---   
Target Release: ---   
Hardware: ia64   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2002-10-26 12:17:34 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Attachments:
Description Flags
Patch to fix type of size variables in roundtrip test
none
Patch to fix problem with using 32bit types when 64bit needed none

Description Sysoltsev Slawa 2002-10-26 11:48:15 UTC
From Bugzilla Helper:
User-Agent: Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.0)

Description of problem:
When I run 'make check' in libunicode source directory I receive failed 
(sometimes with segmentaton fault, sometimes just failed) test roundtrip.
Because failed builtin-test means possible bug in application, I've 
investigated the fault's reason and found that there is just the bug in test.

In roundtrip.c unicode_iconv function is used in line 53. unicode_iconv 
function requires pointers to size_t variables describing sizes of input and 
output buffers (size_t *inbytesleft, size_t *outbytesleft in unicode_iconv 
declaration (convert.c:142)), but reference to int variables (int from_size, 
to_size; - declared int roundtrip.c:36) is passed as parameters. On IA64 int is 
32bit width while size_t is 64bit width, so elder 32bits of size variables in 
unicode_iconv is used uninitialized. Because of it enormously big values income 
into unicode_iconv and program fails with segm fault or works incorrectly 
trying to process a lot of memory. That's bug that should fixed in test suite - 
I'll attach the patch, which changes type of from_size and to_size variables 
from int to size_t. With it libunicode becomes pass 'make check'.

Version-Release number of selected component (if applicable):


How reproducible:
Always

Steps to Reproduce:
1. 'make check' in libunicode source directory


Actual Results:  ...
PASS: ordering
PASS: cxxsmoke
8859-1:01
FAIL: roundtrip
PASS: tinyiconv
PASS: utf8
PASS: ucs4
===================
1 of 6 tests failed
===================
...

Expected Results:  ...
PASS: ordering
PASS: cxxsmoke
PASS: roundtrip
PASS: tinyiconv
PASS: utf8
PASS: ucs4
==================
All 6 tests passed
==================
...

Additional info:

Comment 1 Sysoltsev Slawa 2002-10-26 11:51:59 UTC
Created attachment 82205 [details]
Patch to fix type of size variables in roundtrip test

Comment 2 Sysoltsev Slawa 2002-10-26 12:16:23 UTC
Also I encountered such error in other two test. I'll attach patch to fix them 
(int is changed size_t where necessary).

Comment 3 Sysoltsev Slawa 2002-10-26 12:17:28 UTC
Created attachment 82206 [details]
Patch to fix problem with using 32bit types when 64bit needed

Comment 4 Owen Taylor 2002-10-31 23:23:17 UTC
libunicode is neither maintained upstream or used for almost
anything in the distribution. (The dia diagramming package
is the sole exception.)

None-the-less committed the patch to GNOME CVS (I was the
last upstream maintainer, as it turns out) and put it 
in our package.