Re: Crash with old Windows on new CPU

From: Robert Haas <robertmhaas(at)gmail(dot)com>
To: Christian Ullrich <chris(at)chrullrich(dot)net>
Cc: "pgsql-hackers(at)postgresql(dot)org" <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Crash with old Windows on new CPU
Date: 2016-02-13 03:36:46
Message-ID: CA+TgmobZk_o_KFL1EZy-bJyd_=2r8oyHimZ2rTR41jqdgpzaLw@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Fri, Feb 12, 2016 at 7:26 PM, Christian Ullrich <chris(at)chrullrich(dot)net> wrote:
> * Christian Ullrich wrote:
>> Backends (and possibly other processes) crash at the slightest
>> provocation, such as "SELECT * FROM pg_stat_activity;" or VACUUM. The
>> log says either "exception 0xC0000005" (segfault) or "exception
>> 0xC000001D" (illegal instruction).
>>
>> The interesting reason: The old host had a Core-generation CPU, which
>> does not support the AVX2 instruction set. The new one has a
>> Haswell-generation one, and this one does. The EDB distribution of 9.4
>> was built with the Visual Studio 2013 compiler, whose CRT (aka libc) has
>> a bug where it uses AVX2 instructions if the *CPU* supports them, but
>> does not care whether the *OS* does, and 2008 doesn't. That support was
>> added in SP1 for 7/2008R2.
>
>> I just tried it, and it appears to work. If there is any interest in
>> fixing this, I'll be happy to prepare a patch. (Where would be the best
>> place to put a function call from <math.h> that has to be done during
>> startup of each server process, on Windows only?)
>
> startup_hacks(), I think. Proposed patch attached.

Thanks for the report and patch. Regrettably I haven't the Windows
knowledge to have any idea whether it's right or wrong, but hopefully
someone who knows Windows will jump in here.

--
Robert Haas
EnterpriseDB: http://www.enterprisedb.com
The Enterprise PostgreSQL Company

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Robert Haas 2016-02-13 03:52:06 Re: [COMMITTERS] pgsql: Code cleanup in the wake of recent LWLock refactoring.
Previous Message Tom Lane 2016-02-13 01:59:32 Re: Re: [COMMITTERS] pgsql: Add some isolation tests for deadlock detection and resolution.