In perl.git, the branch blead has been updated <https://perl5.git.perl.org/perl.git/commitdiff/f63f40368cca0cfffd2773a6206d1ab3235b61b3?hp=83aebc99b27428f0566bab5ded4d1df2167a9d4a>
- Log ----------------------------------------------------------------- commit f63f40368cca0cfffd2773a6206d1ab3235b61b3 Author: Zefram <[email protected]> Date: Mon Nov 13 01:07:00 2017 +0000 fix sysconf panic If sysconf() failed to provide the page size, there was an attempt to panic with an error message. But rather than generate an error message from errno, the code would attempt to read it from ERRSV. Not only had nothing put the error message into ERRSV, but the glob behind ERRSV didn't even exist yet, so attempting to evaluate ERRSV would segv. Change this to use Strerror() and never touch ERRSV. [perl #115880] ----------------------------------------------------------------------- Summary of changes: perl.c | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/perl.c b/perl.c index d50bac7cc4..7c1994bbe3 100644 --- a/perl.c +++ b/perl.c @@ -420,13 +420,8 @@ perl_construct(pTHXx) PL_mmap_page_size = sysconf(_SC_MMAP_PAGE_SIZE); # endif if ((long) PL_mmap_page_size < 0) { - if (errno) { - SV * const error = ERRSV; - SvUPGRADE(error, SVt_PV); - Perl_croak(aTHX_ "panic: sysconf: %s", SvPV_nolen_const(error)); - } - else - Perl_croak(aTHX_ "panic: sysconf: pagesize unknown"); + Perl_croak(aTHX_ "panic: sysconf: %s", + errno ? Strerror(errno) : "pagesize unknown"); } } #elif defined(HAS_GETPAGESIZE) -- Perl5 Master Repository
