[torquedev] patch: prevent IRIX pbs_mom from segfaulting in find_resc_def

Toni L. Harbaugh-Blackford [Contr] harbaugh at ncifcrf.gov
Fri Feb 16 09:48:59 MST 2007


In torque-2.2.0-snap.200611291634, the IRIX build of pbs_mom segfaults at line
6247 of mom_main.c:

   rdcput = find_resc_def(svr_resc_def,"cput",svr_resc_size);

because svr_resc_def is still NULL at that point.  It is not
initialized until a few lines later at the call to init_resc_defs().

Here is a little patch that moves the call to init_resc_defs()
just ahead of the "#if MOM_CHECKPOINT == 1" line.


--- torque-2.2.0-snap.200611291634/src/resmom/mom_main.c_orig	2006-11-28 15:41:51.000000000 -0500
+++ torque-2.2.0-snap.200611291634/src/resmom/mom_main.c	2007-02-16 11:05:46.000000000 -0500
@@ -6237,6 +6237,8 @@
   path_aux         = mk_dirs("aux/");
   path_server_name = mk_dirs("server_name");

+  init_resc_defs(path_resources);
+
 #if MOM_CHECKPOINT == 1

   if (path_checkpoint == NULL)	/* if not -C option */
@@ -6253,8 +6255,6 @@
 #endif  /* not DEBUG and not NO_SECURITY_CHECK */
 #endif	/* MOM_CHECKPOINT */

-  init_resc_defs(path_resources);
-
   /* change working directory to mom_priv */

   if (chdir(mom_home) == -1)


-------------------------------------------------------------------
Toni Harbaugh-Blackford                   harbaugh at abcc.ncifcrf.gov
System Administrator
Advanced Biomedical Computing Center (ABCC)
National Cancer Institute
Contractor - SAIC/Frederick


More information about the torquedev mailing list