[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
Tue Nov 9 16:54:23 MST 2010


http://www.clusterresources.com/bugzilla/show_bug.cgi?id=98

David Singleton <David.Singleton at anu.edu.au> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |David.Singleton at anu.edu.au

--- Comment #2 from David Singleton <David.Singleton at anu.edu.au> 2010-11-09 16:54:22 MST ---

I guess I dont quite understand. Isn't pbs_alterjob() synchronous? Why does it
matter that comment may be stack-based? The server copy wont be.

Cheers,
David

(In reply to comment #0)
> pbs_sched will crash randomly when there are large numbers of jobs in a queue
> due to the assignment of the wrong pointer at:
> 
> src/scheduler.cc/samples/fifo/job_info.c:695: update_job_comment
> 
> The pointer passed to the routine as the message text is assigned to attr.value
> instead of the duplicated copy. Depending upon the code execution path this may
> point to a stack-based buffer which could disappear later in the program's
> processing. Not only this, but the value held will change
> non-deterministically.
> 
> --- torque-2.4.11/src/scheduler.cc/samples/fifo/job_info.c.orig 2009-10-29
> 21:01:21.000000000 +0000
> +++ torque-2.4.11/src/scheduler.cc/samples/fifo/job_info.c      2010-11-08
> 15:37:57.848143299 +0000
> @@ -692,7 +692,7 @@
> 
>      jinfo -> comment = string_dup(comment);
> 
> -    attr.value = comment;
> +    attr.value = jinfo -> comment;
> 
>      pbs_alterjob(pbs_sd, jinfo -> name, &attr, NULL);

-- 
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