Re: postgresql-server exiting abnormally after an OS upgrade

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Hugo Osvaldo Barrera <hugo(at)barrera(dot)io>
Cc: pgsql-bugs(at)postgresql(dot)org
Subject: Re: postgresql-server exiting abnormally after an OS upgrade
Date: 2015-02-17 00:38:17
Message-ID: 22592.1424133497@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

Hugo Osvaldo Barrera <hugo(at)barrera(dot)io> writes:
> On 2015-02-16 15:55, Tom Lane wrote:
>> Probably the reason why this was triggered by an OS upgrade is that your
>> system is now choosing to make the DB connection over IPv6 not IPv4.
>> Or maybe it was doing that right along but you now have a memcpy that is
>> doing more checking of its arguments than before (this is evidently an
>> argument sanity check and not a straight SIGSEGV).

> My host has been configured to use IPv6 by default for some time now, but it
> *is* possible that there has been some OS-level change during this upgrade that
> affected this in some way.

On further thought the answer almost certainly is that you now have a libc
version in which memcpy() complains strenuously (ie, aborts) if given
overlapping source and target areas. Such "helpfulness" is the new fad
among libc maintainers :-(

>> Anyway you could work around it for now by being sure to list IPv6
>> equivalent addresses before IPv4 addresses in your pg_hba.conf.
>> We'll fix it properly in the next releases.

> Do you mean IPv6 *before* IPv4? Wouldn't that add a preference to IPv6?

No, not particularly, considering the cases are disjoint. An incoming
connection is one or the other.

> I currently have the stock out-of-the-box pg_hba:

> # TYPE DATABASE USER ADDRESS METHOD
> # "local" is for Unix domain socket connections only
> local all all md5
> # IPv4 local connections:
> host all all 127.0.0.1/32 md5
> # IPv6 local connections:
> host all all ::1/128 md5

The problem comes when an incoming IPv6 connection is compared to that
127.0.0.1 line. If you're using only IPv6 anyway, you could just remove
that line. Or you could do something like this:

host all all ::1/128 md5
host all all ::0/0 reject
host all all 127.0.0.1/32 md5

so that all IPv6 connections are either accepted or rejected before
reaching the 127.0.0.1 line.

regards, tom lane

In response to

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message Hugo Osvaldo Barrera 2015-02-17 14:38:46 Fwd: Re: postgresql-server exiting abnormally after upgrade to -snapshot
Previous Message Hugo Osvaldo Barrera 2015-02-16 21:31:30 Re: postgresql-server exiting abnormally after an OS upgrade