Bug 76779 - Source: testsuite: bad test roundtrip.c
Summary: Source: testsuite: bad test roundtrip.c
Keywords:
Status: CLOSED RAWHIDE
Alias: None
Product: Red Hat Linux
Classification: Retired
Component: libunicode
Version: 7.2
Hardware: ia64
OS: Linux
medium
medium
Target Milestone: ---
Assignee: Owen Taylor
QA Contact: Brian Brock
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2002-10-26 11:48 UTC by Sysoltsev Slawa
Modified: 2007-04-18 16:47 UTC (History)
0 users

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2002-10-26 12:17:34 UTC
Embargoed:


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

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.



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