Skip Menu |
Report information
Id: 133098
Status: pending release
Priority: 0/
Queue: perl5

Owner: Nobody
Requestors: bulk88 <bulk88 [at] hotmail.com>
Cc:
AdminCc:

Operating System: (no value)
PatchStatus: (no value)
Severity: low
Type: core
Perl Version: 5.27.9
Fixed In: (no value)

Attachments
0001-fix-DNO_MATHOMS-build-mathomed-syms-were-not-removed.patch



Date: Wed, 11 Apr 2018 06:31:03 +0000
Subject: [PATCH] fix -DNO_MATHOMS build, mathomed syms were not removed from perldll.def
From: bulk 88 <bulk88 [...] hotmail.com>
To: "perlbug [...] perl.org" <perlbug [...] perl.org>
Download (untitled) / with headers
text/plain 4.5k
This is a bug report for perl from bulk88@hotmail.com, generated with the help of perlbug 1.41 running under perl 5.27.9. ----------------------------------------------------------------- [Please describe your issue here] See attached patch. This probably should go into 5.28 but I'm not 100% sure because of timing and some risk of leaving out a symbol/CPAN breakage, but I'll guess I'm the only person in the world who compiles -DNO_MATHOMS since nobody else noticed the problem in 2 yrs, so if a symbol is left out that shouldn't have been, oh well, the feature was broken in the last stable anyway. Better than waiting a year. Backport too since its been broken since 5.25.0-5.25.1. See also https://www.nntp.perl.org/group/perl.perl5.porters/2018/04/msg250381.html [Please do not change anything below this line] ----------------------------------------------------------------- --- Flags: category=core severity=low --- Site configuration information for perl 5.27.9: Configured by Administrator at Tue Jan 30 20:34:30 2018. Summary of my perl5 (revision 5 version 27 subversion 9) configuration: Platform: osname=MSWin32 osvers=5.2.3790 archname=MSWin32-x86-multi-thread uname='' config_args='undef' hint=recommended useposix=true d_sigaction=undef useithreads=define usemultiplicity=define use64bitint=undef use64bitall=undef uselongdouble=undef usemymalloc=n default_inc_excludes_dot=define bincompat5005=undef Compiler: cc='cl' ccflags ='-nologo -GF -W3 -O1 -MD -Zi -DNDEBUG -GL -DWIN32 -D_CONSOLE -DNO_STRICT -D_CRT_SECURE_NO_DEPRECATE -D_CRT_NONSTDC_NO_DEPRECATE -DPERL_TEXTMODE_SCRIPTS -DPERL_IMPLICIT_CONTEXT -DPERL_IMPLICIT_SYS -DWIN32_NO_REGISTRY' optimize='-O1 -MD -Zi -DNDEBUG -GL' cppflags='-DWIN32' ccversion='15.00.30729.01' gccversion='' gccosandvers='' intsize=4 longsize=4 ptrsize=4 doublesize=8 byteorder=1234 doublekind=3 d_longlong=undef longlongsize=8 d_longdbl=define longdblsize=8 longdblkind=0 ivtype='long' ivsize=4 nvtype='double' nvsize=8 Off_t='__int64' lseeksize=8 alignbytes=8 prototype=define Linker and Libraries: ld='link' ldflags ='-nologo -nodefaultlib -debug -opt:ref,icf -ltcg -libpath:"c:\perl\lib\CORE" -machine:x86' libpth="C:\Program Files (x86)\Microsoft Visual Studio 9.0\VC\lib" libs=oldnames.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib netapi32.lib uuid.lib ws2_32.lib mpr.lib winmm.lib version.lib odbc32.lib odbccp32.lib comctl32.lib msvcrt.lib perllibs=oldnames.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib netapi32.lib uuid.lib ws2_32.lib mpr.lib winmm.lib version.lib odbc32.lib odbccp32.lib comctl32.lib msvcrt.lib libc=msvcrt.lib so=dll useshrplib=true libperl=perl527.lib gnulibc_version='' Dynamic Linking: dlsrc=dl_win32.xs dlext=dll d_dlsymun=undef ccdlflags=' ' cccdlflags=' ' lddlflags='-dll -nologo -nodefaultlib -debug -opt:ref,icf -ltcg -libpath:"c:\perl\lib\CORE" -machine:x86' --- @INC for perl 5.27.9: lib C:/p527/srcnew/lib --- Environment for perl 5.27.9: CYGWIN=tty HOME (unset) LANG (unset) LANGUAGE (unset) LD_LIBRARY_PATH=/usr/lib/x86:/usr/X11R6/lib LOGDIR (unset) PATH=C:\WINDOWS\system32;C:\Program Files (x86)\Microsoft Visual Studio 9.0\VC\BIN;C:\Program Files\Microsoft SDKs\Windows\v6.0A\bin;C:\Perl\bin;C:\WINDOWS;C:\Program Files (x86)\Microsoft Visual Studio 9.0\Common7\IDE;C:\Program Files (x86)\Git\bin;C:\sp3220\c\bin; PERL_BADLANG (unset) SHELL (unset)

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

