[torquedev] [Bug 98] Allocation of incorrect pointer in src/scheduler.cc/samples/fifo/job_info.c: update_job_comment causes random crash.

bugzilla-daemon at supercluster.org bugzilla-daemon at supercluster.org
Thu Nov 11 03:06:37 MST 2010


--- Comment #15 from Stephen Usher <steve at earth.ox.ac.uk> 2010-11-11 03:06:37 MST ---
Created an attachment (id=60)
 --> (http://www.clusterresources.com/bugzilla/attachment.cgi?id=60)
job_info.c: Adds local copy of comment passed to pbs_alterjob() to stop random
SEGV (in sprintf()) and to safeguard data.

A little bit of a belt and braces approach (defensive programming), but better
to be safe than sorry if we don't know what pbs_alterjob() is doing to the data
we pass to it.

Because there's a possibility that pbs_alterjob() may change the value of the
pointer passed to it I'm assuming that it will and, for the cost of the size of
a pointer, keeping a local copy so that the memory free()'d at the end of the
function is guaranteed to be that which was allocated earlier.

Configure bugmail: http://www.clusterresources.com/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.

More information about the torquedev mailing list