[Bug 731568] New: sed: free(): invalid pointer: 0x00000000016f0110
https://bugzilla.novell.com/show_bug.cgi?id=731568 https://bugzilla.novell.com/show_bug.cgi?id=731568#c0 Summary: sed: free(): invalid pointer: 0x00000000016f0110 Classification: openSUSE Product: openSUSE 12.1 Version: Final Platform: Other OS/Version: Other Status: NEW Severity: Normal Priority: P5 - None Component: Basesystem AssignedTo: bnc-team-screening@forge.provo.novell.com ReportedBy: jslaby@suse.com QAContact: qa@suse.de Found By: --- Blocker: --- Created an attachment (id=463037) --> (http://bugzilla.novell.com/attachment.cgi?id=463037) gdb bt full I'm building binutils for mips. It runs: sed -f ./targmatch.sed ./config.bfd But I get: *** glibc detected *** /usr/bin/sed: free(): invalid pointer: 0x0000000000667110 *** Well (bt full attached): #4 0x00007ffff7b0569e in re_search_internal (preg=0x623b50, string=0x64f3a0 " targ_defvec=bfd_elf64_alpha_vecha*-*-openbsd*\",a*-*-freebsd4.0*)64=true # FreeBSD <= 4.0 supports only the old nonstandard way of ABI labelling. case \"${targ}\" in\272\272\272\272\272\272\272\272\272\272\272\272\272\272\272\272\272\272\272\272\272\272\272\272\272\272\272\272"..., length=35, start=<optimized out>, range=35, stop=<optimized out>, nmatch=<optimized out>, pmatch=0x65a0e0, eflags=0) at regexec.c:947 #5 0x00007ffff7b0b65d in re_search_stub (bufp=0x623b50, string=0x64f3a0 " targ_defvec=bfd_elf64_alpha_vecha*-*-openbsd*\",a*-*-freebsd4.0*)64=true # FreeBSD <= 4.0 supports only the old nonstandard way of ABI labelling. case \"${targ}\" in\272\272\272\272\272\272\272\272\272\272\272\272\272\272\272\272\272\272\272\272\272\272\272\272\272\272\272\272"..., length=<optimized out>, start=0, range=<optimized out>, stop=<optimized out>, regs=0x610880, ret_len=0) at regexec.c:463 #6 0x00007ffff7b0bfc8 in __re_search (bufp=<optimized out>, string=<optimized out>, length=<optimized out>, start=<optimized out>, range=<optimized out>, regs=<optimized out>) at regexec.c:326 #7 0x000000000040868f in match_regex (regex=0x623b50, buf=0x64f3a0 " targ_defvec=bfd_elf64_alpha_vecha*-*-openbsd*\",a*-*-freebsd4.0*)64=true # FreeBSD <= 4.0 supports only the old nonstandard way of ABI labelling. case \"${targ}\" in\272\272\272\272\272\272\272\272\272\272\272\272\272\272\272\272\272\272\272\272\272\272\272\272\272\272\272\272"..., buflen=35, buf_start_offset=<optimized out>, regarray=<optimized out>, regsize=<optimized out>) at regexp.c:252 #8 0x0000000000406611 in do_subst (sub=0x61b830) at execute.c:1187 #9 execute_program (vec=0x61b640, input=0x7fffffffd930) at execute.c:1624 #10 0x000000000040830d in process_files (the_program=0x61b640, argv=0x7fffffffdb50) at execute.c:1855 #11 0x00000000004026ed in main (argc=<optimized out>, argv=0x7fffffffdb38) at sed.c:349 -- Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug.
https://bugzilla.novell.com/show_bug.cgi?id=731568 https://bugzilla.novell.com/show_bug.cgi?id=731568#c1 --- Comment #1 from Jiri Slaby <jslaby@suse.com> 2011-11-19 19:33:55 UTC --- Created an attachment (id=463038) --> (http://bugzilla.novell.com/attachment.cgi?id=463038) sed script used -- Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug.
https://bugzilla.novell.com/show_bug.cgi?id=731568 https://bugzilla.novell.com/show_bug.cgi?id=731568#c2 --- Comment #2 from Jiri Slaby <jslaby@suse.com> 2011-11-19 19:34:17 UTC --- Created an attachment (id=463039) --> (http://bugzilla.novell.com/attachment.cgi?id=463039) sed input used -- Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug.
https://bugzilla.novell.com/show_bug.cgi?id=731568 https://bugzilla.novell.com/show_bug.cgi?id=731568#c3 --- Comment #3 from Jiri Slaby <jslaby@suse.com> 2011-11-19 20:08:36 UTC --- Created an attachment (id=463041) --> (http://bugzilla.novell.com/attachment.cgi?id=463041) valgrind run Ouch. It looks like there is some pointer which is not re-set after realloc? Invalid read of size 8 at 0x4EB707D: _wordcopy_fwd_dest_aligned (wordcopy.c:205) by 0x4EB0CDB: __GI_memmove (memmove.c:76) by 0x4EE25FF: re_string_reconstruct (regex_internal.c:675) by 0x4EE805F: re_search_internal (regexec.c:829) by 0x4EEE65C: re_search_stub (regexec.c:463) by 0x4EEEFC7: re_search (regexec.c:326) by 0x40868E: match_regex (regexp.c:252) by 0x406610: execute_program (execute.c:1187) by 0x40830C: process_files (execute.c:1855) by 0x4026EC: main (sed.c:349) Address 0x5219538 is 168 bytes inside a block of size 172 alloc'd at 0x4C29BC2: realloc (in /usr/lib64/valgrind/vgpreload_memcheck-amd64-linux.so) by 0x4EE15AF: re_string_realloc_buffers (regex_internal.c:143) by 0x4EE2BE6: extend_buffers (regexec.c:4116) by 0x4EE8EA6: re_search_internal (regexec.c:1164) by 0x4EEE65C: re_search_stub (regexec.c:463) by 0x4EEEFC7: re_search (regexec.c:326) by 0x40868E: match_regex (regexp.c:252) by 0x406610: execute_program (execute.c:1187) by 0x40830C: process_files (execute.c:1855) by 0x4026EC: main (sed.c:349) -- Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug.
https://bugzilla.novell.com/show_bug.cgi?id=731568 https://bugzilla.novell.com/show_bug.cgi?id=731568#c4 --- Comment #4 from Jiri Slaby <jslaby@suse.com> 2011-11-19 22:41:53 UTC --- Reproducible only in factory. 12.1 with sed+glibc from factory works too. Factory with sed+glibc from 12.1 doesn't work. I don't follow... -- Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug.
https://bugzilla.novell.com/show_bug.cgi?id=731568 https://bugzilla.novell.com/show_bug.cgi?id=731568#c5 --- Comment #5 from Jiri Slaby <jslaby@suse.com> 2011-11-19 23:01:07 UTC --- Got it. This makes the difference: export LC_CTYPE=cs_CZ.UTF-8 If CTYPE is unset (and locale is POSIX otherwise), everything works OK. -- Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug.
https://bugzilla.novell.com/show_bug.cgi?id=731568 https://bugzilla.novell.com/show_bug.cgi?id=731568#c6 --- Comment #6 from Andreas Jaeger <aj@suse.com> 2011-11-21 09:46:25 UTC --- Looking at execute.c: 232 I see lb->text = REALLOC(lb->text, inactive + lb->alloc, char); So, a realloc using char and I wonder whether this is correct since LC_CTYPE is UTF-8. Looks like a bug in sed in pointer handling. -- Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug.
https://bugzilla.novell.com/show_bug.cgi?id=731568 https://bugzilla.novell.com/show_bug.cgi?id=731568#c Andreas Jaeger <aj@suse.com> changed: What |Removed |Added ---------------------------------------------------------------------------- AssignedTo|bnc-team-screening@forge.pr |sbrabec@suse.com |ovo.novell.com | -- Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug.
https://bugzilla.novell.com/show_bug.cgi?id=731568 https://bugzilla.novell.com/show_bug.cgi?id=731568#c7 Stanislav Brabec <sbrabec@suse.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Priority|P5 - None |P3 - Medium Status|NEW |ASSIGNED --- Comment #7 from Stanislav Brabec <sbrabec@suse.com> 2011-12-20 19:07:00 CET --- I cannot reproduce the crash, even on factory with LC_CTYPE=cs_CZ.UTF-8. But I get invalid reads and writes in valgrind as well. Comment 6: No. lb->text is defined as char* and REALLOC uses char. It seems to be OK. But there may be another locale-specific issue. -- Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug.
participants (1)
-
bugzilla_noreply@novell.com