develooper Front page | perl.perl5.porters | Postings from June 2016

[perl #127759] die inside sort comparitor causes SV error

From:
Dan Collins via RT
Date:
June 7, 2016 02:22
Subject:
[perl #127759] die inside sort comparitor causes SV error
Message ID:
rt-4.0.18-1412-1465266112-346.127759-14-0@perl.org
Confirmed in blead. 

** VALGRIND **

Die in sort comparator at 127759.pl line 11.
==25188== Invalid read of size 4
==25188==    at 0x5A0B2E: S_SvREFCNT_dec (inline.h:162)
==25188==    by 0x5A3078: Perl_av_clear (av.c:492)
==25188==    by 0x656495: Perl_leave_scope (scope.c:1108)
==25188==    by 0x6641BA: Perl_dounwind (pp_ctl.c:1527)
==25188==    by 0x46EA22: S_my_exit_jump (perl.c:5186)
==25188==    by 0x46E892: Perl_my_failure_exit (perl.c:5173)
==25188==    by 0x66534E: Perl_die_unwind (pp_ctl.c:1722)
==25188==    by 0x560B43: Perl_croak_sv (util.c:1758)
==25188==    by 0x560A2C: Perl_die_sv (util.c:1668)
==25188==    by 0x684534: Perl_pp_die (pp_sys.c:523)
==25188==    by 0x55A6BC: Perl_runops_debug (dump.c:2239)
==25188==    by 0x73D402: S_sortcv (pp_sort.c:1783)
==25188==  Address 0x6030a40 is 0 bytes after a block of size 32 alloc'd
==25188==    at 0x4C28C0F: malloc (vg_replace_malloc.c:299)
==25188==    by 0x55BDE7: Perl_safesysmalloc (util.c:153)
==25188==    by 0x5A12AE: Perl_av_extend_guts (av.c:186)
==25188==    by 0x5A0EBB: Perl_av_extend (av.c:80)
==25188==    by 0x5AEA7E: Perl_pp_aassign (pp_hot.c:1375)
==25188==    by 0x55A6BC: Perl_runops_debug (dump.c:2239)
==25188==    by 0x46282A: S_run_body (perl.c:2517)
==25188==    by 0x461E55: perl_run (perl.c:2440)
==25188==    by 0x41EEDD: main (perlmain.c:116)
==25188==
==25188== Invalid read of size 4
==25188==    at 0x5F8349: Perl_sv_free2 (sv.c:6964)
==25188==    by 0x5A0B62: S_SvREFCNT_dec (inline.h:166)
==25188==    by 0x5A3078: Perl_av_clear (av.c:492)
==25188==    by 0x656495: Perl_leave_scope (scope.c:1108)
==25188==    by 0x6641BA: Perl_dounwind (pp_ctl.c:1527)
==25188==    by 0x46EA22: S_my_exit_jump (perl.c:5186)
==25188==    by 0x46E892: Perl_my_failure_exit (perl.c:5173)
==25188==    by 0x66534E: Perl_die_unwind (pp_ctl.c:1722)
==25188==    by 0x560B43: Perl_croak_sv (util.c:1758)
==25188==    by 0x560A2C: Perl_die_sv (util.c:1668)
==25188==    by 0x684534: Perl_pp_die (pp_sys.c:523)
==25188==    by 0x55A6BC: Perl_runops_debug (dump.c:2239)
==25188==  Address 0x6030a44 is 4 bytes after a block of size 32 alloc'd
==25188==    at 0x4C28C0F: malloc (vg_replace_malloc.c:299)
==25188==    by 0x55BDE7: Perl_safesysmalloc (util.c:153)
==25188==    by 0x5A12AE: Perl_av_extend_guts (av.c:186)
==25188==    by 0x5A0EBB: Perl_av_extend (av.c:80)
==25188==    by 0x5AEA7E: Perl_pp_aassign (pp_hot.c:1375)
==25188==    by 0x55A6BC: Perl_runops_debug (dump.c:2239)
==25188==    by 0x46282A: S_run_body (perl.c:2517)
==25188==    by 0x461E55: perl_run (perl.c:2440)
==25188==    by 0x41EEDD: main (perlmain.c:116)
==25188==
==25188== Invalid read of size 4
==25188==    at 0x5F8364: Perl_sv_free2 (sv.c:6970)
==25188==    by 0x5A0B62: S_SvREFCNT_dec (inline.h:166)
==25188==    by 0x5A3078: Perl_av_clear (av.c:492)
==25188==    by 0x656495: Perl_leave_scope (scope.c:1108)
==25188==    by 0x6641BA: Perl_dounwind (pp_ctl.c:1527)
==25188==    by 0x46EA22: S_my_exit_jump (perl.c:5186)
==25188==    by 0x46E892: Perl_my_failure_exit (perl.c:5173)
==25188==    by 0x66534E: Perl_die_unwind (pp_ctl.c:1722)
==25188==    by 0x560B43: Perl_croak_sv (util.c:1758)
==25188==    by 0x560A2C: Perl_die_sv (util.c:1668)
==25188==    by 0x684534: Perl_pp_die (pp_sys.c:523)
==25188==    by 0x55A6BC: Perl_runops_debug (dump.c:2239)
==25188==  Address 0x6030a44 is 4 bytes after a block of size 32 alloc'd
==25188==    at 0x4C28C0F: malloc (vg_replace_malloc.c:299)
==25188==    by 0x55BDE7: Perl_safesysmalloc (util.c:153)
==25188==    by 0x5A12AE: Perl_av_extend_guts (av.c:186)
==25188==    by 0x5A0EBB: Perl_av_extend (av.c:80)
==25188==    by 0x5AEA7E: Perl_pp_aassign (pp_hot.c:1375)
==25188==    by 0x55A6BC: Perl_runops_debug (dump.c:2239)
==25188==    by 0x46282A: S_run_body (perl.c:2517)
==25188==    by 0x461E55: perl_run (perl.c:2440)
==25188==    by 0x41EEDD: main (perlmain.c:116)
==25188==
Attempt to free unreferenced scalar: SV 0x6030a38 at 127759.pl line 8.
Attempt to free unreferenced scalar: SV 0x6030a30 at 127759.pl line 8.
==25188==
==25188== HEAP SUMMARY:
==25188==     in use at exit: 326,160 bytes in 1,190 blocks
==25188==   total heap usage: 4,007 allocs, 2,817 frees, 675,586 bytes allocated
==25188==
==25188== LEAK SUMMARY:
==25188==    definitely lost: 0 bytes in 0 blocks
==25188==    indirectly lost: 0 bytes in 0 blocks
==25188==      possibly lost: 121,696 bytes in 119 blocks
==25188==    still reachable: 204,464 bytes in 1,071 blocks
==25188==                       of which reachable via heuristic:
==25188==                         newarray           : 1,024 bytes in 32 blocks
==25188==         suppressed: 0 bytes in 0 blocks
==25188== Rerun with --leak-check=full to see details of leaked memory
==25188==
==25188== For counts of detected and suppressed errors, rerun with: -v
==25188== ERROR SUMMARY: 3 errors from 3 contexts (suppressed: 0 from 0)




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