Re: initdb failure on Debian sid/mips64el in EventTriggerEndCompleteQuery

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Christoph Berg <myon(at)debian(dot)org>
Cc: PostgreSQL Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: initdb failure on Debian sid/mips64el in EventTriggerEndCompleteQuery
Date: 2017-08-13 15:33:37
Message-ID: 14517.1502638417@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Christoph Berg <myon(at)debian(dot)org> writes:
> 10beta3 and 9.6.4 are both failing during initdb on mips64el on
> Debian/sid (unstable):
> All other architectures have succeeded, as well as the 9.6.4 build for
> Debian/stretch (stable) on mips64el. The difference might be the
> compiler version (6.3.0 vs 7.1.0).

It's hard to explain that stack trace other than as a compiler bug.
There shouldn't be any event triggers active here, so
EventTriggerBeginCompleteQuery should have done nothing and returned
false. I don't put complete faith in gdb reports of local variable
values, but it says
needCleanup = 0 '\000'
which agrees with that. Also the core dump appears to be because
currentEventTriggerState is NULL (please check that), which is
expected if EventTriggerBeginCompleteQuery did nothing. However, then
EventTriggerEndCompleteQuery should not have gotten called at all.

I suspect you could work around this with

bool isCompleteQuery = (context <= PROCESS_UTILITY_QUERY);
- bool needCleanup;
+ volatile bool needCleanup;
bool commandCollected = false;

If that fixes it, it's definitely a compiler bug. That function does
not change needCleanup after the sigsetjmp call, so per POSIX it
should not have to label the variable volatile. This is far from
being the first such bug we've seen though.

regards, tom lane

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2017-08-13 15:38:09 Re: initdb failure on Debian sid/mips64el in EventTriggerEndCompleteQuery
Previous Message Christoph Berg 2017-08-13 15:12:30 Re: initdb failure on Debian sid/mips64el in EventTriggerEndCompleteQuery