develooper Front page | perl.perl5.porters | Postings from February 2015

[perl #123846] SEGV in \stat stat

Thread Previous
From:
Hugo van der Sanden
Date:
February 16, 2015 11:11
Subject:
[perl #123846] SEGV in \stat stat
Message ID:
rt-4.0.18-9413-1424085088-1802.123846-75-0@perl.org
# New Ticket Created by  Hugo van der Sanden 
# Please include the string:  [perl #123846]
# in the subject line of all future correspondence about this issue. 
# <URL: https://rt.perl.org/Ticket/Display.html?id=123846 >


AFL (<http://lcamtuf.coredump.cx/afl/) finds this:

% ./miniperl -e '\stat stat @x'
Segmentation fault (core dumped)
% ./miniperl -e '\stat \stat @x'
Segmentation fault (core dumped)
% 

The SEGV occurs due to stack underflow at the POPs in the rather dense first couple of lines of pp_stat:
    if (PL_op->op_flags & OPf_REF ? (gv = cGVOP_gv, 1)
                                  : !!(sv=POPs, gv = MAYBE_DEREF_GV(sv))) {

Hugo


Thread Previous


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