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

Started by PG Bug reporting formover 5 years ago6 messagesbugs
Jump to latest
#1PG Bug reporting form
noreply@postgresql.org

The following bug has been logged on the website:

Bug reference: 16774
Logged by: Mats Stenfeldt
Email address: mats.stenfeldt@gmail.com
PostgreSQL version: 13.0
Operating system: Windows 7 64-bit
Description:

Build environment: MINGW64, GCC (Rev6, Built by MSYS2 project) 10.2.0
REL=REL_13_STABLE
Build Steps:
1. git clone git://git.postgresql.org/git/postgresql.git source
2. rel=REL_13_STABLE
3. git checkout $rel
4. source=/y/builds/postgres/source/
5. dist=/y/builds/postgres/dist/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?

#2Alexander Lakhin
exclusion@gmail.com
In reply to: PG Bug reporting form (#1)
Re: BUG #16774: PostgreSQL clean build MINGW64 gcc but initdb fails, cannot find startadress CreateProcessAsUserA

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

#3Yaco312
yannick.collette@ultra-ft.com
In reply to: Alexander Lakhin (#2)
Re: BUG #16774: PostgreSQL clean build MINGW64 gcc but initdb fails, cannot find startadress CreateProcessAsUserA

Hello,

I have the exact same problem with REL_11_STABLE 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

--
Sent from: https://www.postgresql-archive.org/PostgreSQL-bugs-f2117394.html

#4Yannick Collette
yannickcollette@gmail.com
In reply to: Alexander Lakhin (#2)
Re: BUG #16774: PostgreSQL clean build MINGW64 gcc but initdb fails, cannot find startadress CreateProcessAsUserA

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@gmail.com> wrote:

Show quoted text

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

#5Alexander Lakhin
exclusion@gmail.com
In reply to: Yannick Collette (#4)
Re: BUG #16774: PostgreSQL clean build MINGW64 gcc but initdb fails, cannot find startadress CreateProcessAsUserA

Hello Yannick,
08.03.2021 19:54, Yannick Collette wrote:

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.

Please try the attached script. If it doesn't work for you, please
specify which Windows version you are using and I'll try to reproduce
your problem on my side. (Your complete script would be useful too.)

Best regards,
Alexander

Attachments:

make_check11.txttext/plain; charset=UTF-8; name=make_check11.txtDownload
#6Yannick Collette
yannickcollette@gmail.com
In reply to: Alexander Lakhin (#5)
Re: BUG #16774: PostgreSQL clean build MINGW64 gcc but initdb fails, cannot find startadress CreateProcessAsUserA

Hello Alexander,

sorry for the late reply just got back to this problem and your solution
works.
FYI, I am compiling on Windows 2012 platform.

select version();
version
------------------------------------------------------------------------------------------------------------------------------
PostgreSQL 11.11 on x86_64-w64-mingw32, compiled by
x86_64-w64-mingw32-gcc.exe (Rev8, Built by MSYS2 project) 10.2.0, 64-bit

Thanks again for your help!
Yannick

On Wed, 10 Mar 2021 at 03:01, Alexander Lakhin <exclusion@gmail.com> wrote:

Show quoted text

Hello Yannick,
08.03.2021 19:54, Yannick Collette wrote:

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.

Please try the attached script. If it doesn't work for you, please specify
which Windows version you are using and I'll try to reproduce your problem
on my side. (Your complete script would be useful too.)

Best regards,
Alexander