|
From: <sv...@va...> - 2012-03-07 14:24:23
|
philippe 2012-03-06 20:35:20 +0000 (Tue, 06 Mar 2012)
New Revision: 12419
Log:
Fix leak of range_list (see below an example) in readdwarf3.c.
(found by running regression tests with an outer memcheck).
(validated by running all regression tests "natively" on x86 and amd64,
and re-running regressions tests with outer memcheck).
==7500== 160 bytes in 2 blocks are definitely lost in loss record 75 of 246
==7500== at 0x2803CEF7: vgPlain_arena_malloc (m_mallocfree.c:1599)
==7500== by 0x280AAFA5: vgModuleLocal_dinfo_zalloc (misc.c:48)
==7500== by 0x2804E2A4: vgPlain_newXA (m_xarray.c:68)
==7500== by 0x280B3CD6: unitary_range_list (readdwarf3.c:703)
==7500== by 0x280B66CF: parse_var_DIE (readdwarf3.c:1631)
==7500== by 0x280BA0A6: read_DIE (readdwarf3.c:3248)
==7500== by 0x280BA170: read_DIE (readdwarf3.c:3269)
==7500== by 0x280BABC4: T.364 (readdwarf3.c:3611)
==7500== by 0x280BC634: vgModuleLocal_new_dwarf3_reader (readdwarf3.c:4035)
==7500== by 0x280609F4: vgModuleLocal_read_elf_debug_info (readelf.c:2529)
==7500== by 0x2805BD31: vgPlain_di_notify_mmap (debuginfo.c:610)
==7500== by 0x280362E3: valgrind_main (m_main.c:1944)
Modified files:
trunk/coregrind/m_debuginfo/readdwarf3.c
Modified: trunk/coregrind/m_debuginfo/readdwarf3.c (+3 -3)
===================================================================
--- trunk/coregrind/m_debuginfo/readdwarf3.c 2012-03-06 15:54:28 +00:00 (rev 12418)
+++ trunk/coregrind/m_debuginfo/readdwarf3.c 2012-03-06 20:35:20 +00:00 (rev 12419)
@@ -3644,9 +3644,6 @@
cu_amount_used = cu_offset_now - cc.cu_start_offset;
}
- if (cu_offset_now == debug_info_sz)
- break;
-
/* Preen to level -2. DIEs have level >= 0 so -2 cannot occur
anywhere else at all. Our fake the-entire-address-space
range is at level -1, so preening to -2 should completely
@@ -3655,6 +3652,9 @@
varstack_preen( &varparser, td3, -2 );
/* Similarly, empty the type stack out. */
typestack_preen( &typarser, td3, -2 );
+
+ if (cu_offset_now == debug_info_sz)
+ break;
/* else keep going */
TRACE_D3("set_abbv_Cursor cache: %lu queries, %lu misses\n",
|