Re: BUG #16774: PostgreSQL clean build MINGW64 gcc but initdb fails, cannot find startadress CreateProcessAsUserA

From: Yannick Collette <yannickcollette(at)gmail(dot)com>
To: Alexander Lakhin <exclusion(at)gmail(dot)com>
Cc: mats(dot)stenfeldt(at)gmail(dot)com, pgsql-bugs(at)lists(dot)postgresql(dot)org
Subject: Re: BUG #16774: PostgreSQL clean build MINGW64 gcc but initdb fails, cannot find startadress CreateProcessAsUserA
Date: 2021-03-08 16:54:42
Message-ID: CADTm7M-KMXiX_mW9-MZGvG7Ap-Pu3as3hiGtnWYNKTvEk5FPcA@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

Hello,

I have the exact same problem with source code 11.11 using the following
configuration. No errors at compilation. Tried your work around and still
having same problem.

# gcc --version
gcc.exe (Rev6, Built by MSYS2 project) 10.2.0

./configure --host=x86_64-w64-mingw32 --prefix=/c/postgresql/pg11/
--with-openssl --with-libxml
make (no errors)
make install (no errors)

initdb.exe error
The procedure entry point CreateProcessAsUserA could not be located in
dynamic link library...

Applied solution below without any success.

CFLAGS="-D WINVER=0x0600 -D _WIN32_WINNT=0x0600" LIBS="-ladvapi32"
./configure --host=x86_64-w64-mingw32 --prefix=/c/postgresql/pg11/
--with-openssl --with-libxml

Thanks in advance for your help.

Yannick

On Mon, 8 Mar 2021 at 11:46, Alexander Lakhin <exclusion(at)gmail(dot)com> wrote:

> Hello Mats,
>
> 14.12.2020 23:47, PG Bug reporting form wrote:
> > The following bug has been logged on the website:
> >
> > Bug reference: 16774
> > ...
> >
> > Build environment: MINGW64, GCC (Rev6, Built by MSYS2 project) 10.2.0
> > REL=REL_13_STABLE
> > ...
> > 6. $source/configure --host=x86_64-w64-mingw32 --prefix=$dist && make &&
> > make install
> >
> > Clean build without errors. But when i try to run the following command:
> > initdb --pgdata=Y:\data\pgsqlgw --username=postgres --auth=trust
> > A messagebox pops up (translated from Swedish), Cannot find
> > procedurestartadress CreateProcessAsUserA in DLL-file KERNEL32.DLL.
> > and the program exits.
> > I have checked INITDB.EXE with Dependency Walker there is a call for:
> > CreateProcessAsUserA in KERNEL32.DLL [hint 235 (0x00EB)].
> > Maybe the call should be for CreateProcessWithLogonW instead of
> > CreateProcessAsUserA?
> The CreateProcessAsUserA function is located in advapi32 now, so you
> should link with that library. For example:
> CFLAGS="-D WINVER=0x0600 -D _WIN32_WINNT=0x0600" LIBS="-ladvapi32"
> ./configure --host=x86_64-w64-mingw32 ...
>
> Best regards,
> Alexander
>
>
>
>
>

In response to

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message Bruce Momjian 2021-03-09 16:29:34 Re: BUG #16861: Undefined behavior in power_var_int under the address sanitizer when exponent is INT_MIN
Previous Message Tom Lane 2021-03-08 16:18:25 Re: Upgrade issue during Postgres 9.6 to 12.3 on the two and more server