Skip Menu |

This queue is for tickets about the version CPAN distribution.

Report information
The Basics
Id: 125042
Status: resolved
Priority: 0/
Queue: version

People
Owner: Nobody in particular
Requestors: skaji [...] cpan.org
SREZIC [...] cpan.org
Cc: khw [...] cpan.org
AdminCc:

Bug Information
Severity: (no value)
Broken in: (no value)
Fixed in: (no value)



Subject: version-0.9919: undefined symbol: LOCK_LC_NUMERIC_STANDARD
With version-0.9919, I got the following error under perl 5.8 - 5.20 (but not 5.22+): ``` ❯ perl -v This is perl 5, version 20, subversion 3 (v5.20.3) built for x86_64-linux ❯ curl -sSL http://cpanmin.us | perl - version --> Working on version Fetching http://www.cpan.org/authors/id/J/JP/JPEACOCK/version-0.9919.tar.gz ... OK Configuring version-0.9919 ... OK Building and testing version-0.9919 ... OK Successfully installed version-0.9919 (upgraded from 0.9909) 1 distribution installed ❯ perl -Mversion -e 'version->VERSION(1)' perl: symbol lookup error: /home/skaji/env/plenv/versions/5.20.3/lib/perl5/site_perl/5.20.3/x86_64-linux/auto/version/vxs/vxs.so: undefined symbol: LOCK_LC_NUMERIC_STANDARD ```
I've added Karl Williamson to this ticket, since he is the source of the original changeset. I think it is just a matter of defining that macro based on what is currently present in Perl core, but it may be more subtle than that.
Braindead extract from perl.h
Subject: patch_from_core.diff
diff -r b6c112ac77c3 vutil/vutil.h --- a/vutil/vutil.h Sun Apr 08 10:01:30 2018 -0400 +++ b/vutil/vutil.h Sun Apr 08 11:14:37 2018 -0400 @@ -255,4 +255,32 @@ #define UNLOCK_NUMERIC_STANDARD() #endif +#ifndef LOCK_LC_NUMERIC_STANDARD +/* Lock/unlock to the C locale until unlock is called. This needs to be + * recursively callable. [perl #128207] */ +# define LOCK_LC_NUMERIC_STANDARD() \ + STMT_START { \ + DEBUG_Lv(PerlIO_printf(Perl_debug_log, \ + "%s: %d: lock lc_numeric_standard: new depth=%d\n", \ + __FILE__, __LINE__, PL_numeric_standard + 1)); \ + __ASSERT_(PL_numeric_standard) \ + PL_numeric_standard++; \ + } STMT_END +#endif + +#ifndef UNLOCK_LC_NUMERIC_STANDARD +# define UNLOCK_LC_NUMERIC_STANDARD() \ + STMT_START { \ + if (PL_numeric_standard > 1) { \ + PL_numeric_standard--; \ + } \ + else { \ + assert(0); \ + } \ + DEBUG_Lv(PerlIO_printf(Perl_debug_log, \ + "%s: %d: lc_numeric_standard decrement lock, new depth=%d\n", \ + __FILE__, __LINE__, PL_numeric_standard)); \ + } STMT_END +#endif + /* ex: set ro: */
Sorry, I was wrong because version.pm only supports pure-perl under perl 5.8. (Not correct) I got the following error under perl 5.8 - 5.20 (Correct) I got the following error under perl 5.10 - 5.20 On 2018-04-08T10:49:48-04:00, SKAJI wrote: Show quoted text
> With version-0.9919, I got the following error under perl 5.8 - 5.20 > (but not 5.22+): > ``` > ❯ perl -v > This is perl 5, version 20, subversion 3 (v5.20.3) built for x86_64- > linux > > ❯ curl -sSL http://cpanmin.us | perl - version > --> Working on version > Fetching http://www.cpan.org/authors/id/J/JP/JPEACOCK/version- > 0.9919.tar.gz ... OK > Configuring version-0.9919 ... OK > Building and testing version-0.9919 ... OK > Successfully installed version-0.9919 (upgraded from 0.9909) > 1 distribution installed > > ❯ perl -Mversion -e 'version->VERSION(1)' > perl: symbol lookup error: > /home/skaji/env/plenv/versions/5.20.3/lib/perl5/site_perl/5.20.3/x86_64- > linux/auto/version/vxs/vxs.so: undefined symbol: > LOCK_LC_NUMERIC_STANDARD > ```
Subject: Re: [rt.cpan.org #125042] version-0.9919: undefined symbol: LOCK_LC_NUMERIC_STANDARD
Date: Sun, 8 Apr 2018 11:45:46 -0400
To: bug-version [...] rt.cpan.org
From: John Peacock <john.peacock [...] havurah-software.org>
I'm testing that potential patch with multiple Perl releases now. On Sun, Apr 8, 2018 at 11:43 AM, Shoichi Kaji via RT < bug-version@rt.cpan.org> wrote: Show quoted text
> Queue: version > Ticket <URL: https://rt.cpan.org/Ticket/Display.html?id=125042 > > > Sorry, I was wrong because version.pm only supports pure-perl under perl > 5.8. > > (Not correct) I got the following error under perl 5.8 - 5.20 > (Correct) I got the following error under perl 5.10 - 5.20 > > On 2018-04-08T10:49:48-04:00, SKAJI wrote:
> > With version-0.9919, I got the following error under perl 5.8 - 5.20 > > (but not 5.22+): > > ``` > > ❯ perl -v > > This is perl 5, version 20, subversion 3 (v5.20.3) built for x86_64- > > linux > > > > ❯ curl -sSL http://cpanmin.us | perl - version > > --> Working on version > > Fetching http://www.cpan.org/authors/id/J/JP/JPEACOCK/version- > > 0.9919.tar.gz ... OK > > Configuring version-0.9919 ... OK > > Building and testing version-0.9919 ... OK > > Successfully installed version-0.9919 (upgraded from 0.9909) > > 1 distribution installed > > > > ❯ perl -Mversion -e 'version->VERSION(1)' > > perl: symbol lookup error: > > /home/skaji/env/plenv/versions/5.20.3/lib/perl5/site_perl/5.20.3/x86_64- > > linux/auto/version/vxs/vxs.so: undefined symbol: > > LOCK_LC_NUMERIC_STANDARD > > ```
>
This should be defined to do nothing if it doesn't exist. I'm working on a patch now. But I don't understand a couple of things. There is also an equivalent UNLOCK. Why isn't that also giving an error? This should be #defined in vutil.h, but that is only #included if PERL_CORE is defined. And that doesn't make sense to me.
I investigated, and the name of these two macros changed in 5.28. And vutil.h did not get updated. Attached is a patch. I still don't understand why the UNLOCK did not generate an error; nor do I understand why vutil.h would fix it since it isn't #included unless PERL_CORE is defined (unless PERL_CORE is being wrongly defined)
Subject: 0008-vutil.h-Account-for-macro-name-change-in-5.28.patch
From 3cb31524a7b19b4594ca3bb762df883dbf7b1046 Mon Sep 17 00:00:00 2001 From: Karl Williamson <khw@cpan.org> Date: Sun, 8 Apr 2018 10:51:20 -0600 Subject: [PATCH 8/8] vutil.h: Account for macro name change in 5.28 The names of these macros changed, but vutil.h was not correspondingly updated --- vutil.h | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/vutil.h b/vutil.h index 193c66d561..fc2c39094a 100644 --- a/vutil.h +++ b/vutil.h @@ -252,7 +252,13 @@ const char * Perl_prescan_version(pTHX_ const char *s, bool strict, const char** #endif #ifndef UNLOCK_NUMERIC_STANDARD -#define UNLOCK_NUMERIC_STANDARD() + +/* The names of these changed in 5.28 */ +#ifndef LOCK_LC_NUMERIC_STANDARD +# define LOCK_LC_NUMERIC_STANDARD() LOCK_NUMERIC_STANDARD() +#endif +#ifndef UNLOCK_LC_NUMERIC_STANDARD +# define UNLOCK_LC_NUMERIC_STANDARD() UNLOCK_NUMERIC_STANDARD() #endif /* ex: set ro: */ -- 2.11.0
RT-Send-CC: john.peacock [...] havurah-software.org
On Sun Apr 08 10:54:59 2018, khw wrote: Show quoted text
> I investigated, and the name of these two macros changed in 5.28. And > vutil.h did not get updated. Attached is a patch. > > I still don't understand why the UNLOCK did not generate an error; nor > do I understand why vutil.h would fix it since it isn't #included > unless PERL_CORE is defined (unless PERL_CORE is being wrongly > defined)
Oops the previous patch was bad. Revised one attached
Subject: 0008-vutil.h-Account-for-macro-name-change-in-5.28.patch
From d80fad7136c6d2dafd566eca48b8f68373c37167 Mon Sep 17 00:00:00 2001 From: Karl Williamson <khw@cpan.org> Date: Sun, 8 Apr 2018 10:51:20 -0600 Subject: [PATCH 8/8] vutil.h: Account for macro name change in 5.28 The names of these macros changed, but vutil.h was not correspondingly updated --- vutil.h | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/vutil.h b/vutil.h index 193c66d561..dc66cbda66 100644 --- a/vutil.h +++ b/vutil.h @@ -255,4 +255,12 @@ const char * Perl_prescan_version(pTHX_ const char *s, bool strict, const char** #define UNLOCK_NUMERIC_STANDARD() #endif +/* The names of these changed in 5.28 */ +#ifndef LOCK_LC_NUMERIC_STANDARD +# define LOCK_LC_NUMERIC_STANDARD() LOCK_NUMERIC_STANDARD() +#endif +#ifndef UNLOCK_LC_NUMERIC_STANDARD +# define UNLOCK_LC_NUMERIC_STANDARD() UNLOCK_NUMERIC_STANDARD() +#endif + /* ex: set ro: */ -- 2.11.0
I also noticed the preprocessor directives were confusingly indented. Attached is a patch to make them consistent.
Subject: 0009-vutil.h-Properly-indent-preprocessor-directives.patch
From 2f81aa29043567fa6c52cd91a23d34cde8d2a2da Mon Sep 17 00:00:00 2001 From: Karl Williamson <khw@cpan.org> Date: Sun, 8 Apr 2018 11:05:40 -0600 Subject: [PATCH 9/9] vutil.h: Properly indent preprocessor directives This uses the perl core standard of two spaces for each nested level --- vutil.h | 39 +++++++++++++++++++-------------------- 1 file changed, 19 insertions(+), 20 deletions(-) diff --git a/vutil.h b/vutil.h index dc66cbda66..ffeb05cae3 100644 --- a/vutil.h +++ b/vutil.h @@ -226,33 +226,32 @@ const char * Perl_prescan_version(pTHX_ const char *s, bool strict, const char** #if PERL_VERSION_LT(5,27,9) # define LC_NUMERIC_LOCK # define LC_NUMERIC_UNLOCK -# if PERL_VERSION_LT(5,19,0) -# undef STORE_LC_NUMERIC_SET_STANDARD -# undef RESTORE_LC_NUMERIC -# undef DECLARATION_FOR_LC_NUMERIC_MANIPULATION -# ifdef USE_LOCALE -# define DECLARATION_FOR_LC_NUMERIC_MANIPULATION char *loc -# define STORE_NUMERIC_SET_STANDARD()\ - loc = savepv(setlocale(LC_NUMERIC, NULL)); \ - SAVEFREEPV(loc); \ - setlocale(LC_NUMERIC, "C"); - -# define RESTORE_LC_NUMERIC()\ - setlocale(LC_NUMERIC, loc); -# else -# define DECLARATION_FOR_LC_NUMERIC_MANIPULATION -# define STORE_LC_NUMERIC_SET_STANDARD() -# define RESTORE_LC_NUMERIC() -# endif +# if PERL_VERSION_LT(5,19,0) +# undef STORE_LC_NUMERIC_SET_STANDARD +# undef RESTORE_LC_NUMERIC +# undef DECLARATION_FOR_LC_NUMERIC_MANIPULATION +# ifdef USE_LOCALE +# define DECLARATION_FOR_LC_NUMERIC_MANIPULATION char *loc +# define STORE_NUMERIC_SET_STANDARD()\ + loc = savepv(setlocale(LC_NUMERIC, NULL)); \ + SAVEFREEPV(loc); \ + setlocale(LC_NUMERIC, "C"); +# define RESTORE_LC_NUMERIC()\ + setlocale(LC_NUMERIC, loc); +# else +# define DECLARATION_FOR_LC_NUMERIC_MANIPULATION +# define STORE_LC_NUMERIC_SET_STANDARD() +# define RESTORE_LC_NUMERIC() +# endif # endif #endif #ifndef LOCK_NUMERIC_STANDARD -#define LOCK_NUMERIC_STANDARD() +# define LOCK_NUMERIC_STANDARD() #endif #ifndef UNLOCK_NUMERIC_STANDARD -#define UNLOCK_NUMERIC_STANDARD() +# define UNLOCK_NUMERIC_STANDARD() #endif /* The names of these changed in 5.28 */ -- 2.11.0
On Sun Apr 08 13:07:42 2018, khw wrote: Show quoted text
> I also noticed the preprocessor directives were confusingly indented. > Attached is a patch to make them consistent.
This patch does not apply. I am not seeing the PERL_VERSION_LT(5,27,9) block at all. Can you just include the properly formatted vutil.h instead? I'll be offline until after dinner probably. John
Subject: Re: [rt.cpan.org #125042] version-0.9919: undefined symbol: LOCK_LC_NUMERIC_STANDARD
Date: Sun, 8 Apr 2018 11:57:40 -0600
To: bug-version [...] rt.cpan.org, SREZIC [...] cpan.org, skaji [...] cpan.org
From: Karl Williamson <khw [...] cpan.org>
On 04/08/2018 11:37 AM, John Peacock via RT wrote: Show quoted text
> <URL: https://rt.cpan.org/Ticket/Display.html?id=125042 > > > On Sun Apr 08 13:07:42 2018, khw wrote:
>> I also noticed the preprocessor directives were confusingly indented. >> Attached is a patch to make them consistent.
> > > This patch does not apply. I am not seeing the PERL_VERSION_LT(5,27,9) block at all. Can you just include the properly formatted vutil.h instead? > > I'll be offline until after dinner probably. > > John >
Attached, I don't know what timezone you're in

Message body is not shown because sender requested not to inline it.

Tested new vutil.h with the following Perl releases: perl-5.22.4 perl-5.16.3 perl-5.10.1 perl-5.8.9 (pure-Perl only) Released 00.9920 to CPAN
Thanks jpeacock and khw! On 2018-04-08T18:45:29-04:00, JPEACOCK wrote: Show quoted text
> Tested new vutil.h with the following Perl releases: > perl-5.22.4 > perl-5.16.3 > perl-5.10.1 > perl-5.8.9 (pure-Perl only) > > Released 00.9920 to CPAN