develooper Front page | perl.perl5.porters | Postings from March 2017

[perl #130949] calling C function perl_clone of libperl causessegfault in perl 5.22 and and 5.24 but fine on perl 5.20

Thread Previous | Thread Next
From:
Mitch Capper via RT
Date:
March 22, 2017 23:20
Subject:
[perl #130949] calling C function perl_clone of libperl causessegfault in perl 5.22 and and 5.24 but fine on perl 5.20
Message ID:
rt-4.0.24-7011-1490205042-611.130949-15-0@perl.org
Ok tracked down the problem if an empty string is past after -e it segfaults:

#include <EXTERN.h>
#include <perl.h>
static char *embedding[] = { "", "-e", "" };

int main(int argc, char **argv){
        PerlInterpreter *my_perl;
        PerlInterpreter *perl2;
        if (!(my_perl = perl_alloc())) {
                Perl_croak_nocontext("Could not allocate perl interpreter\n");
        }
        perl_construct(my_perl);


        PL_exit_flags |= PERL_EXIT_DESTRUCT_END;
        perl_parse(my_perl, NULL, 3, embedding, (char **)NULL);


        perl2 = perl_clone(my_perl, CLONEf_COPY_STACKS | CLONEf_KEEP_PTR_TABLE);
        Perl_croak_nocontext("ALL FINE\n");
}



This makes some sense given -e's meaning we should be able to easily work around for FS but not sure if the change of behavior is expected or not.


---
via perlbug:  queue: perl5 status: open
https://rt.perl.org/Ticket/Display.html?id=130949

Thread Previous | Thread Next


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