public inbox for glibc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug libc/12078] New: regcomp with invalid expression leaks memory
@ 2010-10-01 12:46 ppluzhnikov at google dot com
  2010-10-01 12:52 ` [Bug libc/12078] " ppluzhnikov at google dot com
  2010-10-01 14:58 ` ppluzhnikov at google dot com
  0 siblings, 2 replies; 10+ messages in thread
From: ppluzhnikov at google dot com @ 2010-10-01 12:46 UTC (permalink / raw)
  To: glibc-bugs

Running attached test case under Valgrind shows that failing regcomp leaks
memory (also verified with alternative leak detector):

==21485== Memcheck, a memory error detector
==21485== Copyright (C) 2002-2009, and GNU GPL'd, by Julian Seward et al.
==21485== Using Valgrind-3.6.0.SVN and LibVEX; rerun with -h for copyright info
==21485== Command: ./a.out
==21485== 
Error 8 (expected)
==21485== 
==21485== HEAP SUMMARY:
==21485==     in use at exit: 32 bytes in 1 blocks
==21485==   total heap usage: 9 allocs, 8 frees, 3,474 bytes allocated
==21485== 
==21485== 32 bytes in 1 blocks are definitely lost in loss record 1 of 1
==21485==    at 0x4C24185: calloc
/tmp/vg/coregrind/m_replacemalloc/vg_replace_malloc.c:506
==21485==    by 0x4EE5FA8: parse_expression
/usr/local/google/ppluzhnikov/Archive/glibc-git/posix/regcomp.c:3021
==21485==    by 0x4EE791D: parse_branch
/usr/local/google/ppluzhnikov/Archive/glibc-git/posix/regcomp.c:2153
==21485==    by 0x4EE7A0D: parse_reg_exp
/usr/local/google/ppluzhnikov/Archive/glibc-git/posix/regcomp.c:2112
==21485==    by 0x4EE6C98: parse_expression
/usr/local/google/ppluzhnikov/Archive/glibc-git/posix/regcomp.c:2419
==21485==    by 0x4EE795C: parse_branch
/usr/local/google/ppluzhnikov/Archive/glibc-git/posix/regcomp.c:2160
==21485==    by 0x4EE7A0D: parse_reg_exp /usr/local/glibc-git/posix/regcomp.c:2112
==21485==    by 0x4EE6C98: parse_expression
/usr/local/glibc-git/posix/regcomp.c:2419
==21485==    by 0x4EE795C: parse_branch /usr/local/glibc-git/posix/regcomp.c:2160
==21485==    by 0x4EE7A0D: parse_reg_exp /usr/local/glibc-git/posix/regcomp.c:2112
==21485==    by 0x4EE7E20: re_compile_internal
/usr/local/glibc-git/posix/regcomp.c:2081
==21485==    by 0x4EE9090: regcomp /usr/local/glibc-git/posix/regcomp.c:500
==21485== 
==21485== LEAK SUMMARY:
==21485==    definitely lost: 32 bytes in 1 blocks
==21485==    indirectly lost: 0 bytes in 0 blocks
==21485==      possibly lost: 0 bytes in 0 blocks
==21485==    still reachable: 0 bytes in 0 blocks
==21485==         suppressed: 0 bytes in 0 blocks
==21485== 
==21485== For counts of detected and suppressed errors, rerun with: -v
==21485== ERROR SUMMARY: 1 errors from 1 contexts (suppressed: 4 from 0)


The bug is present in glibc-2.11.1 and current trunk; not present in glibc-2.7.

-- 
           Summary: regcomp with invalid expression leaks memory
           Product: glibc
           Version: unspecified
            Status: NEW
          Severity: normal
          Priority: P2
         Component: libc
        AssignedTo: drepper dot fsp at gmail dot com
        ReportedBy: ppluzhnikov at google dot com
                CC: glibc-bugs at sources dot redhat dot com
 GCC build triplet: x86_64-linux-gnu
  GCC host triplet: x86_64-linux-gnu
GCC target triplet: x86_64-linux-gnu


http://sourceware.org/bugzilla/show_bug.cgi?id=12078

------- You are receiving this mail because: -------
You are on the CC list for the bug, or are watching someone who is.


^ permalink raw reply	[flat|nested] 10+ messages in thread
[parent not found: <bug-12078-131@http.sourceware.org/bugzilla/>]

end of thread, other threads:[~2010-10-13 22:59 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-10-01 12:46 [Bug libc/12078] New: regcomp with invalid expression leaks memory ppluzhnikov at google dot com
2010-10-01 12:52 ` [Bug libc/12078] " ppluzhnikov at google dot com
2010-10-01 14:58 ` ppluzhnikov at google dot com
     [not found] <bug-12078-131@http.sourceware.org/bugzilla/>
2010-10-11 15:47 ` drepper.fsp at gmail dot com
2010-10-11 21:46 ` ppluzhnikov at google dot com
2010-10-12  2:50 ` drepper.fsp at gmail dot com
2010-10-12  4:58 ` ppluzhnikov at google dot com
2010-10-12  5:04 ` ppluzhnikov at google dot com
2010-10-12  5:06 ` ppluzhnikov at google dot com
2010-10-13 22:59 ` ppluzhnikov at google dot com

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).