Date: Wed, 11 Apr 2018 22:01:32 -0600
To: perl5-porters [...] perl.org
From: Karl Williamson <public [...] khwilliamson.com>
Subject: Re: [perl #133098] [PATCH] fix -DNO_MATHOMS build, mathomed syms were not removed from perldll.def
Download (untitled) / with headers
text/plain 1.7k
On 04/11/2018 12:31 AM, bulk88 (via RT) wrote: Show quoted text
> # New Ticket Created by bulk88 > # Please include the string: [perl #133098] > # in the subject line of all future correspondence about this issue. > # <URL: https://rt.perl.org/Ticket/Display.html?id=133098 > > > > This is a bug report for perl from bulk88@hotmail.com, > generated with the help of perlbug 1.41 running under perl 5.27.9. > > > ----------------------------------------------------------------- > [Please describe your issue here] > > See attached patch. This probably should go into 5.28 but I'm not 100% > sure because of timing and some risk of leaving out a symbol/CPAN > breakage, but I'll guess I'm the only person in the world who compiles > -DNO_MATHOMS since nobody else noticed the problem in 2 yrs, so if a > symbol is left out that shouldn't have been, oh well, the feature was > broken in the last stable anyway. Better than waiting a year. Backport > too since its been broken since 5.25.0-5.25.1. > > See also > https://www.nntp.perl.org/group/perl.perl5.porters/2018/04/msg250381.html >
My default mode of compiling is -DNO_MATHOMS, so that I would find any breakage. But I just use the default options on Windows dromedary, so wouldn't see it there. AIX has long had warnings like this: ld: 0711-319 WARNING: Exported symbol not defined: ASCII_TO_NEED which I never thought was high enough priority to investigate. But this ticket explains it. I tried your patch on Linux, and surprisingly to me, it generated test failures # Failed test 1 in t/pv_tools.t at line 54 # Test 7 got: "N\\375 Batter\\355" (t/pv_tools.t at line 64) # Expected: "N\\303\\275 Batter\\303" # Test 9 got: "\\301g\\346tis Byrju..." (t/pv_tools.t at line 67) # Expected: "\\303\\201g\\303\\246t..." which I haven't investigated.
RT-Send-CC: perl5-porters [...] perl.org
Download (untitled) / with headers
text/plain 1.8k
On Wed, 11 Apr 2018 21:02:03 -0700, public@khwilliamson.com wrote: Show quoted text
> My default mode of compiling is -DNO_MATHOMS, so that I would find any > breakage. But I just use the default options on Windows dromedary, so > wouldn't see it there. > > AIX has long had warnings like this: > ld: 0711-319 WARNING: Exported symbol not defined: ASCII_TO_NEED > > which I never thought was high enough priority to investigate. But this > ticket explains it. > > I tried your patch on Linux, and surprisingly to me, it generated test > failures > > # Failed test 1 in t/pv_tools.t at line 54 > # Test 7 got: "N\\375 Batter\\355" (t/pv_tools.t at line 64) > # Expected: "N\\303\\275 Batter\\303" > # Test 9 got: "\\301g\\346tis Byrju..." (t/pv_tools.t at line 67) > # Expected: "\\303\\201g\\303\\246t..." > > which I haven't investigated.
I also get test failures in ../dist/Devel-PPPort/t/pv_tools.t ---------------------------- C:\perl521\srcnew\win32>cd ..\t & perl harness -v ../dist/Devel-PPPort/t/pv_to ols.t & cd ..\win32 ../dist/Devel-PPPort/t/pv_tools.t .. 1..13 # Running under perl version 5.027011 for MSWin32 # Current time local: Thu Apr 12 07:41:46 2018 # Current time GMT: Thu Apr 12 11:41:46 2018 # Using Test.pm version 1.31 # Failed test 1 in t/pv_tools.t at line 54 not ok 1 # Test 7 got: "N\\375 Batter\\355" (t/pv_tools.t at line 64) ok 2# Expected: "N\\303\\275 Batter\\303" ok 3 # Test 9 got: "\\301g\\346tis Byrju..." (t/pv_tools.t at line 67) ok 4 # Expected: "\\303\\201g\\303\\246t..." ok 5 ok 6 not ok 7 ok 8 not ok 9 ok 10 ok 11 ok 12 ok 13 Failed 3/13 subtests Test Summary Report ------------------- ../dist/Devel-PPPort/t/pv_tools.t (Wstat: 0 Tests: 13 Failed: 3) Failed tests: 1, 7, 9 Files=1, Tests=13, 0 wallclock secs ( 0.02 usr + 0.00 sys = 0.02 CPU) Result: FAIL C:\perl521\srcnew\win32> ----------------------------------- -- bulk88 ~ bulk88 at hotmail.com
RT-Send-CC: perl5-porters [...] perl.org
Download (untitled) / with headers
text/plain 2.5k
First test failure, ------------------------- void pv_escape_can_unicode() PPCODE: #if defined(is_utf8_string) && defined(utf8_to_uvchr) XSRETURN_YES; #else XSRETURN_NO; #endif ------------------------- -------------------------------- my $uni = &Devel::PPPort::pv_escape_can_unicode(); # sanity check ok($uni ? $] >= 5.006 : $] < 5.008); -------------------------------- Since CPP macro utf8_to_uvchr is now undefined because of -DNO_MATHOMS and embed.h, while before I think the macro was defined to the Perl_utf8_to_uvchr, but nothing ever in core referenced the C symbol so it all linked together even tho the func isn't defined anywhere. So thats the first test fail. utf8_to_uvchr was moved to mathoms.c in 5.21.1 https://perl5.git.perl.org/perl.git/commitdiff/f2645549e6a4bfca055b5fd1932da462df424921 utf8_to_uvchr was supposedly added in 5.7.1. ppport uses utf8_to_uvchr as part of its pv_escape replacement https://perl5.git.perl.org/perl.git/blob/5f6af817add6d2df3603e0e94b6eb27ba5fb3970:/dist/Devel-PPPort/parts/inc/pv_tools#l74 but native pv_escape was added in 5.9.4 supposedly, so 5.21.1 and up that deprecated/removed utf8_to_uvchr() in -DNO_MATHOMS will never run into a link failure because they will always use native pv_escape and not the ppport.h fill in. The native pv_escape uses utf8_to_uvchr_buf() instead of utf8_to_uvchr() https://perl5.git.perl.org/perl.git/blob/5f6af817add6d2df3603e0e94b6eb27ba5fb3970:/dump.c#l166 since https://perl5.git.perl.org/perl.git/commitdiff/4b88fb76efce8c436e63b907c9842345d4fa77c7 in 5.15.9 If I add a ! op to dist/Devel-PPPort/t/pv_tools.t -------------------------- my $uni = &Devel::PPPort::pv_escape_can_unicode(); $uni = ! $uni; # sanity check ok($uni ? $] >= 5.006 : $] < 5.008); -------------------------- the rest of the tests pass. So who is at fault? ppport or p5p for deprecating utf8_to_uvchr()? We cud stick an #ifndef utf8_to_uvchr # define utf8_to_uvchr(a,b) Perl_utf8_to_uvchr(aTHX_ a,b) #endif to counteract #ifndef NO_MATHOMS #define utf8_to_uvchr(a,b) Perl_utf8_to_uvchr(aTHX_ a,b) #endif in the perl headers somewhere, or change https://perl5.git.perl.org/perl.git/blob/5f6af817add6d2df3603e0e94b6eb27ba5fb3970:/dist/Devel-PPPort/parts/inc/pv_tools#l206 -------------------- void pv_escape_can_unicode() PPCODE: #if defined(is_utf8_string) && (defined(utf8_to_uvchr) || defined(utf8_to_uvchr_buf)) XSRETURN_YES; #else XSRETURN_NO; #endif ---------------------- -- bulk88 ~ bulk88 at hotmail.com
RT-Send-CC: perl5-porters [...] perl.org
Download (untitled) / with headers
text/plain 597b
I think its best to add safety as far back as possible, so I would want to define utf8_to_uvchr_buf in ppport.h in terms of plain utf8_to_uvchr, as they differ mainly in that the _buf version has better malformation checking. But alas, I could not get ppport stuff to work. So doing that change has to be deferred. So, in the meantime, I merely moved utf8_to_uvchr() away from mathoms.c, so it will always be defined. Commit 7723e0077ab2970477de35881407f68179022294 did that. Then the patch for this ticket works, and was pushed as 1545ba5b042c208e23333479730479c0acd55325 -- Karl Williamson


This service is sponsored and maintained by Best Practical Solutions and runs on Perl.org infrastructure.

For issues related to this RT instance (aka "perlbug"), please contact perlbug-admin at perl.org