bugmake - Bugs: bug #54427, make can block after being killed

 
 

bug #54427: make can block after being killed

Submitted by:  Koen Van Hoof <kvho>
Submitted on:  Thu 02 Aug 2018 11:04:35 AM UTC  
 
Severity:  3 - Normal Item Group:  Bug
Status:  None Privacy:  Public
Assigned to:  None Open/Closed:  Open
Component Version:  4.2.1 Operating System:  POSIX-Based
Fixed Release:  None Triage Status:  None

Add a New Comment (Rich Markup)
   

You are not logged in

Please log in, so followups can be emailed to you.

 

Thu 02 Aug 2018 11:04:35 AM UTC, original submission:  

job.c, line 1002
#ifndef NO_OUTPUT_SYNC
      /* Synchronize any remaining parallel output.  */
      output_dump (&c->output);
#endif

This happens in a 'critical' section.
a child has finished, but job_slots_used has not yet decremented.

When a fatal signal arrives, during output_dump, fatal_error_signal is calling
      while (job_slots_used > 0)
        reap_children (1, 0);
Since job_slots_used is 1 higher than the number of children, reap_children is called eventually, without any child, and it will block on 'EINTRLOOP (pid, wait (&status)'

Solution: reorder some statements.
/* There is now another slot open.  */
      if (job_slots_used > 0)
        --job_slots_used;

      /* Remove the child from the chain and free it.  */
      if (lastc == 0)
        children = c->next;
      else
        lastc->next = c->next;

      unblock_sigs ();
#ifndef NO_OUTPUT_SYNC
      /* Synchronize any remaining parallel output.  */
      output_dump (&c->output);
#endif
      free_child (c);     

Koen Van Hoof <kvho>

 

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

Attach Files:
   
   
Comment:
   

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

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

    Do you think this task is very important?
    If so, you can add your encouragement to it.
    This task has 0 encouragements so far.

    Only logged-in users can vote.

     

     

     

    No changes have been made to this item

    Back to the top


    Powered by Savane 3.5