Skip Menu |
Report information
Id: 124068
Status: resolved
Priority: 0/
Queue: perl5

Owner: Nobody
Requestors:
Cc:
AdminCc:

Operating System: (no value)
PatchStatus: HasPatch
Severity: low
Type: unknown
Perl Version: (no value)
Fixed In: (no value)

Attachments
0001-DynaLoader-1.33-dl_find_symbol-add-3rd-optional-argu.patch
0002-DynaLoader-dl_-.xs-Define-all-PERL_IN_DL_-_XS-marker.patch
0003-DynaLoader-extend-t-DynaLoader.t-to-be-run-from-base.patch



From: rurban [...] cpanel.net
Date: Sat, 14 Mar 2015 11:55:44 +0100
To: perlbug [...] perl.org
Subject: [PATCH 8-10/11] DynaLoader 1.33 various
Download (untitled) / with headers
text/plain 6.5k
This is a bug report for perl from rurban@cpanel.net, generated with the help of perlbug 1.40 running under perl 5.21.9. ----------------------------------------------------------------- 3 DynaLoader patches: DynaLoader 1.33 dl_find_symbol add 3rd optional argument On Darwin DynaLoader::bootstrap tries dl_find_symbol first with libhandle 0, to see if the shlib with the symbol is already loaded, e.g. with libc. We do not want to store the dl_last_error information for this mostly failing probe, so add an optional ign_err=0 argument. Similar for dl_find_symbol_anywhere, which is expected to fail for all librefs. Also support dl_last_error on symbian, as on all other platforms. DynaLoader/dl_*.xs: Define all PERL_IN_DL_*_XS markers On Symbian harmonize with the rest. extend t/DynaLoader.t to be run from basedir also. This simplifies testing from core. ----------------------------------------------------------------- --- Flags: category=library severity=medium Type=Patch PatchStatus=HasPatch module=DynaLoader --- Site configuration information for perl 5.21.9: Configured by rurban at Sun Feb 22 17:14:55 CET 2015. Summary of my perl5 (revision 5 version 21 subversion 9) configuration: Platform: osname=linux, osvers=3.16.0-4-amd64, archname=x86_64-linux-debug uname='linux reini 3.16.0-4-amd64 #1 smp debian 3.16.7-ckt2-1 (2014-12-08) x86_64 gnulinux ' config_args='-de -Dusedevel -Uversiononly -Dinstallman1dir=none -Dinstallman3dir=none -Dinstallsiteman1dir=none -Dinstallsiteman3dir=none -DEBUGGING -Doptimize='-g3' -Uuseithreads -D'cc=gcc-5.0' -Accflags=''-msse4.2'' -Accflags=''-march=corei7'' -Dcf_email=''rurban@cpanel.net'' -Dperladmin=''rurban@cpanel.net''' hint=recommended, useposix=true, d_sigaction=define useithreads=undef, usemultiplicity=undef use64bitint=define, use64bitall=define, uselongdouble=undef usemymalloc=n, bincompat5005=undef Compiler: cc='gcc-5.0', ccflags ='-msse4.2 -march=corei7 -fwrapv -DDEBUGGING -fno-strict-aliasing -pipe -fstack-protector-strong -I/usr/local/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64', optimize='-g3', cppflags='-msse4.2 -march=corei7 -fwrapv -DDEBUGGING -fno-strict-aliasing -pipe -fstack-protector-strong -I/usr/local/include' ccversion='', gccversion='5.0.0 20150103 (experimental)', gccosandvers='' intsize=4, longsize=8, ptrsize=8, doublesize=8, byteorder=12345678, doublekind=3 d_longlong=define, longlongsize=8, d_longdbl=define, longdblsize=16, longdblkind=3 ivtype='long', ivsize=8, nvtype='double', nvsize=8, Off_t='off_t', lseeksize=8 alignbytes=8, prototype=define Linker and Libraries: ld='gcc-5.0', ldflags =' -fstack-protector-strong -L/usr/local/lib' libpth=/usr/local/lib /usr/local/lib/gcc/x86_64-unknown-linux-gnu/5.0.0/include-fixed /usr/include/x86_64-linux-gnu /usr/lib /lib/x86_64-linux-gnu /lib/../lib /usr/lib/x86_64-linux-gnu /usr/lib/../lib /lib /lib64 /usr/lib64 /usr/local/lib64 libs=-lpthread -lnsl -lgdbm -ldb -ldl -lm -lcrypt -lutil -lc -lgdbm_compat perllibs=-lpthread -lnsl -ldl -lm -lcrypt -lutil -lc libc=libc-2.19.so, so=so, useshrplib=false, libperl=libperl.a gnulibc_version='2.19' Dynamic Linking: dlsrc=dl_dlopen.xs, dlext=so, d_dlsymun=undef, ccdlflags='-Wl,-E' cccdlflags='-fPIC', lddlflags='-shared -g3 -L/usr/local/lib -fstack-protector-strong' Locally applied patches: Devel::PatchPerl 1.30 --- @INC for perl 5.21.9: /usr/local/lib/perl5/site_perl/5.21.9/x86_64-linux-debug /usr/local/lib/perl5/site_perl/5.21.9 /usr/local/lib/perl5/5.21.9/x86_64-linux-debug /usr/local/lib/perl5/5.21.9 /usr/local/lib/perl5/site_perl/5.21.8 /usr/local/lib/perl5/site_perl/5.21.7 /usr/local/lib/perl5/site_perl/5.21.4 /usr/local/lib/perl5/site_perl/5.21.3 /usr/local/lib/perl5/site_perl/5.21.2 /usr/local/lib/perl5/site_perl/5.21.1 /usr/local/lib/perl5/site_perl/5.21.0 /usr/local/lib/perl5/site_perl/5.20.1 /usr/local/lib/perl5/site_perl/5.20.0 /usr/local/lib/perl5/site_perl/5.19.11 /usr/local/lib/perl5/site_perl/5.19.10 /usr/local/lib/perl5/site_perl/5.19.9 /usr/local/lib/perl5/site_perl/5.19.8 /usr/local/lib/perl5/site_perl/5.19.7 /usr/local/lib/perl5/site_perl/5.19.6 /usr/local/lib/perl5/site_perl/5.19.5 /usr/local/lib/perl5/site_perl/5.19.4 /usr/local/lib/perl5/site_perl/5.19.3 /usr/local/lib/perl5/site_perl/5.19.2 /usr/local/lib/perl5/site_perl/5.19.1 /usr/local/lib/perl5/site_perl/5.19.0 /usr/local/lib/perl5/site_perl/5.18.4 /usr/local/lib/perl5/site_perl/5.18.2 /usr/local/lib/perl5/site_perl/5.18.1 /usr/local/lib/perl5/site_perl/5.18.0 /usr/local/lib/perl5/site_perl/5.17.11 /usr/local/lib/perl5/site_perl/5.17.10 /usr/local/lib/perl5/site_perl/5.17.8 /usr/local/lib/perl5/site_perl/5.17.7 /usr/local/lib/perl5/site_perl/5.17.6 /usr/local/lib/perl5/site_perl/5.17.5 /usr/local/lib/perl5/site_perl/5.17.4 /usr/local/lib/perl5/site_perl/5.17.3 /usr/local/lib/perl5/site_perl/5.17.2 /usr/local/lib/perl5/site_perl/5.17.1 /usr/local/lib/perl5/site_perl/5.17.0 /usr/local/lib/perl5/site_perl/5.17 /usr/local/lib/perl5/site_perl/5.16.3 /usr/local/lib/perl5/site_perl/5.16.2 /usr/local/lib/perl5/site_perl/5.16.1 /usr/local/lib/perl5/site_perl/5.16.0 /usr/local/lib/perl5/site_perl/5.15.9 /usr/local/lib/perl5/site_perl/5.15.8 /usr/local/lib/perl5/site_perl/5.15.7 /usr/local/lib/perl5/site_perl/5.15.6 /usr/local/lib/perl5/site_perl/5.15.5 /usr/local/lib/perl5/site_perl/5.15.4 /usr/local/lib/perl5/site_perl/5.15.3 /usr/local/lib/perl5/site_perl/5.15.2 /usr/local/lib/perl5/site_perl/5.14.4 /usr/local/lib/perl5/site_perl/5.14.3 /usr/local/lib/perl5/site_perl/5.14.2 /usr/local/lib/perl5/site_perl/5.14.1 /usr/local/lib/perl5/site_perl/5.12.5 /usr/local/lib/perl5/site_perl/5.12.4 /usr/local/lib/perl5/site_perl/5.10.1 /usr/local/lib/perl5/site_perl/5.8.9 /usr/local/lib/perl5/site_perl/5.8.8 /usr/local/lib/perl5/site_perl/5.8.7 /usr/local/lib/perl5/site_perl/5.8.6 /usr/local/lib/perl5/site_perl/5.8.5 /usr/local/lib/perl5/site_perl/5.8.4 /usr/local/lib/perl5/site_perl/5.8.3 /usr/local/lib/perl5/site_perl/5.8.2 /usr/local/lib/perl5/site_perl/5.8.1 /usr/local/lib/perl5/site_perl/5.6.2 /usr/local/lib/perl5/site_perl . --- Environment for perl 5.21.9: HOME=/home/rurban LANG=en_US.utf8 LANGUAGE (unset) LD_LIBRARY_PATH (unset) LOGDIR (unset) PATH=/home/rurban/bin:/usr/local/bin:/usr/bin:/bin:/usr/local/games:/usr/games PERL_BADLANG (unset) SHELL=/bin/bash

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

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

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

