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

Owner: Nobody
Requestors: rjbs <rjbs [at] cpan.org>
Cc:
AdminCc:

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



Subject: [EXPERIMENT] the :win32 pseudolayer
Date: Sat, 24 Aug 2013 22:07:55 -0400
To: perlbug [...] perl.org
From: Ricardo Signes <rjbs [...] cpan.org>
Download (untitled) / with headers
text/plain 541b
perlexperiment lists the :win32 pseudolayer as experimental, since perl version I-don't-know-when. Its status was discussed a few months ago in this thread: http://www.nntp.perl.org/group/perl.perl5.porters/2013/06/msg203089.html It looks like the experiment has not gone well. Maybe it can be completed and maybe it can't. We should determine its state, its potential eventual value, and whether it really can be gotten to work. If not, we should slate it for deletion. Otherwise, we should sort out steps to get it done. -- rjbs
RT-Send-CC: perl5-porters [...] perl.org
Download (untitled) / with headers
text/plain 130b
…at minimum, we should also issue an experimental-category warning when this layer is applied, starting in 5.21.early. -- rjbs
RT-Send-CC: perl5-porters [...] perl.org
Download (untitled) / with headers
text/plain 188b
On Wed Feb 26 16:27:20 2014, rjbs wrote: Show quoted text
> …at minimum, we should also issue an experimental-category warning > when this layer is applied, starting in 5.21.early.
Here's a patch. Tony
Subject: 0001-add-a-warning-for-using-the-win32-PerlIO-layer.patch

Message body is not shown because it is too large.

