[memprof: 46/76] process_locate_symbol: Make sure a valid string is always returned



commit 6aa3a0ebf87867dd21b48dffad93e4f863a1adad
Author: Holger Hans Peter Freyther <zecke selfish org>
Date:   Mon Oct 26 03:12:43 2009 +0100

    process_locate_symbol: Make sure a valid string is always returned
    
    Fix a crash/fixme with a NULL symbol is returned. In the case of
    WebKit/GTK+ there is an allocation of an area not having a library
    associated with it at all. Return a static "<unknown map>" in this
    case and remove the fixme around this static.
    
            * src/process.c:
            (process_locate_symbol): Return "<unknown map>" instead of NULL
            * src/profile.c:
            (profile_add_stack_trace): Remove NULL check

 src/process.c |    2 +-
 src/profile.c |   12 ------------
 2 files changed, 1 insertions(+), 13 deletions(-)
---
diff --git a/src/process.c b/src/process.c
index 70a0a2f..8461293 100644
--- a/src/process.c
+++ b/src/process.c
@@ -233,7 +233,7 @@ process_locate_symbol (MPProcess *process, gsize addr)
 	const BinSymbol *symbol;
 
 	if (!map)
-		return NULL;
+		return "<unknown map>";
 
 	addr -= map->start;
 	addr += map->offset;
diff --git a/src/profile.c b/src/profile.c
index 8b5b80c..ef9699c 100644
--- a/src/profile.c
+++ b/src/profile.c
@@ -59,18 +59,6 @@ profile_add_stack_trace (Profile *profile, GList *stack, guint size)
 	    process_locate_symbol (profile->process, GPOINTER_TO_SIZE(element->address));
 	int i;
 
-        /*
-         * Workaround for the case that an allocation was made and the
-         * mapped library is gone now. This is happening with Gtk+/Epiphany/WebKit.
-         * One way would be to override dlclose and resolve all symbols within
-         * this address space. FIXME.
-         */
-	if (!symbol) {
-		g_warning ("Symbol at address: %p is null\n", element->address);
-		parent = NULL;
-		continue;
-	}
-
 	for (i = 0; i < roots->len; ++i)
 	{
 	    ProfileNode *node = roots->pdata[i];



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]