Bug#596054: Unaligned accesses in metatree code

Michael Cree mcree at orcon.net.nz
Wed Sep 8 10:19:49 UTC 2010


Package: gvfs
Version: 1.6.3-2
Severity: normal
Tags: upstream patch

The gvfs metatree code has misaligned accesses to 64 bit data.  On the Alpha
architecture this causes traps to the kernel to complete the memory access
(i.e. very inefficient) and pollutes the kernel logs with messages.  While
not a show stopper it is nevertheless annoying, particularly as the gvfs
library is linked in a number of other packages (such as nautilus and evince)
and they are all generating unaligned trap messages in the kernel log.

I attach a patch that "fixes" the problem by providing a means to tell the
compiler (provided it is gcc) that the access is misaligned at the specific
points in the code, thus the compiler generates code that can access the
datum without causing unaligned traps to the kernel.  The patch is really
just to illustrate where the problem occurs -- a better approach is probably
to fix the "Journal Entry" in the code to contain the 64 bit data (the field
"mtime" in the structure) on 64 bit boundaries.  I noted a comment in the
code that said the mtime field must be 32 bit aligned but didn't give any
reasons why, so I decided not to risk modifying the alignment.

-- System Information:
Debian Release: squeeze/sid
  APT prefers unstable
  APT policy: (500, 'unstable')
Architecture: alpha

Kernel: Linux 2.6.35.4-dp264-p+
Locale: LANG=en_GB.UTF-8, LC_CTYPE=en_GB.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash

Versions of packages gvfs depends on:
ii  libc6.1                       2.11.2-5   Embedded GNU C Library: Shared lib
ii  libdbus-1-3                   1.2.24-3   simple interprocess messaging syst
ii  libexpat1                     2.0.1-7    XML parsing C library - runtime li
ii  libgconf2-4                   2.28.1-3   GNOME configuration database syste
ii  libgdu0                       2.30.1-2   GObject based Disk Utility Library
ii  libglib2.0-0                  2.24.1-1   The GLib library of C routines
ii  libgnome-keyring0             2.30.1-1   GNOME keyring services library
ii  libudev0                      161-1      libudev shared library
ii  x11-utils                     7.5+4      X11 utilities

Versions of packages gvfs recommends:
ii  dbus                          1.2.24-3   simple interprocess messaging syst
ii  policykit-1-gnome             0.96-2     GNOME authentication agent for Pol

Versions of packages gvfs suggests:
ii  gvfs-backends                 1.6.3-2    userspace virtual filesystem - bac

-- no debconf information
-------------- next part --------------
A non-text attachment was scrubbed...
Name: gvfs-fix-unaligned-64bit-accesses-patch.txt
Type: text/x-c
Size: 1980 bytes
Desc: not available
URL: <http://lists.alioth.debian.org/pipermail/pkg-gnome-maintainers/attachments/20100908/06f39087/attachment-0001.bin>


More information about the pkg-gnome-maintainers mailing list