bugGNU Time - Bugs: bug #64973, time fails when job control is used

 
 

bug #64973: time fails when job control is used

Submitter:  Bruno Haible <haible>
Submitted:  Mon 04 Dec 2023 05:16:20 AM UTC
   
 
Category:  None Severity:  3 - Normal
Item Group:  None Status:  None
Privacy:  Public Assigned to:  None
Open/Closed:  Open
* Mandatory Fields

Add a New Comment Rich Markup
   

Mon 04 Dec 2023 05:21:04 AM UTC, comment #1: 

Although the error is not easily reproducible, it is easy to analyze
and fix:

The piece of error message string "error waiting for child process" occurs
only in one place: in src/time.c line 745.

The only possible cause for the error message
"error waiting for child process: Interrupted system call" is therefore
that resuse_end returned 0, with errno being set to EINTR.

resuse_end is defined in src/resuse.c line 71. The problem is that this
function doesn't handle EINTR so far.

Find attached a proposed fix.


(file #55398)

Bruno Haible <haible>
Mon 04 Dec 2023 05:16:20 AM UTC, original submission:  

I'm using a build script (scripts/Emerge-Pkg that invokes scripts/Build-Pkg)
that invokes /usr/bin/time. I used bash's job control to stop and then
resume it. When I resumed it, 'time' reported an error:


# fg
scripts/Emerge-Pkg -f gdb
/usr/bin/time: error waiting for child process: Interrupted system call
...


The expected behaviour that after 'fg', stopped jobs continue to run
without failing.

This is on Linux/sparc64. Versions:
  - Linux 6.6.3
  - glibc 2.38

# /usr/bin/time --version
time (GNU Time) 1.9
Copyright (C) 2018 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <https://gnu.org/licenses/gpl.html>.
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.

Written by David Keppel, David MacKenzie, and Assaf Gordon.


Bruno Haible <haible>

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach Files:
   
   
Comment:
   

Attached Files
file #55398:  0001-Fix-failure-when-job-control-is-used.patch added by haible (2KiB - text/x-patch - proposed fix)

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by haible (Submitted the item)
  •  

    There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

    Only logged-in users can vote.

     

    Follows 1 latest change.

    Date Changed by Updated Field Previous Value => Replaced by
    2023-12-04 haible Attached File- Added 0001-Fix-failure-when-job-control-is-used.patch, #55398

    Back to the top

    Powered by Savane 3.13-758e.
    Corresponding source code