valgrind reports a problem with this in all UTF-8 locales: echo 'abcdefghijklmno' | valgrind sed -e 's/\(.*z[^z]*z.*\)//p' ==21112== Invalid read of size 8 ==21112== at 0x338F28F49D: _wordcopy_fwd_dest_aligned (wordcopy.c:205) ==21112== by 0x338F2890DB: __GI_memmove (memmove.c:76) ==21112== by 0x338F2C6001: re_string_reconstruct (regex_internal.c:675) ==21112== by 0x338F2CFC6F: re_search_internal (regexec.c:829) ==21112== by 0x338F2D50EB: re_search_stub (regexec.c:463) ==21112== by 0x338F2D5B67: re_search (regexec.c:326) ==21112== by 0x4078C1: match_regex (regexp.c:252) ==21112== by 0x406D9B: execute_program (execute.c:1189) ==21112== by 0x40758F: process_files (execute.c:1857) ==21112== by 0x4023AB: main (sed.c:366) ==22516== Address 0x4c45b88 is 56 bytes inside a block of size 60 alloc'd ==21112== at 0x4A075B2: realloc (vg_replace_malloc.c:525) ==21112== by 0x338F2C4DCF: re_string_realloc_buffers (regex_internal.c:143) ==21112== by 0x338F2C9C86: extend_buffers (regexec.c:4116) ==21112== by 0x338F2D0AFE: re_search_internal (regexec.c:1164) ==21112== by 0x338F2D50EB: re_search_stub (regexec.c:463) ==21112== by 0x338F2D5B67: re_search (regexec.c:326) ==21112== by 0x4078C1: match_regex (regexp.c:252) ==21112== by 0x406D9B: execute_program (execute.c:1189) ==21112== by 0x40758F: process_files (execute.c:1857) ==21112== by 0x4023AB: main (sed.c:366) ==21112==
Valgrind just should be smarter on partial reads after the end of allocation, there are plenty of bugreports about that. Essentially if a read is partially before and partially after end of allocation and is aligned, it would be nice if valgrind poisened the undefined bits in the value and only warned if those bits aren't just ignored later on. It might take a long time to get such a support though, for now just take Address ... is N bytes inside a block of size M alloc'd for N < M with a grain of salt.
This message is a notice that Fedora 15 is now at end of life. Fedora has stopped maintaining and issuing updates for Fedora 15. It is Fedora's policy to close all bug reports from releases that are no longer maintained. At this time, all open bugs with a Fedora 'version' of '15' have been closed as WONTFIX. (Please note: Our normal process is to give advanced warning of this occurring, but we forgot to do that. A thousand apologies.) Package Maintainer: If you wish for this bug to remain open because you plan to fix it in a currently maintained version, feel free to reopen this bug and simply change the 'version' to a later Fedora version. Bug Reporter: Thank you for reporting this issue and we are sorry that we were unable to fix it before Fedora 15 reached end of life. If you would still like to see this bug fixed and are able to reproduce it against a later version of Fedora, you are encouraged to click on "Clone This Bug" (top right of this page) and open it against that version of Fedora. Although we aim to fix as many bugs as possible during every release's lifetime, sometimes those efforts are overtaken by events. Often a more recent Fedora release includes newer upstream software that fixes bugs or makes them obsolete. The process we are following is described here: http://fedoraproject.org/wiki/BugZappers/HouseKeeping
still an issue with valgrind-3.8.0-TEST1
Although Jakub's analysis in comment #1 is correct this particular instance has been fixed in valgrind 3.8.1 by intercepting __GI_memmove. See https://bugs.kde.org/show_bug.cgi?id=306612