public inbox for glibc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug libc/11394] New: locale-archive differs between x86_64-linux and i686-linux due to unintentional hash difference
@ 2010-03-17  6:30 cgd at google dot com
  2010-03-17  6:36 ` [Bug libc/11394] " cgd at google dot com
  2010-03-25  0:11 ` drepper at redhat dot com
  0 siblings, 2 replies; 3+ messages in thread
From: cgd at google dot com @ 2010-03-17  6:30 UTC (permalink / raw)
  To: glibc-bugs

locale-archive files generated on x86_64-linux and i686-linux differ
unnecessarily, due a likely-unintentional hash difference.

they're compatible with each other AFAICT, but they aren't identical when built
fresh (and they easily could be).

to repro:
configure / build glibc for i686-linux and x86_64-linux.
in each, install locale data & create a locale-archive file by doing:
  make localedata/install-locales 'SUPPORTED-LOCALES=en_US/ISO-8859-1
en_US.UTF-8/UTF-8'

compare the locale-archive files.  They're much the same, but the
_NL_CTYPE_WIDTH tables are different.  in particular, some of the early
(high-level) 3level table entries have different order, and thus later data in
the file also differs.  However, each is usable/correct.

the wcwidth_table 3level table is constructed by iterating charmap->char_table
(a simple-hash).

the iteration order depends order of entries in the table, which depends on the
compute_hashval hash function (whose result is modded by the table size).

the version of compute_hashval used for simple-hash returns unsigned long int,
and the computed hash value differs between i686 and x86_64, so the 3level table
gets populated in a different order, ...

the hash table in this case doesn't make it to disk, so it's safe to tweak the
return type.  (the hashes that use compute_hashval and *do* make it to disk use
uint32_t already.)

while it's not strictly necessary to fix this, it's comforting to see identical
results when building on 32-bit and 64-bit.  will attach patch.

-- 
           Summary: locale-archive differs between x86_64-linux and i686-
                    linux due to unintentional hash difference
           Product: glibc
           Version: 2.12
            Status: NEW
          Severity: normal
          Priority: P2
         Component: libc
        AssignedTo: drepper at redhat dot com
        ReportedBy: cgd at google dot com
                CC: glibc-bugs at sources dot redhat dot com
 GCC build triplet: x86_64-linux
  GCC host triplet: x86_64-linux
GCC target triplet: x86_64-linux and i686-linux


http://sourceware.org/bugzilla/show_bug.cgi?id=11394

------- You are receiving this mail because: -------
You are on the CC list for the bug, or are watching someone who is.


^ permalink raw reply	[flat|nested] 3+ messages in thread

* [Bug libc/11394] locale-archive differs between x86_64-linux and i686-linux due to unintentional hash difference
  2010-03-17  6:30 [Bug libc/11394] New: locale-archive differs between x86_64-linux and i686-linux due to unintentional hash difference cgd at google dot com
@ 2010-03-17  6:36 ` cgd at google dot com
  2010-03-25  0:11 ` drepper at redhat dot com
  1 sibling, 0 replies; 3+ messages in thread
From: cgd at google dot com @ 2010-03-17  6:36 UTC (permalink / raw)
  To: glibc-bugs


------- Additional Comments From cgd at google dot com  2010-03-17 06:36 -------
Created an attachment (id=4665)
 --> (http://sourceware.org/bugzilla/attachment.cgi?id=4665&action=view)
patch which resolves the issue (apply from top-level with patch -p0).


-- 


http://sourceware.org/bugzilla/show_bug.cgi?id=11394

------- You are receiving this mail because: -------
You are on the CC list for the bug, or are watching someone who is.


^ permalink raw reply	[flat|nested] 3+ messages in thread

* [Bug libc/11394] locale-archive differs between x86_64-linux and i686-linux due to unintentional hash difference
  2010-03-17  6:30 [Bug libc/11394] New: locale-archive differs between x86_64-linux and i686-linux due to unintentional hash difference cgd at google dot com
  2010-03-17  6:36 ` [Bug libc/11394] " cgd at google dot com
@ 2010-03-25  0:11 ` drepper at redhat dot com
  1 sibling, 0 replies; 3+ messages in thread
From: drepper at redhat dot com @ 2010-03-25  0:11 UTC (permalink / raw)
  To: glibc-bugs


------- Additional Comments From drepper at redhat dot com  2010-03-25 00:11 -------
I've applied the patch.

-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|                            |FIXED


http://sourceware.org/bugzilla/show_bug.cgi?id=11394

------- You are receiving this mail because: -------
You are on the CC list for the bug, or are watching someone who is.


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2010-03-25  0:11 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-03-17  6:30 [Bug libc/11394] New: locale-archive differs between x86_64-linux and i686-linux due to unintentional hash difference cgd at google dot com
2010-03-17  6:36 ` [Bug libc/11394] " cgd at google dot com
2010-03-25  0:11 ` drepper at redhat dot com

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).