Re: Bug Report with Postgres 7.4 on AIX 5.3 - Mailing list pgsql-bugs

From Vincent Vanwynsberghe
Subject Re: Bug Report with Postgres 7.4 on AIX 5.3
Date
Msg-id IKEPJJEJDCJPKMLEECEDAEJBCCAA.vvanwynsberghe@ccncsi.net
Whole thread Raw
In response to Re: Bug Report with Postgres 7.4 on AIX 5.3  (Tom Lane <tgl@sss.pgh.pa.us>)
Responses Re: Bug Report with Postgres 7.4 on AIX 5.3  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-bugs
The AIX 5.3 provide the structure sockaddr_storage :

struct sockaddr_storage {
        ushort_t        __ss_family;    /* address family */
        char            __ss_pad1[_SS_PAD1SIZE]; /* pad up to alignment
field */
#if defined(__64BIT__) || (defined(_ALL_SOURCE) && defined(_LONG_LONG))
        int64_t         __ss_align;     /* field to force desired structure
*/
                                        /* storage alignment */
#else
        int             __ss_align[2];
#endif
        char            __ss_pad2[_SS_PAD2SIZE];
                                /* pad to achieve desired size */
};


In Postgres the structure SockAddr is the following :
typedef struct
{
        struct sockaddr_storage addr;
        ACCEPT_TYPE_ARG3 salen;
} SockAddr

In Postgress this structure sockaddr_storage  is filled with the structure
sockaddr_un but the size of sockaddr_storage
is less then the size of sockaddr_un and cause a memory overflow !

Do you have any idea how to find a workaround ?

Vincent Vanwynsberghe

> -----Original Message-----
> From: Tom Lane [mailto:tgl@sss.pgh.pa.us]
> Sent: mardi 10 mai 2005 18:46
> To: vvanwynsberghe@ccncsi.net
> Cc: pgsql-ports@postgresql.org; pgsql-bugs@postgresql.org
> Subject: Re: [BUGS] Bug Report with Postgres 7.4 on AIX 5.3
>
>
> Vincent Vanwynsberghe <vvanwynsberghe@ccncsi.net> writes:
> > In our platform the sizeof of struct  sockaddr_un is 1025 and
> the sizeof of
> > SockAddr is 144.
>
> Doesn't AIX provide struct sockaddr_storage?  That struct has to be at
> least as large as any of the other platform-specific sockaddr structs.
>
>             regards, tom lane


pgsql-bugs by date:

Previous
From: "Ä°brahim"
Date:
Subject: BUG #1659: primary key accepts null value
Next
From: Tom Lane
Date:
Subject: Re: Missing tables in postgresql 7.2.4