Re: gettimeofday cause crash on Windows

From: Andres Freund <andres(at)2ndquadrant(dot)com>
To: Michael Paquier <michael(dot)paquier(at)gmail(dot)com>
Cc: Asif Naeem <anaeem(dot)it(at)gmail(dot)com>, "pgsql-bugs(at)postgresql(dot)org" <pgsql-bugs(at)postgresql(dot)org>
Subject: Re: gettimeofday cause crash on Windows
Date: 2015-02-12 12:54:12
Message-ID: 20150212125412.GA9449@alap3.anarazel.de
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

On 2015-02-12 04:48:00 -0800, Michael Paquier wrote:
> I didn't follow much the thread implementing this feature, but this
> commit has somewhat not taken into account the fact that the contents
> of src/port could as well be used for the frontends, per se the
> comments on top of init_win32_gettimeofday mentioning only the backend
> startup, something not wrong in itself, but not completely right
> either. So what we have now is an unpleasant crash trigger for any
> client applications on Windows < 2k12 linking to libpqport that call
> gettimeofday(). I would not be surprised that we would get bug reports
> of the type "why my client binary crashes suddendly with 9.5" if we
> keep the code as-is.

> So ISTM that your patch does the correct thing by setting
> pg_get_system_time to &GetSystemTimeAsFileTime to not break any
> existing applications, and that we should as well update any in-core
> binary tools to switch to the precise API

I think I'd rather have it crash so people are forced to adjust the
client applications. The number of things linking to pgport should be
rather low.

Greetings,

Andres Freund

In response to

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message Michael Paquier 2015-02-12 13:09:43 Re: gettimeofday cause crash on Windows
Previous Message Michael Paquier 2015-02-12 12:48:00 Re: gettimeofday cause crash on Windows