develooper Front page | perl.perl5.porters | Postings from October 2018

[perl #133612] ext/File-Glob/t/basic.t: Use of PERL_EXTERNAL_GLOBcauses test failure on Linux

Thread Previous | Thread Next
From:
James E Keenan
Date:
October 23, 2018 12:42
Subject:
[perl #133612] ext/File-Glob/t/basic.t: Use of PERL_EXTERNAL_GLOBcauses test failure on Linux
Message ID:
rt-4.0.24-11291-1540298543-1062.133612-75-0@perl.org
# New Ticket Created by  James E Keenan 
# Please include the string:  [perl #133612]
# in the subject line of all future correspondence about this issue. 
# <URL: https://rt.perl.org/Ticket/Display.html?id=133612 >


Last week, on Oct 17, in the two commits below we fatalized 
File::Glob::glob() as per our schedule of deprecations and fatalizations.

#####
df8b709bfcaea9932dd434f18393bfcb4e3d5568
a15e41c213bf763e1770580fc3e0aa476070261f
#####

Karl Williamson has encountered one gotcha, which I have confirmed.  If, 
on Linux, you include this obscure (to me, at least) 'ccflag' 
configuration option:

#####
-Accflags='-DPERL_EXTERNAL_GLOB'
#####

... then when you run ext/File-Glob/t/basic.t, you get 1 test failure 
and 3 shell-level warnings.  See attachments.

I have produced this error on Linux with both gcc and g++ -- but I do 
*not* get the error on FreeBSD (where clang is the default compiler).

There is no adequate documentation of PERL_EXTERNAL_GLOB in INSTALL, 
pod/perlintern.pod or similar locations.  Its name suggests that it 
means something like "Use a glob outside Perl", but that doesn't help us 
very much.  Looking at the source code, I think the following sections 
of code need investigation:

#####
$ grep -nC3 PERL_EXTERNAL_GLOB pp_sys.c op.c doio.c
pp_sys.c-367-
pp_sys.c-368-    /* Note that we only ever get here if File::Glob fails 
to load
pp_sys.c-369-     * without at the same time croaking, for some reason, 
or if
pp_sys.c:370:     * perl was built with PERL_EXTERNAL_GLOB */
pp_sys.c-371-
pp_sys.c-372-    ENTER_with_name("glob");
pp_sys.c-373-
--
op.c-11880-	return o;
op.c-11881-    }
op.c-11882-    else o->op_flags &= ~OPf_SPECIAL;
op.c:11883:#if !defined(PERL_EXTERNAL_GLOB)
op.c-11884-    if (!PL_globhook) {
op.c-11885-	ENTER;
op.c-11886-	Perl_load_module(aTHX_ PERL_LOADMOD_NOIMPORT,
op.c-11887-			       newSVpvs("File::Glob"), NULL, NULL, NULL);
op.c-11888-	LEAVE;
op.c-11889-    }
op.c:11890:#endif /* !PERL_EXTERNAL_GLOB */
op.c-11891-    gv = (GV *)newSV(0);
op.c-11892-    gv_init(gv, 0, "", 0, 0);
op.c-11893-    gv_IOadd(gv);
--
doio.c-3208-Function called by C<do_readline> to spawn a glob (or do the 
glob inside
doio.c-3209-perl on VMS).  This code used to be inline, but now perl 
uses C<File::Glob>
doio.c-3210-this glob starter is only used by miniperl during the build 
process,
doio.c:3211:or when PERL_EXTERNAL_GLOB is defined.
doio.c-3212-Moving it away shrinks F<pp_hot.c>; shrinking F<pp_hot.c> 
helps speed perl up.
doio.c-3213-
doio.c-3214-=cut
#####

Thank you very much.
Jim Keenan

Thread Previous | Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About