public inbox for glibc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug libc/776] New: Inconsistent struct gconvcache_header
@ 2005-03-02  1:21 hjl at lucon dot org
  2005-03-03  8:28 ` [Bug libc/776] " drepper at redhat dot com
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: hjl at lucon dot org @ 2005-03-02  1:21 UTC (permalink / raw)
  To: glibc-bugs

In iconvconfig.h, there are

typedef uint16_t gidx_t;


struct gconvcache_header
{
  uint32_t magic;
  gidx_t string_offset;
  gidx_t hash_offset;
  gidx_t hash_size;
  gidx_t module_offset;
  gidx_t otherconv_offset;
};

But in iconvconfig.c, there are

/* Format of the output file.

   Offset   Length       Description
   0000     4            Magic header bytes
   0004     4            Offset of string table (stoff)
   0008     4            Offset of name hashing table (hoff)
   000C     4            Hashing table size (hsize)
   0010     4            Offset of module table (moff)
   0014     4            Offset of other conversion module table (ooff)

   stoff    ???          String table

The lengths of stoff, hoff, hsize, moff and ooff are 2 not 4.

Also compiler may put padding in struct gconvcache_header, which may not
be initialized. When write_output does

  iov[0].iov_base = &header;
  iov[0].iov_len = sizeof (struct gconvcache_header);
  total = iov[0].iov_len;

we may get different values in padding for different compilers.

-- 
           Summary: Inconsistent struct gconvcache_header
           Product: glibc
           Version: unspecified
            Status: NEW
          Severity: normal
          Priority: P2
         Component: libc
        AssignedTo: gotom at debian dot or dot jp
        ReportedBy: hjl at lucon dot org
                CC: glibc-bugs at sources dot redhat dot com


http://sources.redhat.com/bugzilla/show_bug.cgi?id=776

------- 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] 5+ messages in thread

end of thread, other threads:[~2005-04-06  0:38 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2005-03-02  1:21 [Bug libc/776] New: Inconsistent struct gconvcache_header hjl at lucon dot org
2005-03-03  8:28 ` [Bug libc/776] " drepper at redhat dot com
2005-03-03 16:28 ` cvs-commit at gcc dot gnu dot org
2005-04-06  0:38 ` cvs-commit at gcc dot gnu dot org
2005-04-06  0:38 ` roland at gnu dot org

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).