pg.ddx.io pgsql-bugs@postgresql.org mailing list archive
help / color / mirror / Atom feedpl/perl extension fails on Windows
8+ messages / 2 participants
[nested] [flat]
* pl/perl extension fails on Windows
@ 2024-09-10 10:20 Muralikrishna Bandaru <muralikrishna.bandaru@enterprisedb.com>
0 siblings, 1 reply; 8+ messages in thread
From: Muralikrishna Bandaru @ 2024-09-10 10:20 UTC (permalink / raw)
To: pgsql-bugs@lists.postgresql.org
Hi,
I built PG17 rc1 using meson on Windows with the option "-Dplperl=enabled"
. When I tried to create the extension,it crashed the database.
--
postgres=# create extension plperl;
server closed the connection unexpectedly
This probably means the server terminated abnormally
before or while processing the request.
The connection to the server was lost. Attempting reset: Succeeded.
The log contains the following error.
*src/pl/plperl/Util.c: loadable library and perl binaries are mismatched
(got first handshake key 0000000012d00080, needed 0000000012c00080)*
--
This issue is seen with strawberry perl *5.40* not with *5.38* . The Perl
that is used during compilation and on the target machine is the same.
I have used strawberry perl 5.40 , which is available in the strawberry
perl home page <https://strawberryperl.com/; ,but 5.40 is not
available in the release page <https://strawberryperl.com/releases.html; .
So, is it recommended to use perl 5.40 ?
Please let me know if you need any other information.
Thanks,
Murali krishna.
^ permalink raw reply [nested|flat] 8+ messages in thread
* Re: pl/perl extension fails on Windows
@ 2024-09-10 11:51 Andrew Dunstan <andrew@dunslane.net>
parent: Muralikrishna Bandaru <muralikrishna.bandaru@enterprisedb.com>
0 siblings, 1 reply; 8+ messages in thread
From: Andrew Dunstan @ 2024-09-10 11:51 UTC (permalink / raw)
To: Muralikrishna Bandaru <muralikrishna.bandaru@enterprisedb.com>; pgsql-bugs@lists.postgresql.org
On 2024-09-10 Tu 6:20 AM, Muralikrishna Bandaru wrote:
> Hi,
> I built PG17 rc1 using meson on Windows with the option
> "-Dplperl=enabled" . When I tried to create the extension,it crashed
> the database.
> --
> postgres=# create extension plperl;
> server closed the connection unexpectedly
> This probably means the server terminated abnormally
> before or while processing the request.
> The connection to the server was lost. Attempting reset: Succeeded.
>
> The log contains the following error.
>
> *src/pl/plperl/Util.c: loadable library and perl binaries are
> mismatched (got first handshake key 0000000012d00080, needed
> 0000000012c00080)*
> --
> This issue is seen with strawberry perl *5.40* not with *5.38* . The
> Perl that is used during compilation and on the target machine is the
> same.
>
> I have used strawberry perl 5.40 , which is available in the
> strawberry perl home page <https://strawberryperl.com/> ,but 5.40 is
> not available in the release page
> <https://strawberryperl.com/releases.html; . So, is it recommended to
> use perl 5.40 ?
>
> Please let me know if you need any other information.
We've seen similar things before. See for example:
https://postgr.es/m/20211005004334.tgjmro4kuachwiuc@alap3.anarazel.de
https://postgr.es/m/c2da86a0-2906-744c-923d-16da6047875e@dunslane.net
This looks like we are defining something we should not be, or not
defining something we should be. We just need to find out what it is :-)
In the meantime, I would suggest sticking to 5.38.
cheers
andrew
--
Andrew Dunstan
EDB:https://www.enterprisedb.com
^ permalink raw reply [nested|flat] 8+ messages in thread
* Re: pl/perl extension fails on Windows
@ 2024-09-10 13:47 Andrew Dunstan <andrew@dunslane.net>
parent: Andrew Dunstan <andrew@dunslane.net>
0 siblings, 1 reply; 8+ messages in thread
From: Andrew Dunstan @ 2024-09-10 13:47 UTC (permalink / raw)
To: Muralikrishna Bandaru <muralikrishna.bandaru@enterprisedb.com>; pgsql-bugs@lists.postgresql.org
On 2024-09-10 Tu 7:51 AM, Andrew Dunstan wrote:
>
>
> On 2024-09-10 Tu 6:20 AM, Muralikrishna Bandaru wrote:
>> Hi,
>> I built PG17 rc1 using meson on Windows with the option
>> "-Dplperl=enabled" . When I tried to create the extension,it crashed
>> the database.
>> --
>> postgres=# create extension plperl;
>> server closed the connection unexpectedly
>> This probably means the server terminated abnormally
>> before or while processing the request.
>> The connection to the server was lost. Attempting reset: Succeeded.
>>
>> The log contains the following error.
>>
>> *src/pl/plperl/Util.c: loadable library and perl binaries are
>> mismatched (got first handshake key 0000000012d00080, needed
>> 0000000012c00080)*
>> --
>> This issue is seen with strawberry perl *5.40* not with *5.38* . The
>> Perl that is used during compilation and on the target machine is the
>> same.
>>
>> I have used strawberry perl 5.40 , which is available in the
>> strawberry perl home page <https://strawberryperl.com/> ,but 5.40 is
>> not available in the release page
>> <https://strawberryperl.com/releases.html; . So, is it recommended to
>> use perl 5.40 ?
>>
>> Please let me know if you need any other information.
>
>
> We've seen similar things before. See for example:
>
> https://postgr.es/m/20211005004334.tgjmro4kuachwiuc@alap3.anarazel.de
> https://postgr.es/m/c2da86a0-2906-744c-923d-16da6047875e@dunslane.net
>
> This looks like we are defining something we should not be, or not
> defining something we should be. We just need to find out what it is :-)
>
> In the meantime, I would suggest sticking to 5.38.
>
>
>
Now I've had a chance to take a look I see that Strawberry 5.40 has
USE_THREAD_SAFE_LOCALE defined. Can you try what happens with 5.40 if
you comment out theses lines in meson.build?
if cc.get_id() == 'msvc'
# prevent binary mismatch between MSVC built plperl and
Strawberry or
# msys ucrt perl libraries
perl_ccflags += ['-DNO_THREAD_SAFE_LOCALE']
endif
cheers
andrew
--
Andrew Dunstan
EDB:https://www.enterprisedb.com
^ permalink raw reply [nested|flat] 8+ messages in thread
* Re: pl/perl extension fails on Windows
@ 2024-09-11 07:37 Muralikrishna Bandaru <muralikrishna.bandaru@enterprisedb.com>
parent: Andrew Dunstan <andrew@dunslane.net>
0 siblings, 1 reply; 8+ messages in thread
From: Muralikrishna Bandaru @ 2024-09-11 07:37 UTC (permalink / raw)
To: Andrew Dunstan <andrew@dunslane.net>; +Cc: pgsql-bugs@lists.postgresql.org
On Tue, Sep 10, 2024 at 7:17 PM Andrew Dunstan <andrew@dunslane.net> wrote:
>
> On 2024-09-10 Tu 7:51 AM, Andrew Dunstan wrote:
>
>
> On 2024-09-10 Tu 6:20 AM, Muralikrishna Bandaru wrote:
>
> Hi,
> I built PG17 rc1 using meson on Windows with the option "-Dplperl=enabled"
> . When I tried to create the extension,it crashed the database.
> --
> postgres=# create extension plperl;
> server closed the connection unexpectedly
> This probably means the server terminated abnormally
> before or while processing the request.
> The connection to the server was lost. Attempting reset: Succeeded.
>
> The log contains the following error.
>
> *src/pl/plperl/Util.c: loadable library and perl binaries are mismatched
> (got first handshake key 0000000012d00080, needed 0000000012c00080)*
> --
> This issue is seen with strawberry perl *5.40* not with *5.38* . The Perl
> that is used during compilation and on the target machine is the same.
>
> I have used strawberry perl 5.40 , which is available in the strawberry
> perl home page <https://strawberryperl.com/; ,but 5.40 is not
> available in the release page <https://strawberryperl.com/releases.html;
> . So, is it recommended to use perl 5.40 ?
>
> Please let me know if you need any other information.
>
>
> We've seen similar things before. See for example:
>
> https://postgr.es/m/20211005004334.tgjmro4kuachwiuc@alap3.anarazel.de
> https://postgr.es/m/c2da86a0-2906-744c-923d-16da6047875e@dunslane.net
>
> This looks like we are defining something we should not be, or not
> defining something we should be. We just need to find out what it is :-)
>
> In the meantime, I would suggest sticking to 5.38.
>
>
>
>
>
> Now I've had a chance to take a look I see that Strawberry 5.40 has
> USE_THREAD_SAFE_LOCALE defined. Can you try what happens with 5.40 if you
> comment out theses lines in meson.build?
>
>
> if cc.get_id() == 'msvc'
> # prevent binary mismatch between MSVC built plperl and Strawberry
> or
> # msys ucrt perl libraries
> perl_ccflags += ['-DNO_THREAD_SAFE_LOCALE']
> endif
>
>
> Hi Andrew,
Thanks. I commented above lines in the meson.build file and built the
installer with Strawberry 5.40 . Now able to create the extension.
--
c:\Program Files\PostgreSQL\17>bin\psql.exe -d postgres -p 5436
psql (17rc1)
WARNING: Console code page (437) differs from Windows code page (1252)
8-bit characters might not work correctly. See psql reference
page "Notes for Windows users" for details.
Type "help" for help.
postgres=#
postgres=#
postgres=# create extension plperl;
--
So, will this change be a part of the PG17 GA release?
cheers
>
>
> andrew
>
> --
> Andrew Dunstan
> EDB: https://www.enterprisedb.com
>
>
^ permalink raw reply [nested|flat] 8+ messages in thread
* Re: pl/perl extension fails on Windows
@ 2024-09-11 11:36 Andrew Dunstan <andrew@dunslane.net>
parent: Muralikrishna Bandaru <muralikrishna.bandaru@enterprisedb.com>
0 siblings, 1 reply; 8+ messages in thread
From: Andrew Dunstan @ 2024-09-11 11:36 UTC (permalink / raw)
To: Muralikrishna Bandaru <muralikrishna.bandaru@enterprisedb.com>; +Cc: pgsql-bugs@lists.postgresql.org
On 2024-09-11 We 3:37 AM, Muralikrishna Bandaru wrote:
>
>
> On Tue, Sep 10, 2024 at 7:17 PM Andrew Dunstan <andrew@dunslane.net>
> wrote:
>
>
> On 2024-09-10 Tu 7:51 AM, Andrew Dunstan wrote:
>>
>>
>> On 2024-09-10 Tu 6:20 AM, Muralikrishna Bandaru wrote:
>>> Hi,
>>> I built PG17 rc1 using meson on Windows with the option
>>> "-Dplperl=enabled" . When I tried to create the extension,it
>>> crashed the database.
>>> --
>>> postgres=# create extension plperl;
>>> server closed the connection unexpectedly
>>> This probably means the server terminated abnormally
>>> before or while processing the request.
>>> The connection to the server was lost. Attempting reset: Succeeded.
>>>
>>> The log contains the following error.
>>>
>>> *src/pl/plperl/Util.c: loadable library and perl binaries are
>>> mismatched (got first handshake key 0000000012d00080, needed
>>> 0000000012c00080)*
>>> --
>>> This issue is seen with strawberry perl *5.40* not with *5.38* .
>>> The Perl that is used during compilation and on the target
>>> machine is the same.
>>>
>>> I have used strawberry perl 5.40 , which is available in the
>>> strawberry perl home page <https://strawberryperl.com/> ,but
>>> 5.40 is not available in the release page
>>> <https://strawberryperl.com/releases.html; . So, is it
>>> recommended to use perl 5.40 ?
>>>
>>> Please let me know if you need any other information.
>>
>>
>> We've seen similar things before. See for example:
>>
>> https://postgr.es/m/20211005004334.tgjmro4kuachwiuc@alap3.anarazel.de
>> https://postgr.es/m/c2da86a0-2906-744c-923d-16da6047875e@dunslane.net
>>
>> This looks like we are defining something we should not be, or
>> not defining something we should be. We just need to find out
>> what it is :-)
>>
>> In the meantime, I would suggest sticking to 5.38.
>>
>>
>>
>
>
> Now I've had a chance to take a look I see that Strawberry 5.40
> has USE_THREAD_SAFE_LOCALE defined. Can you try what happens with
> 5.40 if you comment out theses lines in meson.build?
>
>
> if cc.get_id() == 'msvc'
> # prevent binary mismatch between MSVC built plperl and
> Strawberry or
> # msys ucrt perl libraries
> perl_ccflags += ['-DNO_THREAD_SAFE_LOCALE']
> endif
>
>
> Hi Andrew,
> Thanks. I commented above lines in the meson.build file and built the
> installer with Strawberry 5.40 . Now able to create the extension.
> --
> c:\Program Files\PostgreSQL\17>bin\psql.exe -d postgres -p 5436
> psql (17rc1)
> WARNING: Console code page (437) differs from Windows code page (1252)
> 8-bit characters might not work correctly. See psql reference
> page "Notes for Windows users" for details.
> Type "help" for help.
>
> postgres=#
> postgres=#
> postgres=# create extension plperl;
> --
> So, will this change be a part of the PG17 GA release?
>
>
Probably not. The difficulty is that it's required for some versions of
perl and breaks others. We need to come up with a reliable test for it.
Maybe we need to look at the output of `perl -V` and only output the
flag if it doesn't contain USE_THREAD_SAFE_LOCALE. If anyone has a
better idea I am all ears.
It's kind of annoying that this could tie us so closely to a particular
perl binary.
cheers
andrew
--
Andrew Dunstan
EDB:https://www.enterprisedb.com
^ permalink raw reply [nested|flat] 8+ messages in thread
* Re: pl/perl extension fails on Windows
@ 2024-09-12 13:57 Andrew Dunstan <andrew@dunslane.net>
parent: Andrew Dunstan <andrew@dunslane.net>
0 siblings, 1 reply; 8+ messages in thread
From: Andrew Dunstan @ 2024-09-12 13:57 UTC (permalink / raw)
To: Muralikrishna Bandaru <muralikrishna.bandaru@enterprisedb.com>; +Cc: pgsql-bugs@lists.postgresql.org
On 2024-09-11 We 7:36 AM, Andrew Dunstan wrote:
>
>
> On 2024-09-11 We 3:37 AM, Muralikrishna Bandaru wrote:
>>
>>
>> On Tue, Sep 10, 2024 at 7:17 PM Andrew Dunstan <andrew@dunslane.net>
>> wrote:
>>
>>
>> On 2024-09-10 Tu 7:51 AM, Andrew Dunstan wrote:
>>>
>>>
>>> On 2024-09-10 Tu 6:20 AM, Muralikrishna Bandaru wrote:
>>>> Hi,
>>>> I built PG17 rc1 using meson on Windows with the option
>>>> "-Dplperl=enabled" . When I tried to create the extension,it
>>>> crashed the database.
>>>> --
>>>> postgres=# create extension plperl;
>>>> server closed the connection unexpectedly
>>>> This probably means the server terminated abnormally
>>>> before or while processing the request.
>>>> The connection to the server was lost. Attempting reset: Succeeded.
>>>>
>>>> The log contains the following error.
>>>>
>>>> *src/pl/plperl/Util.c: loadable library and perl binaries are
>>>> mismatched (got first handshake key 0000000012d00080, needed
>>>> 0000000012c00080)*
>>>> --
>>>> This issue is seen with strawberry perl *5.40* not with *5.38*
>>>> . The Perl that is used during compilation and on the target
>>>> machine is the same.
>>>>
>>>> I have used strawberry perl 5.40 , which is available in the
>>>> strawberry perl home page <https://strawberryperl.com/> ,but
>>>> 5.40 is not available in the release page
>>>> <https://strawberryperl.com/releases.html; . So, is it
>>>> recommended to use perl 5.40 ?
>>>>
>>>> Please let me know if you need any other information.
>>>
>>>
>>> We've seen similar things before. See for example:
>>>
>>> https://postgr.es/m/20211005004334.tgjmro4kuachwiuc@alap3.anarazel.de
>>> https://postgr.es/m/c2da86a0-2906-744c-923d-16da6047875e@dunslane.net
>>>
>>> This looks like we are defining something we should not be, or
>>> not defining something we should be. We just need to find out
>>> what it is :-)
>>>
>>> In the meantime, I would suggest sticking to 5.38.
>>>
>>>
>>>
>>
>>
>> Now I've had a chance to take a look I see that Strawberry 5.40
>> has USE_THREAD_SAFE_LOCALE defined. Can you try what happens with
>> 5.40 if you comment out theses lines in meson.build?
>>
>>
>> if cc.get_id() == 'msvc'
>> # prevent binary mismatch between MSVC built plperl and
>> Strawberry or
>> # msys ucrt perl libraries
>> perl_ccflags += ['-DNO_THREAD_SAFE_LOCALE']
>> endif
>>
>>
>> Hi Andrew,
>> Thanks. I commented above lines in the meson.build file and built the
>> installer with Strawberry 5.40 . Now able to create the extension.
>> --
>> c:\Program Files\PostgreSQL\17>bin\psql.exe -d postgres -p 5436
>> psql (17rc1)
>> WARNING: Console code page (437) differs from Windows code page (1252)
>> 8-bit characters might not work correctly. See psql reference
>> page "Notes for Windows users" for details.
>> Type "help" for help.
>>
>> postgres=#
>> postgres=#
>> postgres=# create extension plperl;
>> --
>> So, will this change be a part of the PG17 GA release?
>>
>>
>
> Probably not. The difficulty is that it's required for some versions
> of perl and breaks others. We need to come up with a reliable test for it.
>
> Maybe we need to look at the output of `perl -V` and only output the
> flag if it doesn't contain USE_THREAD_SAFE_LOCALE. If anyone has a
> better idea I am all ears.
>
> It's kind of annoying that this could tie us so closely to a
> particular perl binary.
>
>
>
Here's a patch along the suggested lines.
cheers
andrew
--
Andrew Dunstan
EDB:https://www.enterprisedb.com
Attachments:
perl-locales-fix.patch (text/x-patch, 735B) download
diff --git a/meson.build b/meson.build
index 4764b09266..f96425a61e 100644
--- a/meson.build
+++ b/meson.build
@@ -1056,9 +1056,12 @@ if not perlopt.disabled()
perl_ccflags += ['-DPLPERL_HAVE_UID_GID']
if cc.get_id() == 'msvc'
- # prevent binary mismatch between MSVC built plperl and Strawberry or
- # msys ucrt perl libraries
- perl_ccflags += ['-DNO_THREAD_SAFE_LOCALE']
+ perl_v = run_command(perl, '-V').stdout()
+ if not perl_v.contains('USE_THREAD_SAFE_LOCALE')
+ # prevent binary mismatch between MSVC built plperl and Strawberry or
+ # msys ucrt perl libraries
+ perl_ccflags += ['-DNO_THREAD_SAFE_LOCALE']
+ endif
endif
endif
^ permalink raw reply [nested|flat] 8+ messages in thread
* Re: pl/perl extension fails on Windows
@ 2024-09-14 14:42 Andrew Dunstan <andrew@dunslane.net>
parent: Andrew Dunstan <andrew@dunslane.net>
0 siblings, 1 reply; 8+ messages in thread
From: Andrew Dunstan @ 2024-09-14 14:42 UTC (permalink / raw)
To: Muralikrishna Bandaru <muralikrishna.bandaru@enterprisedb.com>; +Cc: pgsql-bugs@lists.postgresql.org
On 2024-09-12 Th 9:57 AM, Andrew Dunstan wrote:
>
>
> On 2024-09-11 We 7:36 AM, Andrew Dunstan wrote:
>>
>>
>> On 2024-09-11 We 3:37 AM, Muralikrishna Bandaru wrote:
>>>
>>>
>>> On Tue, Sep 10, 2024 at 7:17 PM Andrew Dunstan <andrew@dunslane.net>
>>> wrote:
>>>
>>>
>>> On 2024-09-10 Tu 7:51 AM, Andrew Dunstan wrote:
>>>>
>>>>
>>>> On 2024-09-10 Tu 6:20 AM, Muralikrishna Bandaru wrote:
>>>>> Hi,
>>>>> I built PG17 rc1 using meson on Windows with the option
>>>>> "-Dplperl=enabled" . When I tried to create the extension,it
>>>>> crashed the database.
>>>>> --
>>>>> postgres=# create extension plperl;
>>>>> server closed the connection unexpectedly
>>>>> This probably means the server terminated abnormally
>>>>> before or while processing the request.
>>>>> The connection to the server was lost. Attempting reset:
>>>>> Succeeded.
>>>>>
>>>>> The log contains the following error.
>>>>>
>>>>> *src/pl/plperl/Util.c: loadable library and perl binaries are
>>>>> mismatched (got first handshake key 0000000012d00080, needed
>>>>> 0000000012c00080)*
>>>>> --
>>>>> This issue is seen with strawberry perl *5.40* not with *5.38*
>>>>> . The Perl that is used during compilation and on the target
>>>>> machine is the same.
>>>>>
>>>>> I have used strawberry perl 5.40 , which is available in the
>>>>> strawberry perl home page <https://strawberryperl.com/> ,but
>>>>> 5.40 is not available in the release page
>>>>> <https://strawberryperl.com/releases.html; . So, is it
>>>>> recommended to use perl 5.40 ?
>>>>>
>>>>> Please let me know if you need any other information.
>>>>
>>>>
>>>> We've seen similar things before. See for example:
>>>>
>>>> https://postgr.es/m/20211005004334.tgjmro4kuachwiuc@alap3.anarazel.de
>>>> https://postgr.es/m/c2da86a0-2906-744c-923d-16da6047875e@dunslane.net
>>>>
>>>> This looks like we are defining something we should not be, or
>>>> not defining something we should be. We just need to find out
>>>> what it is :-)
>>>>
>>>> In the meantime, I would suggest sticking to 5.38.
>>>>
>>>>
>>>>
>>>
>>>
>>> Now I've had a chance to take a look I see that Strawberry 5.40
>>> has USE_THREAD_SAFE_LOCALE defined. Can you try what happens
>>> with 5.40 if you comment out theses lines in meson.build?
>>>
>>>
>>> if cc.get_id() == 'msvc'
>>> # prevent binary mismatch between MSVC built plperl and
>>> Strawberry or
>>> # msys ucrt perl libraries
>>> perl_ccflags += ['-DNO_THREAD_SAFE_LOCALE']
>>> endif
>>>
>>>
>>> Hi Andrew,
>>> Thanks. I commented above lines in the meson.build file and built
>>> the installer with Strawberry 5.40 . Now able to create the extension.
>>> --
>>> c:\Program Files\PostgreSQL\17>bin\psql.exe -d postgres -p 5436
>>> psql (17rc1)
>>> WARNING: Console code page (437) differs from Windows code page (1252)
>>> 8-bit characters might not work correctly. See psql reference
>>> page "Notes for Windows users" for details.
>>> Type "help" for help.
>>>
>>> postgres=#
>>> postgres=#
>>> postgres=# create extension plperl;
>>> --
>>> So, will this change be a part of the PG17 GA release?
>>>
>>>
>>
>> Probably not. The difficulty is that it's required for some versions
>> of perl and breaks others. We need to come up with a reliable test
>> for it.
>>
>> Maybe we need to look at the output of `perl -V` and only output the
>> flag if it doesn't contain USE_THREAD_SAFE_LOCALE. If anyone has a
>> better idea I am all ears.
>>
>> It's kind of annoying that this could tie us so closely to a
>> particular perl binary.
>>
>>
>>
>
> Here's a patch along the suggested lines.
>
>
>
Pushed. All live branches now have the new logic.
cheers
andrew
--
Andrew Dunstan
EDB:https://www.enterprisedb.com
^ permalink raw reply [nested|flat] 8+ messages in thread
* Re: pl/perl extension fails on Windows
@ 2024-09-14 16:59 Muralikrishna Bandaru <muralikrishna.bandaru@enterprisedb.com>
parent: Andrew Dunstan <andrew@dunslane.net>
0 siblings, 0 replies; 8+ messages in thread
From: Muralikrishna Bandaru @ 2024-09-14 16:59 UTC (permalink / raw)
To: Andrew Dunstan <andrew@dunslane.net>; +Cc: pgsql-bugs@lists.postgresql.org
On Sat, Sep 14, 2024 at 8:12 PM Andrew Dunstan <andrew@dunslane.net> wrote:
>
> On 2024-09-12 Th 9:57 AM, Andrew Dunstan wrote:
>
>
> On 2024-09-11 We 7:36 AM, Andrew Dunstan wrote:
>
>
> On 2024-09-11 We 3:37 AM, Muralikrishna Bandaru wrote:
>
>
>
> On Tue, Sep 10, 2024 at 7:17 PM Andrew Dunstan <andrew@dunslane.net>
> wrote:
>
>>
>> On 2024-09-10 Tu 7:51 AM, Andrew Dunstan wrote:
>>
>>
>> On 2024-09-10 Tu 6:20 AM, Muralikrishna Bandaru wrote:
>>
>> Hi,
>> I built PG17 rc1 using meson on Windows with the option
>> "-Dplperl=enabled" . When I tried to create the extension,it crashed the
>> database.
>> --
>> postgres=# create extension plperl;
>> server closed the connection unexpectedly
>> This probably means the server terminated abnormally
>> before or while processing the request.
>> The connection to the server was lost. Attempting reset: Succeeded.
>>
>> The log contains the following error.
>>
>> *src/pl/plperl/Util.c: loadable library and perl binaries are mismatched
>> (got first handshake key 0000000012d00080, needed 0000000012c00080)*
>> --
>> This issue is seen with strawberry perl *5.40* not with *5.38* . The
>> Perl that is used during compilation and on the target machine is the same.
>>
>> I have used strawberry perl 5.40 , which is available in the strawberry
>> perl home page <https://strawberryperl.com/; ,but 5.40 is not
>> available in the release page <https://strawberryperl.com/releases.html;
>> . So, is it recommended to use perl 5.40 ?
>>
>> Please let me know if you need any other information.
>>
>>
>> We've seen similar things before. See for example:
>>
>> https://postgr.es/m/20211005004334.tgjmro4kuachwiuc@alap3.anarazel.de
>> https://postgr.es/m/c2da86a0-2906-744c-923d-16da6047875e@dunslane.net
>>
>> This looks like we are defining something we should not be, or not
>> defining something we should be. We just need to find out what it is :-)
>>
>> In the meantime, I would suggest sticking to 5.38.
>>
>>
>>
>>
>>
>> Now I've had a chance to take a look I see that Strawberry 5.40 has
>> USE_THREAD_SAFE_LOCALE defined. Can you try what happens with 5.40 if you
>> comment out theses lines in meson.build?
>>
>>
>> if cc.get_id() == 'msvc'
>> # prevent binary mismatch between MSVC built plperl and
>> Strawberry or
>> # msys ucrt perl libraries
>> perl_ccflags += ['-DNO_THREAD_SAFE_LOCALE']
>> endif
>>
>>
>> Hi Andrew,
> Thanks. I commented above lines in the meson.build file and built the
> installer with Strawberry 5.40 . Now able to create the extension.
> --
> c:\Program Files\PostgreSQL\17>bin\psql.exe -d postgres -p 5436
> psql (17rc1)
> WARNING: Console code page (437) differs from Windows code page (1252)
> 8-bit characters might not work correctly. See psql reference
> page "Notes for Windows users" for details.
> Type "help" for help.
>
> postgres=#
> postgres=#
> postgres=# create extension plperl;
> --
> So, will this change be a part of the PG17 GA release?
>
>
>>
> Probably not. The difficulty is that it's required for some versions of
> perl and breaks others. We need to come up with a reliable test for it.
>
> Maybe we need to look at the output of `perl -V` and only output the flag
> if it doesn't contain USE_THREAD_SAFE_LOCALE. If anyone has a better idea I
> am all ears.
>
> It's kind of annoying that this could tie us so closely to a particular
> perl binary.
>
>
>
>
> Here's a patch along the suggested lines.
>
>
>
>
> Pushed. All live branches now have the new logic.
>
Thank you Andrew.
>
> cheers
>
>
> andrew
>
> --
> Andrew Dunstan
> EDB: https://www.enterprisedb.com
>
>
^ permalink raw reply [nested|flat] 8+ messages in thread
end of thread, other threads:[~2024-09-14 16:59 UTC | newest]
Thread overview: 8+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2024-09-10 10:20 pl/perl extension fails on Windows Muralikrishna Bandaru <muralikrishna.bandaru@enterprisedb.com>
2024-09-10 11:51 ` Andrew Dunstan <andrew@dunslane.net>
2024-09-10 13:47 ` Andrew Dunstan <andrew@dunslane.net>
2024-09-11 07:37 ` Muralikrishna Bandaru <muralikrishna.bandaru@enterprisedb.com>
2024-09-11 11:36 ` Andrew Dunstan <andrew@dunslane.net>
2024-09-12 13:57 ` Andrew Dunstan <andrew@dunslane.net>
2024-09-14 14:42 ` Andrew Dunstan <andrew@dunslane.net>
2024-09-14 16:59 ` Muralikrishna Bandaru <muralikrishna.bandaru@enterprisedb.com>
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox