[ltrace-commits] 12/13: Fix cloning of libraries with Dwarf support

Petr Machata pmachata-guest at moszumanska.debian.org
Fri Jul 25 11:05:30 UTC 2014


This is an automated email from the git hooks/post-receive script.

pmachata-guest pushed a commit to branch master
in repository ltrace.

commit bc7551c18a2ea7b3baf51a35396fe642066f02e6
Author: Petr Machata <pmachata at redhat.com>
Date:   Fri Jul 25 12:40:52 2014 +0200

    Fix cloning of libraries with Dwarf support
    
    - struct library::dwfl_module was left unitialized after
      library_clone.  Garbage was kept in, which prevented proper
      initialization later, and resulted in segmentation violation.
---
 library.c | 10 +++++++++-
 1 file changed, 9 insertions(+), 1 deletion(-)

diff --git a/library.c b/library.c
index bb0e4cc..a0cd860 100644
--- a/library.c
+++ b/library.c
@@ -1,6 +1,6 @@
 /*
  * This file is part of ltrace.
- * Copyright (C) 2011,2012,2013 Petr Machata, Red Hat Inc.
+ * Copyright (C) 2011,2012,2013,2014 Petr Machata, Red Hat Inc.
  * Copyright (C) 2001,2009 Juan Cespedes
  * Copyright (C) 2006 Ian Wienand
  *
@@ -20,6 +20,8 @@
  * 02110-1301 USA
  */
 
+#include "config.h"
+
 #include <stdlib.h>
 #include <string.h>
 #include <assert.h>
@@ -559,6 +561,12 @@ library_clone(struct library *retp, struct library *lib)
 		goto fail;
 	}
 
+#if defined(HAVE_LIBDW)
+	/* Wipe DWFL_MODULE, leave it to proc_add_library to
+	 * initialize.  */
+	lib->dwfl_module = NULL;
+#endif
+
 	return 0;
 }
 

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/collab-maint/ltrace.git



More information about the ltrace-commits mailing list