Front page | perl.perl5.porters |
Postings from July 2014
[perl #119453] [EXPERIMENT] the :win32 pseudolayer
Thread Next
From:
bulk88 via RT
Date:
July 7, 2014 01:22
Subject:
[perl #119453] [EXPERIMENT] the :win32 pseudolayer
Message ID:
rt-4.0.18-24608-1404696163-1940.119453-15-0@perl.org
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
----------------------------------------------------
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 sw
itch 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
---
via perlbug: queue: perl5 status: resolved
https://rt.perl.org/Ticket/Display.html?id=119453
Thread Next
-
[perl #119453] [EXPERIMENT] the :win32 pseudolayer
by bulk88 via RT