Hello list, We recently updated a 3.7 machine running awstat(perl) to parse all our websites logs with the biggest being around 1GB. When parsing the big log it randomly segfaults on 4.1, 3.9 and 3.8, we tried new clean release installs and it still segfaults. On 3.7 it works flawlessly, on 3.8 which has the same perl version as 3.7 (5.8.6) it still segfaults. The problem is completely random but it tends to happen after its been running for a while as it doesnt happen on small logs (or the probability for it to happen on those files is too low )
As the trace below (from the perl.core) shows, it's an out of bounds problem, then we remember about a change on 3.8: "malloc(3) has been rewritten to use the mmap(2) system call, introducing unpredictable allocation addresses and guard pages, which helps in detecting heap based buffer overflows and prevents various types of attacks." Could this be what's causing perl to segfault on post 3.7? We ruled out a problem with awstat or the log as it doesnt happen on 3.7 at all with the same log/awstat/perl. (gdb) bt #0 0x0b5626e8 in memmove () from /usr/lib/libc.so.40.3 #1 0x02385ed7 in Perl_sv_setpvn (sv=0x1, ptr=0x7ccb400a <Address 0x7ccb400a out of bounds>, len=1) at /usr/src/gnu/usr.bin/perl/sv.c:4181 #2 0x0238ef16 in Perl_magic_get (sv=0x7e6b2660, mg=0x22377b1e) at /usr/src/gnu/usr.bin/perl/mg.c:788 #3 0x0238e56d in Perl_mg_get (sv=0x7e6b2660) at /usr/src/gnu/usr.bin/perl/mg.c:169 #4 0x0238490d in Perl_sv_2bool (sv=0x7e6b2660) at /usr/src/gnu/usr.bin/perl/sv.c:3411 #5 0x0239bed4 in Perl_pp_or () at /usr/src/gnu/usr.bin/perl/pp_hot.c:339 #6 0x023cc4d9 in Perl_runops_standard () at /usr/src/gnu/usr.bin/perl/run.c:37 #7 0x023b24ff in S_run_body (oldscope=1) at /usr/src/gnu/usr.bin/perl/perl.c:2368 #8 0x023b2453 in perl_run (my_perl=0x8968a000) at /usr/src/gnu/usr.bin/perl/perl.c:2285 #9 0x1c0012a6 in main () Thanks, Alejandro.