nightly test result of systemtap in ppc64

Hien Nguyen hien@us.ibm.com
Tue May 9 18:29:00 GMT 2006


Stone, Joshua I wrote:

>On Tuesday, May 09, 2006 11:02 AM, Hien Nguyen wrote:
>  
>
>>I initialized *ptr=NULL to get pass the compiler.
>>    
>>
>
>Sure, but I would like to know why that error was reported in the first
>place.  As far as I can see, there's no way for 'ptr' to be used
>uninitialized.  If I'm missing something, then your fix just means that
>we'll induce a NULL dereference if there's a problem.
>
>
>Josh
>  
>
Here it is
46121 void function_probefunc (struct context* __restrict__ c) {
  46122   struct function_probefunc_locals *  __restrict__ l =
  46123     & c->locals[c->nesting].function_probefunc;
  46124   (void) l;
  46125   #define CONTEXT c
  46126   #define THIS l
  46127   if (0) goto out;
  46128   l->__retvalue[0] = '\0';
  46129   {
  46130      /* pure */
  46131         char *dst, *ptr, *start;
  46132         String str;
  46133         int len = MAXSTRINGLEN;
  46134
  46135         start = strstr(CONTEXT->probe_point, "function(\"");
  46136         if (start) {
  46137                 ptr = start + 10;
  46138         } else {
  46139                 start = strstr(CONTEXT->probe_point, "inline(\"");
  46140                 if (start) {
  46141                         ptr = start + 8;
  46142                 }
  46143         }
  46144         if (start) {
  46145                 dst = THIS->__retvalue;
  46146                 while (*ptr != '@' && --len > 0 && *ptr)
  46147                         *dst++ = *ptr++;
  46148                 *dst = 0;
  46149                 goto out;
  46150         }
  46151         if (CONTEXT->regs) {
  46152                 str  = _stp_string_init (0);
  46153                 _stp_symbol_sprint(str, REG_IP(CONTEXT->regs));
  46154                 start = strstr(_stp_string_ptr(str), " : ");
  46155                 if (start) {
  46156                         dst = THIS->__retvalue;
  46157                         ptr = start+3;
  46158                         while (*ptr != '+' && --len > 0 && *ptr)
  46159                                 *dst++ = *ptr++;
  46160                         *dst = 0;
  46161                 }
  46162                 else {
  46163                         strlcpy(THIS->__retvalue, 
_stp_string_ptr(str),M        AXSTRINGLEN);
  46164                 }
  46165                 goto out;
  46166         }
  46167         THIS->__retvalue[0] = '\0';
  46168
  46169   }




More information about the Systemtap mailing list