Article View: gnu.bash.bug
Article #439Bug in flush_child -- calling add_times with bogus rusage
From: Ray Moody
Date: Sat, 05 Aug 1989 21:56
Date: Sat, 05 Aug 1989 21:56
51 lines
1931 bytes
1931 bytes
Start any program. Stop it with ^Z. say "times". You will get
incorrect information, possibly including negative numbers.
When a process stops and may be resumed, no rusage information is
provided by wait3, but flush_child calls add_times anyway.
Ray
-------------------------------------------------------------------------------
RCS file: RCS/jobs.c,v
retrieving revision 1.2.1.2
diff -c -r1.2.1.2 jobs.c
*** /tmp/,RCSt1012497 Sat Aug 5 16:54:55 1989
--- jobs.c Sat Aug 5 16:27:54 1989
***************
*** 1081,1086
if (pid > 0)
{
/* Keep track of total time used. */
add_times (&rusage);
--- 1081,1088 -----
if (pid > 0)
{
+ /* Fixed by Ray Sat Aug 5 16:27:19 EST 1989 to ignore invalid
+ rusage info for jobs not yet finished */
/* Keep track of total time used. */
if (! WIFSTOPPED (status))
add_times (&rusage);
***************
*** 1082,1088
if (pid > 0)
{
/* Keep track of total time used. */
! add_times (&rusage);
/* Locate our PROCESS for this pid. */
child = find_pipeline (pid);
--- 1084,1091 -----
/* Fixed by Ray Sat Aug 5 16:27:19 EST 1989 to ignore invalid
rusage info for jobs not yet finished */
/* Keep track of total time used. */
! if (! WIFSTOPPED (status))
! add_times (&rusage);
/* Locate our PROCESS for this pid. */
child = find_pipeline (pid);
Technical Details
Message-ID:
<8908052156.AA12517@maxwell.physics.purdue.edu>Path:
arc1-ca.pugleaf.net!utzoo!utgpu!jarvis.csri.toronto.edu!rutgers!tut.cis.ohio-state.edu!MAXWELL.PHYSICS.PURDUE.EDU!rayShow Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!utgpu!jarvis.csri.toronto.edu!rutgers!tut.cis.ohio-state.edu!MAXWELL.PHYSICS.PURDUE.EDU!ray From: ray@MAXWELL.PHYSICS.PURDUE.EDU (Ray Moody) Newsgroups: gnu.bash.bug Subject: Bug in flush_child -- calling add_times with bogus rusage Message-ID: <8908052156.AA12517@maxwell.physics.purdue.edu> Date: 5 Aug 89 21:56:12 GMT Sender: chen-l@tut.cis.ohio-state.edu Distribution: gnu Organization: GNUs Not Usenet Lines: 51