Discussion:
[perl #124189] [PATCH] remove all usage of dl_undef_symbols on platforms where its a nop
bulk88 (via RT)
2015-03-27 08:00:10 UTC
Permalink
# New Ticket Created by bulk88
# Please include the string: [perl #124189]
# in the subject line of all future correspondence about this issue.
# <URL: https://rt.perl.org/Ticket/Display.html?id=124189 >


This is a bug report for perl from ***@hotmail.com,
generated with the help of perlbug 1.40 running under perl 5.21.4.


-----------------------------------------------------------------
[Please describe your issue here]

See attached patch.

[Please do not change anything below this line]
-----------------------------------------------------------------
---
Flags:
category=core
severity=low
---
Site configuration information for perl 5.21.4:

Configured by Owner at Thu Sep 18 12:08:58 2014.

Summary of my perl5 (revision 5 version 21 subversion 4) configuration:
Derived from: 7d2b2edb94ab56333b9049a3e26d15ea18445512
Ancestor: 19be3be6968e2337bcdfe480693fff795ecd1304
Platform:
osname=MSWin32, osvers=5.1,
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, bincompat5005=undef
Compiler:
cc='cl', ccflags ='-nologo -GF -W3 -O1 -MD -Zi -DNDEBUG
-DWIN32
-D_CONSOLE -DNO_STRICT -DPERL_TEXTMODE_SCRIPTS
-DPERL_HASH_FUNC_ONE_AT_A_TIME -DPERL_IMPLICIT_CONTEXT
-DPERL_IMPLICIT_SYS -DUSE_PERLIO -D_USE_32BIT_TIME_T',
optimize='-O1 -MD -Zi -DNDEBUG',
cppflags='-DWIN32'
ccversion='12.00.8168', gccversion='', gccosandvers=''
intsize=4, longsize=4, ptrsize=4, doublesize=8,
byteorder=1234
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
-libpath:"c:\perl521\lib\CORE" -machine:x86'
libpth=C:\PROGRA~1\MIAF9D~1\VC98\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=perl521.lib
gnulibc_version=''
Dynamic Linking:
dlsrc=dl_win32.xs, dlext=dll, d_dlsymun=undef,
ccdlflags=' '
cccdlflags=' ', lddlflags='-dll -nologo -nodefaultlib
-debug
-opt:ref,icf -libpath:"c:\perl521\lib\CORE" -machine:x86'

Locally applied patches:
uncommitted-changes
a0fe7a7e75de29e59f1da0d6822dc06e5be658fe
a261faffee83d0145642ab5d1d046c9f813bc497
6506ab86ad1602a9ca720fcd30446dce1461d23d
7d2b2edb94ab56333b9049a3e26d15ea18445512

---
@INC for perl 5.21.4:
lib
C:/perl521/srcnew/lib
.

---
Environment for perl 5.21.4:
HOME (unset)
LANG (unset)
LANGUAGE (unset)
LD_LIBRARY_PATH (unset)
LOGDIR (unset)
PATH=
PERL_BADLANG (unset)
PERL_JSON_BACKEND=Cpanel::JSON::XS
PERL_YAML_BACKEND=YAML
SHELL (unset)
Tony Cook via RT
2015-03-29 22:28:27 UTC
Permalink
Only freemint uses it. Change dl_undef_symbols to be a vararg on platforms
that dont implement it, since a vararg skips the computing the number of
incoming items, and the conditional branch testing the item count, and
the call to Perl_croak_xs_usage. This makes the machine code smaller for
dl_undef_symbols on platforms that dont implement it.
It also means that code that mistakenly calls dl_undef_symbols() with parameters
will only break on the platform where it's a no-op.

Tony

---
via perlbug: queue: perl5 status: new
https://rt.perl.org/Ticket/Display.html?id=124189
bulk88 via RT
2015-03-30 00:50:56 UTC
Permalink
Post by Tony Cook via RT
It also means that code that mistakenly calls dl_undef_symbols() with
parameters
will only break on the platform where it's a no-op.
Tony
The intention of the patch is to make dl_undef_symbols as close to "deprecated" as possible, or as close to "not public API" as possible without officially saying that. Old code that calls dl_undef_symbols will continue to work uneventfully. There is little usage of this sub on CPAN grep http://grep.cpan.me/?q=+dl_undef_symbols . Anyone who calls this very specialized rarely written sub, will read DynaLoader.pm and know it takes no args. If they want to pass args that will be ignored and burn CPU we can't stop them. Most PP code, including p5p code never checks @_ count on sub entry.

The patch turns "sub { die "wrong items" if @_ != 0; return ();}" into "sub {return ();}". Maybe freemint should also be made "..." prototype, if you want it that way, so all platforms behavior is identical. The prototype of dl_undef_symbols in the docs shouldn't change.
--
bulk88 ~ bulk88 at hotmail.com

---
via perlbug: queue: perl5 status: open
https://rt.perl.org/Ticket/Display.html?id=124189
Tony Cook via RT
2015-08-11 01:34:43 UTC
Permalink
Post by bulk88 via RT
Post by Tony Cook via RT
It also means that code that mistakenly calls dl_undef_symbols() with
parameters
will only break on the platform where it's a no-op.
Tony
The intention of the patch is to make dl_undef_symbols as close to
"deprecated" as possible, or as close to "not public API" as possible
without officially saying that. Old code that calls dl_undef_symbols
will continue to work uneventfully. There is little usage of this sub
on CPAN grep http://grep.cpan.me/?q=+dl_undef_symbols . Anyone who
calls this very specialized rarely written sub, will read
DynaLoader.pm and know it takes no args. If they want to pass args
that will be ignored and burn CPU we can't stop them. Most PP code,
"sub {return ();}". Maybe freemint should also be made "..."
prototype, if you want it that way, so all platforms behavior is
identical. The prototype of dl_undef_symbols in the docs shouldn't
change.
The patch is good except for making dl_undef_symbols() varargs, leave the various implementations as () and I'll apply it.

Tony




---
via perlbug: queue: perl5 status: open
https://rt.perl.org/Ticket/Display.html?id=124189

Loading...