RT-Send-CC: perl5-porters [...] perl.org
Download (untitled) / with headers
text/plain 1.1k
On Sat Mar 14 03:56:00 2015, rurban@cpanel.net wrote: Show quoted text
> 3 DynaLoader patches: > DynaLoader 1.33 dl_find_symbol add 3rd optional argument > > On Darwin DynaLoader::bootstrap tries dl_find_symbol first with > libhandle 0, > to see if the shlib with the symbol is already loaded, e.g. with > libc. We > do not want to store the dl_last_error information for this mostly > failing > probe, so add an optional ign_err=0 argument. > Similar for dl_find_symbol_anywhere, which is expected to fail for all > librefs. > > Also support dl_last_error on symbian, as on all other platforms. > > DynaLoader/dl_*.xs: Define all PERL_IN_DL_*_XS markers > On Symbian harmonize with the rest. > > extend t/DynaLoader.t to be run from basedir also. This simplifies > testing > from core.
This patch breaks the build on Win32, presumably because of this: --- ext/DynaLoader/dl_win32.xs +++ ext/DynaLoader/dl_win32.xs @@ -157,9 +157,10 @@ dl_unload_file(libref) RETVAL void -dl_find_symbol(libhandle, symbolname) + dl_find_symbol(libhandle, symbolname, ign_err=0) void * libhandle char * symbolname + int ign_err Tony
Date: Fri, 03 Apr 2015 11:59:03 +0200
From: Reini Urban <rurban [...] cpanel.net>
Subject: Re: [perl #124068] [PATCH 8-10/11] DynaLoader 1.33 various
To: perlbug-followup [...] perl.org
Download (untitled) / with headers
text/plain 1.2k
On 03/30/2015 01:38 AM, Tony Cook via RT wrote: Show quoted text
> On Sat Mar 14 03:56:00 2015, rurban@cpanel.net wrote:
>> 3 DynaLoader patches: >> DynaLoader 1.33 dl_find_symbol add 3rd optional argument >> >> On Darwin DynaLoader::bootstrap tries dl_find_symbol first with >> libhandle 0, >> to see if the shlib with the symbol is already loaded, e.g. with >> libc. We >> do not want to store the dl_last_error information for this mostly >> failing >> probe, so add an optional ign_err=0 argument. >> Similar for dl_find_symbol_anywhere, which is expected to fail for all >> librefs. >> >> Also support dl_last_error on symbian, as on all other platforms. >> >> DynaLoader/dl_*.xs: Define all PERL_IN_DL_*_XS markers >> On Symbian harmonize with the rest. >> >> extend t/DynaLoader.t to be run from basedir also. This simplifies >> testing >> from core.
> > This patch breaks the build on Win32, presumably because of this: > > --- ext/DynaLoader/dl_win32.xs > +++ ext/DynaLoader/dl_win32.xs > @@ -157,9 +157,10 @@ dl_unload_file(libref) > RETVAL > > void > -dl_find_symbol(libhandle, symbolname) > + dl_find_symbol(libhandle, symbolname, ign_err=0) > void * libhandle > char * symbolname > + int ign_err > > Tony
Good catch. I didn't test win32 and symbian. Fixed in the attached version.

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

RT-Send-CC: perl5-porters [...] perl.org
Download (untitled) / with headers
text/plain 253b
I think this patch is poorly thought out. It is adding args to every platform, when this is strictly a problem on 1 OS (darwin). Why not hard code dl_find_symbol on darwin to NOT save the error if libhandle is 0 in C? -- bulk88 ~ bulk88 at hotmail.com
Date: Sun, 14 Jun 2015 19:28:59 +0200
Subject: Re: [perl #124068] [PATCH 8-10/11] DynaLoader 1.33 various
To: perlbug-followup [...] perl.org
From: Reini Urban <rurban [...] cpanel.net>
Download (untitled) / with headers
text/plain 761b
On 06/10/2015 07:52 AM, bulk88 via RT wrote: Show quoted text
> I think this patch is poorly thought out. It is adding args to every platform, when this is strictly a problem on 1 OS (darwin). Why not hard code dl_find_symbol on darwin to NOT save the error if libhandle is 0 in C?
It's not poorly thought out. Of course since it is only needed for Darwin I tried to fix that for Darwin only initially. But the problem is that this is a documented API call, so I had to add the dummy arg to all the others also. It's only a very tiny performance win, so I don't care that much though. But I thought you care, because it is on your 2-5% perf. range, so I posted it to you. -- Reini Working towards a true Modern Perl. Slim, functional, unbloated, compile-time optimizable
RT-Send-CC: perl5-porters [...] perl.org
Download (untitled) / with headers
text/plain 1.2k
On Sun Jun 14 10:29:32 2015, rurban@cpanel.net wrote: Show quoted text
> On 06/10/2015 07:52 AM, bulk88 via RT wrote:
> > I think this patch is poorly thought out. It is adding args to every > > platform, when this is strictly a problem on 1 OS (darwin). Why not > > hard code dl_find_symbol on darwin to NOT save the error if libhandle > > is 0 in C?
> > It's not poorly thought out. > Of course since it is only needed for Darwin I tried to fix that for > Darwin only initially. > > But the problem is that this is a documented API call, so I had to add > the dummy arg to all the others also. > > It's only a very tiny performance win, so I don't care that much > though. > But I thought you care, because it is on your 2-5% perf. range, so I > posted it to you.
Despite bulk88's argument I'm inclined to apply it. One issue is, you've modified dl_find_symbol() to SaveError() the string that was originally printed to the debug log. Unfortunately that original code is wrong - h->error is only set in dlopen(), and even there it always seems to set it to KErrNone. I tried looking for Symbian API documentation to see if there was a usable error code that could be displayed, but unfortunately I couldn't find any documentation, Symbian seems to be dead and buried. Tony
RT-Send-CC: perl5-porters [...] perl.org
Download (untitled) / with headers
text/plain 358b
If Symbian breaks, that would be good news in the sense that it would not be dead, then. So go ahead in that regard. (Even though I did the Symbian port... ages ago... I no more have any access, nor I know of any who has/cares. Symbian was opensourced at some point, I think, but it seemed not to slow the disappearance. Kind of like PalmOS these days.)
RT-Send-CC: perl5-porters [...] perl.org
Download (untitled) / with headers
text/plain 890b
On Fri Apr 03 02:59:37 2015, rurban@cpanel.net wrote: Show quoted text
> On 03/30/2015 01:38 AM, Tony Cook via RT wrote:
> > This patch breaks the build on Win32, presumably because of this: > > > > --- ext/DynaLoader/dl_win32.xs > > +++ ext/DynaLoader/dl_win32.xs > > @@ -157,9 +157,10 @@ dl_unload_file(libref) > > RETVAL > > > > void > > -dl_find_symbol(libhandle, symbolname) > > + dl_find_symbol(libhandle, symbolname, ign_err=0) > > void * libhandle > > char * symbolname > > + int ign_err
> > Good catch. I didn't test win32 and symbian. > Fixed in the attached version.
The updated patch didn't fix those. With fixes, applied as fd46a708fc894e9651374e1e8e256f365a25dffd, d96ba2c41dd6d887e3cc426e077f7e452418488a, 6d0927b2b23683ca2cd17a814d6f15fc32636ed4. I originally missed the bad symbian XS, which is fixed in fdfd5e4d926a555f6d4f156d79198d8c6db9dc44. Tony
RT-Send-CC: perl5-porters [...] perl.org
Download (untitled) / with headers
text/plain 244b
On Tue Nov 10 14:28:36 2015, tonyc wrote: Show quoted text
> I originally missed the bad symbian XS, which is fixed in > fdfd5e4d926a555f6d4f156d79198d8c6db9dc44.
Also a further fix in 093d5aa02ee8c407b373bd2ff9295cf61d195c3d for an else nesting error. Tony


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