In perl.git, the branch smoke-me/nicholas/perlmain-ASAN has been updated <http://perl5.git.perl.org/perl.git/commitdiff/de3f1c34836b596f4ec49c98fb8d666648dc7914?hp=599d0abfbbab0c041727e15da375035acc6a4331>
- Log ----------------------------------------------------------------- commit de3f1c34836b596f4ec49c98fb8d666648dc7914 Author: Nicholas Clark <[email protected]> Date: Mon Mar 25 13:06:09 2013 +0100 xs_init() must pass a static char* when creating &DynaLoader::boot_DynaLoader. newXS() assumes that the passed pointer to the filename is in static storage, or otherwise will outlive the PVCV that it is about to create, and hence that it's safe to copy the pointer, not the value, to CvFILE. Hence xs_init() must not use an auto array to "store" the filename, as that will be on the stack, and becomes invalid as soon as xs_init() returns. The analogous bug fix was made in universal.c by commit 157e3fc8c802010d in Feb 2006. Spotted by compiling for ithreads with gcc 4.8.0's ASAN and running dist/B-Deparse/t/deparse.t ----------------------------------------------------------------------- Summary of changes: minimod.pl | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/minimod.pl b/minimod.pl index a5bd172..a59b7f2 100644 --- a/minimod.pl +++ b/minimod.pl @@ -71,7 +71,7 @@ sub writemain{ my ($tail1,$tail2,$tail3) = ( $tail =~ /\A(.*{\s*\n)(.*\n)(\s*\}.*)\Z/s ); print $tail1; - print "\tconst char file[] = __FILE__;\n"; + print "\tstatic const char file[] = __FILE__;\n"; print "\tdXSUB_SYS;\n" if $] > 5.002; print $tail2; -- Perl5 Master Repository
