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
Assert fail in Perl_sv_2pv_flags: 'sub MODIFY_HASH_ATTRIBUTES{}my(%o):s==0' #15371
Comments
From @dcollinsnGreetings Porters, I have compiled bleadperl with the afl-gcc compiler using: ./Configure -Dusedevel -Dprefix='/usr/local/perl-afl' -Dcc='ccache afl-gcc' -Uuselongdouble -Duse64bitall -Doptimize=-g -Uversiononly -Uman1dir -Uman3dir -Dusequadmath -des And then fuzzed the resulting binary using: AFL_NO_VAR_CHECK=1 afl-fuzz -i in -o out bin/perl @@ After reducing testcases using `afl-tmin` and performing additional minimization by hand, I have located the following testcase that triggers an assert fail in debug buids of the perl interpreter. The testcase is the file below. On normal builds, this runs normally (albeit with an expected warning). On debug builds, this returns an assert fail. dcollins@nightshade64:~/perldebug$ ./perl -Ilib -e 'sub MODIFY_HASH_ATTRIBUTES{}my(%o):s==0' This seems to be the "hash equivalent" of [perl #128183]? Debugging tool output is below. A git bisect was performed and reported the following, which is the commit where the assert was initially added. 217f6fa is the first bad commit sv.c: Assert that sv_[ivp]v are not passed aggregates The lack of assertions can hide bugs. See 32a6097 for instance :100644 100644 3ac0a2bce83bc12406be1fa22acefa8f8a2014c7 daa87f00081d96c8d15f94f02c32cd85e8af0266 M sv.c **GDB** dcollins@nightshade64:~/perldebug$ gdb --args ./perl -Ilib -e 'sub MODIFY_HASH_ATTRIBUTES{}my(%o):s==0' Program received signal SIGABRT, Aborted. **VALGRIND** No reported memory management errors. **PERL -V** dcollins@nightshade64:~/perldebug$ ./perl -Ilib -V Characteristics of this binary (from libperl): |
From @cpansproutOn Thu May 26 18:57:12 2016, dcollinsn@gmail.com wrote:
No, #128183 has a backslash before the my() and an assignment operator after it. It has to do with refaliasing not playing nicely with attributes. This bug is different: $ ./perl -Ilib -MO=Concise -e 'my(%o):s==0' When we have an attribute, the padhv op is in void context (the v in vPM/LVINTRO), whereas it should be in scalar context. -- Father Chrysostomos |
The RT System itself - Status changed from 'new' to 'open' |
From zefram@fysh.orgThe test case doesn't assert for me on blead, but I still see the padhv $ perl -lwe 'sub MODIFY_HASH_ATTRIBUTES{} print scalar(my%o) // "undef"' There's also inconsistent behaviour in scalar lvalue context: $ perl -lwe 'sub MODIFY_HASH_ATTRIBUTES{} (my%o) .= 1' In fact anything that needs to understand that the hash declaration is $ perl -lwe 'sub f (\%) { print "ok" } f(my %o)' The problem is the dubious way in which an optree is constructed to apply I think the optrees for declarations with attributes should have a -zefram |
Migrated from rt.perl.org#128261 (status was 'open')
Searchable as RT128261$
The text was updated successfully, but these errors were encountered: