[torqueusers] hunting for memory leaks (1.2.0p6)

Dave Jackson jacksond at clusterresources.com
Mon Sep 26 09:28:49 MDT 2005


Wolfgang,

  These changes have been added to the latest patch 7 snapshot.
Regarding the last questionable memory leak, I think Garrick would be
the best point to discuss this with.  He made enhancements with regard
to free_noop and probably best knows the appropriate solution to address
this leak.

  Also, how long have you run with these patches in place?  How many
restarts, how many jobs?  Any side affects?

Dave

On Tue, 2005-09-20 at 15:24 -0400, Wolfgang Wander wrote:
> I'm in the process to hunt down memory leaks. Valgrind is a good
> tool here and it seems that libc and ldap in suse9.2 are to blame
> for a lot.  Here are a few patches that might be useful once the
> bigger ldap problem is under control:
> 
> 
> ----------------------------------------------------------------------
> the missing ~ clears out the wrong bits:
> ----------------------------------------------------------------------
> 
> diff -c -r torque-1.2.0p6orig/src/lib/Libattr/attr_fn_arst.c torque-1.2.0p6/src/lib/Libattr/attr_fn_arst.c
> *** /work/external/wwc/pbs/torque-1.2.0p6wwc/src/lib/Libattr/attr_fn_arst.c     Wed Jul 27 02:25:01 2005
> --- torque-1.2.0p6/src/lib/Libattr/attr_fn_arst.c       Tue Sep 20 15:16:40 2005
> ***************
> *** 249,255 ****
>       {
>       free_arst(patr);
>   
> !     patr->at_flags &= ATR_VFLAG_MODIFY;       /* _SET cleared in free_arst */
>   
>       return(0);
>       }
> --- 249,255 ----
>       {
>       free_arst(patr);
>   
> !     patr->at_flags &= ~ATR_VFLAG_MODIFY;      /* _SET cleared in free_arst */
>   
>       return(0);
>       }
> 
> 
> ----------------------------------------------------------------------
> from the wrong comments it seems that the free statement was placed
> accordingly wrong here:
> ----------------------------------------------------------------------
> 
> 
> diff -c -r torque-1.2.0p6orig/src/server/attr_recov.c torque-1.2.0p6/src/server/attr_recov.c
> *** /work/external/wwc/pbs/torque-1.2.0p6wwc/src/server/attr_recov.c    Thu Aug 25 18:11:30 2005
> --- torque-1.2.0p6/src/server/attr_recov.c      Tue Sep 20 13:49:02 2005
> ***************
> *** 498,506 ****
>           {
>           log_err(-1,id,"unknown attribute discarded");
>   
>           continue;
>           }
> !       }
>   
>       (padef + index)->at_decode(
>         pattr + index,
> --- 498,508 ----
>           {
>           log_err(-1,id,"unknown attribute discarded");
>   
> +       free(pal);
> + 
>           continue;
>           }
> !       } /* END if (index < 0) */
>   
>       (padef + index)->at_decode(
>         pattr + index,
> ***************
> *** 512,522 ****
>         (padef + index)->at_action(pattr+index,parent,ATR_ACTION_RECOV);
>   
>       (pattr + index)->at_flags = pal->al_flags & ~ATR_VFLAG_MODIFY;
> -     }  /* END if (index < 0) */
>   
> -   if (palsize)
>       free(pal);
>   
>     return(0);
>     }  /* END recov_attr() */
>   
> --- 514,525 ----
>         (padef + index)->at_action(pattr+index,parent,ATR_ACTION_RECOV);
>   
>       (pattr + index)->at_flags = pal->al_flags & ~ATR_VFLAG_MODIFY;
>   
>       free(pal);
>   
> +     }  /* END while(1) */
> + 
> + 
>     return(0);
>     }  /* END recov_attr() */
>   
> 
> ----------------------------------------------------------------------
> Furtheremore in svr_recov.c this leak here seems intentional, or is
> it?
> ----------------------------------------------------------------------
>   if (pdef->at_decode(&tempat,pdef->at_name,NULL,buf) < 0)
>     {
>     sprintf(log_buffer,"decode of acl %s failed",
>       pdef->at_name);
> 
>     log_err(errno,"recov_acl",log_buffer);
>     }
>   else if (pdef->at_set(pattr,&tempat,SET) != 0)
>     {
>     sprintf(log_buffer,"set of acl %s failed",
>       pdef->at_name);
> 
>     log_err(errno,"recov_acl",log_buffer);
>     }
> 
>   pdef->at_free(&tempat); /* at_free is set to free_noop and leave
>                              attributes dangling? wwc */
> 
> ----------------------------------------------------------------------
> 
> 
> _______________________________________________
> torqueusers mailing list
> torqueusers at supercluster.org
> http://www.supercluster.org/mailman/listinfo/torqueusers



More information about the torqueusers mailing list