[prev in list] [next in list] [prev in thread] [next in thread] 

List:       mono-devel-list
Subject:    [Mono-dev] mono_signature_get_desc segfaults
From:       Greg Young <gregoryyoung1 () gmail ! com>
Date:       2015-01-24 18:54:17
Message-ID: CAC9RQtgXtsoY_zGxQs-Y6PcWMZ0GdPXSNPEGC+Ft7K4x_rPK0w () mail ! gmail ! com
[Download RAW message or body]

  0 static char *
  1 get_method_name(MonoProfiler *profiler, MonoMethod *method) {
  2     MonoClass *klass = mono_method_get_class (method);
  3     if(klass == NULL) return NULL;
  4     char *signature = (char*) mono_signature_get_desc
(mono_method_signature (method), 0);
  5     if(signature == NULL) return NULL;
  6     const char *namespace = mono_class_get_namespace (klass);
  7     const char *klassname = mono_class_get_name (klass);
  8     const char *methodname = mono_method_get_class (method);
  9     //g_free (signature);
 10     char *name = g_strdup_printf ("%s.%s:%s (%s)",
 11                                  mono_class_get_namespace (klass),
 12                                  mono_class_get_name (klass),
 13                                  mono_method_get_name (method),
 14                                  signature);
 15     return name;
 16 }

I have been able to get it to happen rather reliably that I appear to
get back something that is a bad pointer from mono_signature_get_desc.
I am not seeing anything obviously wrong in how I am calling it but
will get a segv occasionally on the strdup_printf here. Not using the
signature makes issue go away but isnt much help:)

Am I missing something in how I should be calling get_desc? The
MonoMethod was handed to me by the runtime...

Cheers,

Greg

-- 
Studying for the Turing test
_______________________________________________
Mono-devel-list mailing list
Mono-devel-list@lists.ximian.com
http://lists.ximian.com/mailman/listinfo/mono-devel-list
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic