Bug 762717 (GLUSTER-985)

Summary: Crash with SEGV in libglusterfs on 32 bit, big endian platform
Product: [Community] GlusterFS Reporter: tlisiecki
Component: portingAssignee: Amar Tumballi <amarts>
Status: CLOSED CURRENTRELEASE QA Contact:
Severity: medium Docs Contact:
Priority: low    
Version: 3.0.4CC: gluster-bugs, vraman
Target Milestone: ---   
Target Release: ---   
Hardware: ppc   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Attachments:
Description Flags
proposed patch none

Description tlisiecki 2010-06-04 06:42:31 UTC
Created attachment 231 [details]
Dutch keyboard definition for loadkeys

Please consider this patch.
It sloves porting problem on 32 bits big endian platforms.

Comment 1 Amar Tumballi 2010-06-04 06:48:09 UTC
(In reply to comment #1)
> Created an attachment (id=231) [details]
> proposed patch
> 
> Please consider this patch.
> It sloves porting problem on 32 bits big endian platforms.

This patch is valid. Can you please submit it through 'git diff' across our latest codebase (master,release-3.0 branch), and mail it to glusterfs.com ?? that way our patchwork integration sees it. (patches.gluster.com)

-Amar

Comment 2 tlisiecki 2010-06-04 09:31:18 UTC
Please look on struct (from inode.h) and consider what happends when we are trying to read union fields alternatively (like in inode.c line: 285, 1370):

struct _inode_ctx {
        union {
                uint64_t    key;            // <--- alwyas 64 bits length
                xlator_t   *xl_key;         // <--- 64 or 32 bits length
        };
        union {
                uint64_t    value1;
                void       *ptr1;
        };
        union {
                uint64_t    value2;
                void       *ptr2;
        };
};

On 64 bits platforms all works fine while the length of union's filed are equal.
On 32 bits little endian (PC) platforms it still works.
On 32 bits big endian platforms it crashes.

Comment 3 Anand Avati 2010-07-08 06:24:18 UTC
PATCH: http://patches.gluster.com/patch/3544 in master (Handle a crash in inode.c on 32 bit, big endian platform)

Comment 4 Amar Tumballi 2010-07-15 04:30:50 UTC
Applied the patch, should fix the issues..