bugGNU roff - Bugs: bug #59958, [PATCH] race in Makefile at...

 
 

bug #59958: [PATCH] race in Makefile at generation of e.tmac and doc.tmac with bigger than -j1 eg. -j4

Submitter:  None
Submitted:  Thu 28 Jan 2021 03:48:55 AM UTC
   
 
Category:  Macro package - others/general Severity:  3 - Normal
Item Group:  Build/Installation Status:  Fixed
Privacy:  Public Assigned to:  gbranden
Open/Closed:  Closed Planned Release:  1.23.0
* Mandatory Fields

Add a New Comment Rich Markup
   

Fri 29 Jan 2021 09:24:15 PM UTC, comment #4: 


commit 362077eeb4abfd0b21416c093d32e4754d975731
Author: G. Branden Robinson <g.branden.robinson@gmail.com>
Date:   Sat Jan 30 05:23:46 2021 +1100

    tmac/tmac.am: Remove unidiomatic for loop.

    * tmac/tmac.am ($(TMACSTRIPFILES)):
      ($(TMACMDOCSTRIPFILES)): Remove unidiomatic for loop which frustrated
      parallel make operation.

    Thanks to an anonymous contributor for the report and patch.

    Fixes <https://savannah.gnu.org/bugs/?59958>.

    The bug report characterizes the for loop as a "race", which I don't
    think is strictly correct, since the outcome of the work done is not
    subject to variation.  The body of the for loop is a clobbering shell
    redirection operator, so the problem was one of potential pointless
    repetition of work in concurrent operation.  Good to fix, but not a
    cause for alarm.

    Problem dates back to 2609cfb727a98809548edfd721c5cb923085b24b, 6
    September 2014.


G. Branden Robinson <gbranden>
Group administrator
Fri 29 Jan 2021 02:50:31 AM UTC, comment #3: 

oh the race code is in  tmac/tmac.am  in git groff

looks like this:

$(TMACSTRIPFILES): $(TMACUNSTRIPFILES)                                                                                                  
  for f in $(TMACSTRIPFILES); do \                                                                                                      
     sed -f $(tmac_srcdir)/strip.sed $(top_srcdir)/$$f-u \                                                                              
       > $(top_builddir)/$$f; \                                                                                                         
  done                                                                                                                                  
                                                                                                                                        
$(TMACMDOCSTRIPFILES): $(TMACMDOCUNSTRIPFILES)                                                                                          
  $(MKDIR_P) $(top_builddir)/tmac/mdoc                                                                                                  
  for f in $(TMACMDOCSTRIPFILES); do \                                                                                                  
     sed -f $(tmac_srcdir)/strip.sed $(top_srcdir)/$$f-u \                                                                              
       > $(top_builddir)/$$f; \                                                                                                         
  done

Anonymous
Fri 29 Jan 2021 02:44:58 AM UTC, comment #2: 

Perhaps I should've mentioned the version:
sys-apps/groff-1.22.4::gentoo

because I look at git groff and don't see where to apply patch, maybe things already changed a lot in git version so this doesn't apply anymore. Sorry for the noise.

Anonymous
Fri 29 Jan 2021 02:37:41 AM UTC, comment #1: 

Ignore what was said and just look at the patch, you'll see it makes sense :)
The race is thus unnecessary(even if it doesn't really affect anyone) and thus patch could be applied to get rid of it.

Anonymous
Thu 28 Jan 2021 03:48:55 AM UTC, original submission:  

patch attached, it's self-evident now.

nobody should be affected if '>' bash operator works as expected, I guess. The only question is, what does '>' do if it happens in parallel to the same file ?

maybe if the file is big enough, it would overwrite some contents...

My '>' had O_APPEND in addition, so it only added to it, in effect increasing e.tmac and doc.tmac file sizes when make -j4 (not -j1) was used.

Anonymous

 

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

Attach Files:
   
   
Comment:
   

Attached Files
file #50797:  groff_fix_tmac_race.patch added by None (596B - text/x-patch)

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by gbranden (Updated 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.

     

    Follow 9 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2022-03-05 gbranden CategoryNone Macro package - others/general
    2021-01-29 gbranden StatusIn Progress Fixed
        Open/ClosedOpen Closed
        Planned ReleaseNone 1.23.0
    2021-01-29 gbranden StatusNone In Progress
        Assigned toNone gbranden
    2021-01-29 barx Carbon-CopyRemoved 93119 -
    2021-01-29 barx Summaryrace in Makefile at generation of e.tmac and doc.tmac with bigger than -j1 eg. -j4 [PATCH] race in Makefile at generation of e.tmac and doc.tmac with bigger than -j1 eg. -j4
    2021-01-28 None Attached File- Added groff_fix_tmac_race.patch, #50797

    Back to the top

    Powered by Savane 3.13-bb6a.
    Corresponding source code