Re: [bug fix] Produce a crash dump before main() on Windows

From: Craig Ringer <craig(at)2ndquadrant(dot)com>
To: Michael Paquier <michael(at)paquier(dot)xyz>
Cc: "Tsunakawa, Takayuki" <tsunakawa(dot)takay(at)jp(dot)fujitsu(dot)com>, Robert Haas <robertmhaas(at)gmail(dot)com>, Haribabu Kommi <kommi(dot)haribabu(at)gmail(dot)com>, Magnus Hagander <magnus(at)hagander(dot)net>, Pg Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: [bug fix] Produce a crash dump before main() on Windows
Date: 2019-11-10 10:03:08
Message-ID: CAMsr+YGv0zjTB1-y8X59sEwFN5AJz2g9tedSMX0gSwY1y69YxQ@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Mon, 23 Jul 2018 at 16:45, Michael Paquier <michael(at)paquier(dot)xyz> wrote:

> On Mon, Jul 23, 2018 at 08:16:52AM +0000, Tsunakawa, Takayuki wrote:
> > I guess that is due to some missing files related to the libraries
> > listed in shared_preload_library. If so, no, because this patch
> > relates to failure before main().
>
> No, I really mean a library dependency failure. For example, imagine
> that Postgres is compiled on Windows dynamically, and that it depends on
> libxml2.dll, which is itself compiled dynamically. Then imagine, in a
> custom build echosystem, that a folk comes in and adds lz support to
> libxml2 on Windows. If Postgres still consumes libxml2 but does not add
> in its PATH a version of lz, then a backend in need of libxml2 would
> fail to load, causing Postgres to not start properly. True, painful,
> story.
>

What's super fun about this is the error message. Guess which error Windows
will emit? (Some paraphrasing for exact wording):

* "There was a problem starting C:\Program
Files\PostgreSQL\11\bin\postgres.exe: The specified module could not be
found."

* "There was a problem starting C:\Program
Files\PostgreSQL\11\bin\postgres.exe: module "libxml2.dll" could not be
found."

* "The program can't start because "libxml2.dll" is missing from your
computer."

* "The program "C:\Program Files\PostgreSQL\11\bin\postgres.exe" can't
start because an error was encountered when loading required library
"C:\Program Files\PostgreSQL\11\lib\libxml.dll": libxml.dll requires
"liblz.dll" but it could not be found."

Hint: not the last one.

It'll at best complain about libxml.dll being missing, despite it being
very obviously present.

I had to go hunt around with Dependency Walker to figure out the actual
missing DLL the last time I had to deal with this.

--
Craig Ringer http://www.2ndQuadrant.com/
2ndQuadrant - PostgreSQL Solutions for the Enterprise

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Michael Paquier 2019-11-10 10:52:05 Re: [bug fix] Produce a crash dump before main() on Windows
Previous Message Craig Ringer 2019-11-10 09:54:51 Re: [bug fix] Produce a crash dump before main() on Windows