Bug 76779 - Source: testsuite: bad test roundtrip.c
Source: testsuite: bad test roundtrip.c
Status: CLOSED RAWHIDE
Product: Red Hat Linux
Classification: Retired
Component: libunicode (Show other bugs)
7.2
ia64 Linux
medium Severity medium
: ---
: ---
Assigned To: Owen Taylor
Brian Brock
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2002-10-26 07:48 EDT by Sysoltsev Slawa
Modified: 2007-04-18 12:47 EDT (History)
0 users

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2002-10-26 08:17:34 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)
Patch to fix type of size variables in roundtrip test (262 bytes, patch)
2002-10-26 07:51 EDT, Sysoltsev Slawa
no flags Details | Diff
Patch to fix problem with using 32bit types when 64bit needed (933 bytes, patch)
2002-10-26 08:17 EDT, Sysoltsev Slawa
no flags Details | Diff

  None (edit)
Description Sysoltsev Slawa 2002-10-26 07:48:15 EDT
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 07:51:59 EDT
Created attachment 82205 [details]
Patch to fix type of size variables in roundtrip test
Comment 2 Sysoltsev Slawa 2002-10-26 08:16:23 EDT
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 08:17:28 EDT
Created attachment 82206 [details]
Patch to fix problem with using 32bit types when 64bit needed
Comment 4 Owen Taylor 2002-10-31 18:23:17 EST
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.

Note You need to log in before you can comment on or make changes to this bug.