RT-Send-CC: perl5-porters [...] perl.org
Download (untitled) / with headers
text/plain 342b
On Mon Jun 02 23:58:21 2014, tonyc wrote: Show quoted text
> On Wed Feb 26 16:27:20 2014, rjbs wrote:
> > …at minimum, we should also issue an experimental-category warning > > when this layer is applied, starting in 5.21.early.
> > Here's a patch.
No comments, so everyone thinks it's wonderful, applied as 7ac929242683a823b48fb2fae8e9fa6be059fa5a. Tony
To: Tony Cook via RT <perlbug-followup [...] perl.org>
Date: Mon, 9 Jun 2014 21:26:44 -0400
From: Ricardo Signes <perl.p5p [...] rjbs.manxome.org>
Subject: Re: [perl #119453] [EXPERIMENT] the :win32 pseudolayer
CC: ;, perl5-porters [...] perl.org
Download (untitled) / with headers
text/plain 467b
* Tony Cook via RT <perlbug-followup@perl.org> [2014-06-09T20:43:10] Show quoted text
> On Mon Jun 02 23:58:21 2014, tonyc wrote:
> > On Wed Feb 26 16:27:20 2014, rjbs wrote:
> > > …at minimum, we should also issue an experimental-category warning > > > when this layer is applied, starting in 5.21.early.
> > > > Here's a patch.
> > No comments, so everyone thinks it's wonderful, applied as > 7ac929242683a823b48fb2fae8e9fa6be059fa5a.
Thanks for the wonderful patch! -- rjbs
Download signature.asc
application/pgp-signature 473b

Message body not shown because it is not plain text.

RT-Send-CC: perl5-porters [...] perl.org
Download (untitled) / with headers
text/plain 6.2k
On Mon Jun 09 17:43:10 2014, tonyc wrote: Show quoted text
> On Mon Jun 02 23:58:21 2014, tonyc wrote:
> > On Wed Feb 26 16:27:20 2014, rjbs wrote:
> > > …at minimum, we should also issue an experimental-category warning > > > when this layer is applied, starting in 5.21.early.
> > > > Here's a patch.
> > No comments, so everyone thinks it's wonderful, applied as > 7ac929242683a823b48fb2fae8e9fa6be059fa5a. > > Tony
As part of https://rt.perl.org/Ticket/Display.html?id=122224 . This patch crashes when calling io/socket.t ---------------------------------------------------- Unhandled exception at 0x281b4170 (perl521.dll) in perl.exe: 0xC0000005: Access violation writing location 0xababacbb. ---------------------------------------------------- perl521.dll!Perl_newSVpvn_flags(interpreter * my_perl=0x0090a44c, const char * const s=0x2825153c, const unsigned int len=0, const unsigned long flags=524288) Line 8856 + 0x48 C perl521.dll!S_mess_alloc(interpreter * my_perl=0x0090a44c) Line 1195 + 0x15 C perl521.dll!Perl_vmess(interpreter * my_perl=0x0090a44c, const char * pat=0x282ad7bc, char * * args=0x0012fa08) Line 1466 + 0x9 C perl521.dll!Perl_vwarn(interpreter * my_perl=0x0090a44c, const char * pat=0x282ad7bc, char * * args=0x0012fa08) Line 1814 + 0x11 C perl521.dll!Perl_vwarner(interpreter * my_perl=0x0090a44c, unsigned long err=60, const char * pat=0x282ad7bc, char * * args=0x0012fa08) Line 1922 + 0x11 C perl521.dll!Perl_ck_warner_d(interpreter * my_perl=0x0090a44c, unsigned long err=60, const char * pat=0x282ad7bc, ...) Line 1882 + 0x15 C perl521.dll!PerlIOWin32_pushed(interpreter * my_perl=0x0090a44c, _PerlIO * * f=0x00af39e4, const char * mode=0x0012fa74, sv * arg=0x00000000, _PerlIO_funcs * tab=0x282bd478) Line 67 + 0x10 C perl521.dll!PerlIO_push(interpreter * my_perl=0x0090a44c, _PerlIO * * f=0x00af39e4, _PerlIO_funcs * tab=0x282bd478, const char * mode=0x0012fa74, sv * arg=0x00000000) Line 1182 + 0x29 C perl521.dll!PerlIOBase_dup(interpreter * my_perl=0x0090a44c, _PerlIO * * f=0x00af39e4, _PerlIO * * o=0x008f6b54, clone_params * param=0x0012fbdc, int flags=1) Line 2223 + 0x26 C perl521.dll!PerlIOWin32_dup(interpreter * my_perl=0x0090a44c, _PerlIO * * f=0x00af39e4, _PerlIO * * o=0x008f6b54, clone_params * params=0x0012fbdc, int flags=1) Line 332 + 0x19 C perl521.dll!PerlIOBase_dup(interpreter * my_perl=0x0090a44c, _PerlIO * * f=0x00af39e4, _PerlIO * * o=0x008f6dfc, clone_params * param=0x0012fbdc, int flags=1) Line 2209 + 0x1a C perl521.dll!PerlIOBuf_dup(interpreter * my_perl=0x0090a44c, _PerlIO * * f=0x00af39e4, _PerlIO * * o=0x008f6dfc, clone_params * param=0x0012fbdc, int flags=1) Line 4270 + 0x19 C perl521.dll!PerlIO_fdupopen(interpreter * my_perl=0x0090a44c, _PerlIO * * f=0x008f6dfc, clone_params * param=0x0012fbdc, int flags=1) Line 509 + 0x23 C perl521.dll!Perl_fp_dup(interpreter * my_perl=0x0090a44c, _PerlIO * * const fp=0x008f6dfc, const char type=0, clone_params * const param=0x0012fbdc) Line 11907 + 0x13 C perl521.dll!PerlIO_clone(interpreter * my_perl=0x0090a44c, interpreter * proto=0x00364d2c, clone_params * param=0x0012fbdc) Line 622 + 0x13 C perl521.dll!perl_clone_using(interpreter * proto_perl=0x00364d2c, unsigned long flags=1, IPerlMem * ipM=0x0090cb14, IPerlMem * ipMS=0x0090cb30, IPerlMem * ipMP=0x0090cb4c, IPerlEnv * ipE=0x0090cb68, IPerlStdIO * ipStd=0x0090cba0, IPerlLIO * ipLIO=0x0090cc3c, IPerlDir * ipD=0x0090cca4, IPerlSock * ipS=0x0090ccd0, IPerlProc * ipP=0x0090cd80) Line 13729 + 0x11 C perl521.dll!PerlProcFork(IPerlProc * piPerl=0x003674d8) Line 1832 + 0x65 C++ perl521.dll!Perl_pp_fork(interpreter * my_perl=0x00364d2c) Line 4084 + 0x16 C perl521.dll!Perl_runops_debug(interpreter * my_perl=0x00364d2c) Line 2360 + 0xd C perl521.dll!S_run_body(interpreter * my_perl=0x00364d2c, long oldscope=1) Line 2408 + 0xd C perl521.dll!perl_run(interpreter * my_perl=0x00364d2c) Line 2334 C perl521.dll!RunPerl(int argc=4, char * * argv=0x00364ce0, char * * env=0x00362de0) Line 258 + 0x9 C++ perl.exe!main(int argc=4, char * * argv=0x00364ce0, char * * env=0x00363358) Line 23 + 0x12 C perl.exe!mainCRTStartup() Line 398 + 0xe C kernel32.dll!_BaseProcessStart@4() + 0x23 ------------------------------------------------------- Perl_newSVpvn_flags(pTHX_ const char *const s, const STRLEN len, const U32 flags) { SV *sv; /* All the flags we don't support must be zero. And we're new code so I'm going to assert this from the start. */ /////////////CUT///////////////// SvFLAGS(sv) |= flags; if(flags & SVs_TEMP){ PUSH_EXTEND_MORTAL__SV_C(sv);<<<<<<<<<<<<<<<<<<<<<<<Crash } return sv; } ---------------------------------------------------------------------------- The problem is, PerlIO stuff is cloned at http://perl5.git.perl.org/perl.git/blob/0b4755b186f82898af5e87b399a19617464b7e65:/sv.c#l13729 long before the mortal stack is cloned at http://perl5.git.perl.org/perl.git/blob/0b4755b186f82898af5e87b399a19617464b7e65:/sv.c#l13947 so calling a warning during clone, that early, will crash. I am not sure how to fix this. Should the fix be in PerlIOWin32_pushed? or should Perl_ck_warner_d or S_mess_alloc made safe? One choice is to skip emitting the warning if PL_tmps_stack is poisoned or NULL (depends on DEBUGGING), the other choice is to use some other interp var (IDK what) to indicate its too early to print warnings, other choice is to always use PL_mess_sv in S_mess_alloc at http://perl5.git.perl.org/perl.git/blob/edd0583e505bf8be15700db63562c98bdf8be40c:/util.c#l1194 but PL_mess_sv isn't arenaed, see http://perl5.git.perl.org/perl.git/blob/edd0583e505bf8be15700db63562c98bdf8be40c:/sv.c#l1300 and http://perl5.git.perl.org/perl.git/blob/edd0583e505bf8be15700db63562c98bdf8be40c:/sv.c#l979 , another choice is to call "fprintf(stderr" instead (many cavets, C printf doesn't support every Perl's SV printf does), another choice is to figure out we are cloning and interp and temporarily switch back to the parent perl thread/psuedo process to print the warning then switch back, the question then is, if/where is the parent perl interp * stored if proto interp * or CLONE_PARAMS * isn't available as a param to the function. new_perl->Isys_intern.internal_host isn't assigned to until after the clone is done and perl_clone_using returns. -- bulk88 ~ bulk88 at hotmail.com
Subject: win32 layer warnings fork crash.PNG
win32 layer warnings fork crash.PNG
To: bulk88 via RT <perlbug-followup [...] perl.org>
CC: perl5-porters [...] perl.org
Date: Mon, 7 Jul 2014 15:25:33 +1000
Subject: Re: [perl #119453] [EXPERIMENT] the :win32 pseudolayer
From: Tony Cook <tony [...] develop-help.com>
Download (untitled) / with headers
text/plain 2.4k
On Sun, Jul 06, 2014 at 06:22:43PM -0700, bulk88 via RT wrote: Show quoted text
> On Mon Jun 09 17:43:10 2014, tonyc wrote:
> > On Mon Jun 02 23:58:21 2014, tonyc wrote:
> > > On Wed Feb 26 16:27:20 2014, rjbs wrote:
> > > > …at minimum, we should also issue an experimental-category warning > > > > when this layer is applied, starting in 5.21.early.
> > > > > > Here's a patch.
> > > > No comments, so everyone thinks it's wonderful, applied as > > 7ac929242683a823b48fb2fae8e9fa6be059fa5a. > > > > Tony
> > As part of https://rt.perl.org/Ticket/Display.html?id=122224 . This patch crashes when calling io/socket.t
Part of that branch makes :win32 the default for handles (I think), it's not appropriate to produce an experimental warning for a default, so the perlio-win32 branch should revert 7ac929242683a823b48fb2fae8e9fa6be059fa5a. If it ends up becoming not-the-default, then we revert the revert (or rebase -i it out) and start worrying about the race. Show quoted text
> I am not sure how to fix this. Should the fix be in > PerlIOWin32_pushed? or should Perl_ck_warner_d or S_mess_alloc made > safe? One choice is to skip emitting the warning if PL_tmps_stack is > poisoned or NULL (depends on DEBUGGING), the other choice is to use > some other interp var (IDK what) to indicate its too early to print > warnings, other choice is to always use PL_mess_sv in S_mess_alloc at > http://perl5.git.perl.org/perl.git/blob/edd0583e505bf8be15700db63562c98bdf8be40c:/util.c#l1194 > but PL_mess_sv isn't arenaed, see > http://perl5.git.perl.org/perl.git/blob/edd0583e505bf8be15700db63562c98bdf8be40c:/sv.c#l1300 > and > http://perl5.git.perl.org/perl.git/blob/edd0583e505bf8be15700db63562c98bdf8be40c:/sv.c#l979 > , another choice is to call "fprintf(stderr" instead (many cavets, C > printf doesn't support every Perl's SV printf does), another choice is > to figure out we are cloning and interp and temporarily switch back to > the parent perl thread/psuedo process to print the warning then switch > back, the question then is, if/where is the parent perl interp * > stored if proto interp * or CLONE_PARAMS * isn't available as a param > to the function. new_perl->Isys_intern.internal_host isn't assigned to > until after the clone is done and perl_clone_using returns.
We probably can't use the native fprintf(), perl defines fprintf() etc to call PerlIO_* functions. If we do add a guard based on PL_tmps_stack or some other value, I think we should a macro that anything else can use to guard against this, rather than checking directly. Tony
To: Tony Cook <tony [...] develop-help.com>
CC: bulk88 via RT <perlbug-followup [...] perl.org>, Perl5 Porters <perl5-porters [...] perl.org>
Date: Mon, 7 Jul 2014 18:16:11 +0200
Subject: Re: [perl #119453] [EXPERIMENT] the :win32 pseudolayer
From: Leon Timmermans <fawaka [...] gmail.com>
Download (untitled) / with headers
text/plain 602b
On Mon, Jul 7, 2014 at 7:25 AM, Tony Cook <tony@develop-help.com> wrote:
Show quoted text
Part of that branch makes :win32 the default for handles (I think),
it's not appropriate to produce an experimental warning for a default,
so the perlio-win32 branch should revert
7ac929242683a823b48fb2fae8e9fa6be059fa5a.

Yeah, I was planning to take that out anyway, but hadn't realized it'd be this bad.
 
Show quoted text
If it ends up becoming not-the-default, then we revert the revert (or
rebase -i it out) and start worrying about the race.
 
This sounds like we should make it non-croaking in case of clone anyway.

Leon


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