New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
tie *ARGV{SCALAR} + <> + undef *ARGV = crash, Perl_nextargv #13408
Comments
From @bulk88Created by @bulk88I was trying to write a patch for my own ticket #115860 "multiple ------------------------------------------ PERL_ARGS_ASSERT_NEXTARGV; if (!PL_argvoutgv) So I tried to write a sample script to see if I can ref count crash it. ---------------------------------------------------- #sub FETCH { die 'I need atleast 1 param in @ARGV to crash' if @ARGV == 0; var gv is since this is SvPVx call, which is uses ISv crash happens in "PL_oldname = SvPVx(GvSV(gv), oldlen);" C call stack
So, is there any point in fixing this or is this a wont fix since tying I dont have any ideas how to fix this, and if it is appropriate to fix Perl Info
|
From @cpansproutOn Sat Nov 09 18:38:59 2013, bulk88 wrote:
That would change the behaviour after $#ARGV++, I think.
Yes, that code is awful.
I would say, yes, fix it, but it is not high priority. These types of crashes tend to show up in corner cases involving 30 modules. It is just a matter of time. :-)
I would suggest doing GvSVn once and saving the value to an auto. Also SvREFCNT_inc and sv_2mortal. If someone undefines *ARGV then it is his own fault if he cannot get to $ARGV.
PL_argvgv is refcounted as of v5.19.5-75-g722fa0e to solve this sort of thing.
And SHIFT undefines *ARGV? Ouch.
I don’t *think* that would crash.
Ouch.
Blessings would not hurt, but what if $ARGV were tied and its set-magic undefined *ARGV? Then the SvPVx on the next line would crash.
SvPV would trigger overloading, just as it triggers get-magic. -- Father Chrysostomos |
The RT System itself - Status changed from 'new' to 'open' |
Migrated from rt.perl.org#120502 (status was 'open')
Searchable as RT120502$
The text was updated successfully, but these errors were encountered: