X-Spam-Checker-Version: SpamAssassin 3.2.1 on mx1.mastersmail.com
X-Spam-Level: 
X-Spam-Status: No, score=0.1 required=5.0 tests=AWL,BAYES_50,
	DK_POLICY_SIGNSOME,SPF_HELO_PASS,SPF_PASS autolearn=ham version=3.2.1
Delivered-To: ms00220@mx1.mastersmail.com
Return-Path: <apache@openzim.org>
Received: from openzim.org (static-ip-195-114-98-53.inaddr.ipbone.net
	[195.114.98.53]) (TLS: TLSv1/SSLv3,256bits,CAMELLIA256-SHA)
	by mx1.mastersmail.com with esmtp; Sat, 18 Jul 2009 14:08:53 +0200
	id 0066C41E.4A61BB55.00003C63
Received-SPF: pass (Address passes the Sender Policy Framework) SPF=HELO;
	sender=openzim.org; remoteip=195.114.98.53;
	remotehost=static-ip-195-114-98-53.inaddr.ipbone.net;
	helo=openzim.org; receiver=mx1.mastersmail.com;
Received-SPF: pass (Address passes the Sender Policy Framework) SPF=MAILFROM;
	sender=apache@openzim.org; remoteip=195.114.98.53;
	remotehost=static-ip-195-114-98-53.inaddr.ipbone.net;
	helo=openzim.org; receiver=mx1.mastersmail.com;
Received: from localhost (localhost [127.0.0.1]) (uid 81)
	by openzim.org with local; Sat, 18 Jul 2009 14:08:41 +0200
	id 0022C98E.4A61BB49.00003112
From: bugzilla-daemon@openzim.org
To: manuel.schneider@wikimedia.ch
Subject: [Bug 5] New: zimreader on arm: miss-aligned dirent header
X-Bugzilla-Reason: AssignedTo
X-Bugzilla-Type: newchanged
X-Bugzilla-Watch-Reason: None
X-Bugzilla-Product: openZIM
X-Bugzilla-Component: zimlib
X-Bugzilla-Keywords: 
X-Bugzilla-Severity: major
X-Bugzilla-Who: openmoko@rcie.de
X-Bugzilla-Status: NEW
X-Bugzilla-Priority: P5
X-Bugzilla-Assigned-To: manuel.schneider@wikimedia.ch
X-Bugzilla-Target-Milestone: ---
X-Bugzilla-Changed-Fields: 
Message-ID: <bug-5-1@http.bugs.openzim.org/>
Auto-Submitted: auto-generated
Mime-Version: 1.0
Content-Type: text/plain;
  charset=utf-8
Content-Transfer-Encoding: 7bit
Date: Sat, 18 Jul 2009 14:08:41 +0200
Received-SPF: pass (Address passes the Sender Policy Framework) SPF=FROM;
	sender=bugzilla-daemon@openzim.org; remoteip=195.114.98.53;
	remotehost=static-ip-195-114-98-53.inaddr.ipbone.net;
	helo=openzim.org; receiver=mx1.mastersmail.com;
X-Virus-Status: No
X-Virus-Checker-Version: clamassassin 1.2.4 with clamdscan / ClamAV
	0.94.2/9588/Sat Jul 18 07:14:41 2009
X-Mail-Counter: mail statistics and filters by Manuel Schneider
X-Operating-System: Linux 2.6
X-Message-To-The-World: Linux is good for you!
X-Length: 4043
X-UID: 207708

http://bugs.openzim.org/show_bug.cgi?id=5

           Summary: zimreader on arm: miss-aligned dirent header
           Product: openZIM
           Version: unspecified
          Platform: Other
        OS/Version: Linux
            Status: NEW
          Severity: major
          Priority: P5
         Component: zimlib
        AssignedTo: manuel.schneider@wikimedia.ch
        ReportedBy: openmoko@rcie.de
   Estimated Hours: 0.0


Created an attachment (id=1)
 --> (http://bugs.openzim.org/attachment.cgi?id=1)
Patch to correct alignment of the dirent header

-- System Information:
Debian Release: 5.0.2
  APT prefers stable
  APT policy: (500, 'stable')
Architecture: armel (armv4tl)

Kernel: Linux 2.6.24-20081103.git7172ec57 (PREEMPT)
Locale: LANG=de_DE.UTF-8, LC_CTYPE=de_DE.UTF-8 (charmap=UTF-8) (ignored: LC_ALL
set to de_DE.UTF-8)

Plattform: openmoko Freerunner

Since the dirent header variable in 

  zim::std::istream& operator>> (std::istream& in, Dirent& dirent)

is define as char, the compiler chooses 2-byte-alignment. Later
4-byte access will fail on architectures with poor miss-alignment
recovery (see [1]).

Possibly there are further variables to be explicitly alignment.
I only fixed the one that made zimreader fail (see patch).

Note: The patch is gcc-specific, which may not be desired.

[1] linux-2.6.28/Documentation/unaligned-memory-access.txt

-- 
Configure bugmail: http://bugs.openzim.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.

