[cmaster-next] [PATCH 7/9] lib: Fix thread_execute_crash

Donald Sharp sharpd at cumulusnetworks.com
Wed Dec 14 15:49:51 EST 2016


With the change to have thread_get fill inthe ->hist
pointer, thread_execute was missed and it
needs to fill in the .hist pointer for the
dummy thread created.

I'm not really sure why we need to call a
thread_execute on a function.  When we
could, you know, just call the bloody
thing.

Signed-off-by: Donald Sharp <sharpd at cumulusnetworks.com>
(cherry picked from commit 77089840504de55b6322005ad0a999b983a0e036)
---
 lib/thread.c | 10 +++++++---
 1 file changed, 7 insertions(+), 3 deletions(-)

diff --git a/lib/thread.c b/lib/thread.c
index ba1386a..64eaae4 100644
--- a/lib/thread.c
+++ b/lib/thread.c
@@ -1490,18 +1490,22 @@ funcname_thread_execute (struct thread_master *m,
                 int val,
 		debugargdef)
 {
-  struct thread dummy; 
+  struct cpu_thread_history tmp;
+  struct thread dummy;
 
   memset (&dummy, 0, sizeof (struct thread));
 
   dummy.type = THREAD_EVENT;
   dummy.add_type = THREAD_EXECUTE;
   dummy.master = NULL;
-  dummy.func = func;
   dummy.arg = arg;
   dummy.u.val = val;
 
-  dummy.funcname = funcname;
+  tmp.func = dummy.func = func;
+  tmp.funcname = dummy.funcname = funcname;
+  dummy.hist = hash_get (cpu_record, &tmp,
+			 (void * (*) (void *))cpu_record_hash_alloc);
+
   dummy.schedfrom = schedfrom;
   dummy.schedfrom_line = fromln;
 
-- 
2.5.5





More information about the dev mailing list