2025-05-22 05:47 AEST

View Issue Details Jump to Notes ]
IDProjectCategoryView StatusLast Update
0000273mercuryBugpublic2013-11-19 12:50
Reporterony 
Assigned Topbone 
PrioritylowSeverityminorReproducibilitysometimes
StatusclosedResolutionfixed 
Product Version 
Target VersionFixed in Version 
Summary0000273: race condition in Mmakefiles of deep_profiler and slice
DescriptionDuring build with -j9 from master branch I wasn't able to succeed few times because of permission deny for copying in $(MDBCOMP_MODULES).
Steps To ReproduceAt master branch bootstrap from existing compiler and use multiple jobs
make PARALLEL=-j9
Additional InformationLooks like the reason for that is race condition from rule that fired twice in parallel for same files and thus had scenario:
1. [thread1] chmod a+w feedback.m
2. [thread1] cp ../mdbcomp/feedback.m .
3. [thread2] chmod a+w feedback.m
4. [thread1] chmod a-w feedback.m
5. [thread2] cp ../mdbcomp/feedback.m . # fails on permission deny

Refactoring process of pulling in modules from $(MDBCOMP_DIR) should solve this issue.
TagsNo tags attached.
Attached Files

-Relationships

-Notes

~0000491

juliensf (administrator)

Copying the files instead of referring to the mdbcomp directory is (clearly) deliberate. The reason
for doing so to avoid stack overflows in some of the profiling / slice tools when the entire Mercury system
is built with tracing enabled. (The proposed patch would break this and make testing the Mercury
compiler in some configurations impossible.)

The race condition can be avoided by building the dependencies *before* doing the main build, e.g.
do

    $ mmake depend
    $ mmake -j9

~0000582

pbone (administrator)

I fixed this back in January and forgot to close the bug then.

-Issue History
Date Modified Username Field Change
2013-01-06 10:42 ony New Issue
2013-01-06 13:10 ony File Added: mercury-scm-fix-bug273-race-cond.-in-slice-and-deep_profile.patch
2013-01-07 11:43 juliensf Note Added: 0000491
2013-11-19 12:49 pbone Note Added: 0000582
2013-11-19 12:50 pbone Status new => closed
2013-11-19 12:50 pbone Assigned To => pbone
2013-11-19 12:50 pbone Resolution open => fixed