[minicoredumper] [PATCH 3/3] Dump NUL character at the end of solib name

Simon Marchi simon.marchi at ericsson.com
Tue Oct 13 19:54:16 CEST 2015


When dumping the path of a shared object, minicoredumper dumps all the
characters of the string, but not the terminating NUL character.  When
we implement support for unavailable bytes in GDB, it is suddenly unable
to read the path from the core.  This is because it now trips on an
unavailable byte, where before it would read it as a 0.

Signed-off-by: Simon Marchi <simon.marchi at ericsson.com>
---
 src/minicoredumper/corestripper.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/minicoredumper/corestripper.c b/src/minicoredumper/corestripper.c
index 3fb3cd3..908bb02 100644
--- a/src/minicoredumper/corestripper.c
+++ b/src/minicoredumper/corestripper.c
@@ -2909,7 +2909,7 @@ static int get_so_list(struct dump_info *di)
 			/* dump link_map name (not including terminator since
 			 * sparse core data is already 0) */
 			if (di->cfg->prog_config.dump_auxv_so_list) {
-				dump_vma(di, addr, strlen(l_name), 0,
+				dump_vma(di, addr, strlen(l_name) + 1, 0,
 					 "auxv link_map name (%s)", l_name);
 			}
 
-- 
2.5.1





More information about the minicoredumper mailing list