bug-make
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[bug #64806] "invalid output sync mutex" on windows


From: Gergely Pinter
Subject: [bug #64806] "invalid output sync mutex" on windows
Date: Sun, 14 Jan 2024 12:09:50 -0500 (EST)

Follow-up Comment #12, bug#64806 (group make):

Hi all, 
I've recently encountered some undesired behavior which is likely related to
this open issue; attaching description of the phenomenon with a tiny project
where it consistently appears.

The environment I used is the MSYS2 distribution (https://www.msys2.org/), the
phenomenon is shown in case of the MINGW32 version of make (mingw32-make.exe).
 Please find attached a project with two makefiles (the top-level Makefile and
the utility component.mk), 10 “components” (cmp0-cmp9) with 100 tiny
source files each.  These 1000 source files can be compiled in parallel
(apparently the phenomenon described below occurs in case of large number of
parallel compilations).  If issuing the “all” goal, make should create
dependency files then compile sources (only object files created, no linking
in this example).  Most of the activities can be done in parallel, e.g., as
“make -s -j 8 -Otarget”.

The 4.4.1 version of make is available in the MSYS2 distribution both as
“make” (for the 64-bit MSYS environment) and as “mingw32-make” (for
the 32-bit MINGW32 environment):

$ make --version
GNU Make 4.4.1
Built for x86_64-pc-msys
Copyright (C) 1988-2023 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.

$ mingw32-make --version
GNU Make 4.4.1
Built for Windows32
Copyright (C) 1988-2023 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.

When running “make -s -j 8 -Otarget” (i.e., using the 64-bit MSYS
version), compilation goes fine.  However if invoking the same goal with
mingw32-make the (“mingw32-make -s -j 8 -Otarget”) the compilation hangs
somewhere around having created most of dependency files:

$ mingw32-make -s -j 8 -Otarget
[...]
DEP src98.c [cmp3]
DEP src98.c [cmp7]
DEP src99.c [cmp3]
DEP src99.c [cmp7]
[hangs here]

At this point 17 mingw32-make.exe processes are running, all at 0% CPU usage,
without any output, apparently in some kind of deadlock.  If hitting here
Ctrl-C the following output is printed:

mingw32-make[1]: *** Deleting file 'cmp7/src0.o'
mingw32-make[1]: *** Deleting file 'cmp4/src0.o'
mingw32-make[1]: *** Deleting file 'cmp0/src0.o'
mingw32-make[1]: *** Deleting file 'cmp5/src0.o'
mingw32-make[1]: *** Deleting file 'cmp1/src0.o'
mingw32-make[1]: *** Deleting file 'cmp6/src0.o'
mingw32-make[1]: *** Deleting file 'cmp2/src0.o'
mingw32-make[1]: *** Deleting file 'cmp3/src0.o'
mingw32-make: *** [Makefile:7: cmp3] Error 130
mingw32-make: *** [Makefile:7: cmp0] Error 130
mingw32-make: *** [Makefile:7: cmp1] Error 130
mingw32-make: *** [Makefile:7: cmp2] Error 130
mingw32-make: *** [Makefile:7: cmp4] Error 130
mingw32-make: *** [Makefile:7: cmp5] Error 130
mingw32-make: *** [Makefile:7: cmp6] Error 130
mingw32-make: *** [Makefile:7: cmp7] Error 130

Error messages suggest that mingw32-make processes were already executing the
compilation rules, but apparently weren’t able to do any progress. 
Furthermore at this point there are several mingw32-make.exe processes still
alive, whose CPU usage jumps to maximum after the Ctrl-C, such that the PC is
practically unresponsive unless killing these processes in Process Explorer.

The same behavior is experienced when using “-Oline” output
synchronization directive, but not with “-Onone” (then the compilation
goes fine).  Based on this I would suspect the root cause somewhere around
output synchronization, apparently only if using 32-bit version of make on
Windows.

(file #55565)

    _______________________________________________________

Additional Item Attachment:

File name: make-output-synchronization-example.tar.gz Size:13 KB
   
<https://file.savannah.gnu.org/file/make-output-synchronization-example.tar.gz?file_id=55565>


    AGPL NOTICE

These attachments are served by Savane. You can download the corresponding
source code of Savane at
https://git.savannah.nongnu.org/cgit/administration/savane.git/snapshot/savane-3f5b69a3b837951a0e5c0b7730ee347c798a8844.tar.gz


    _______________________________________________________

Reply to this item at:

  <https://savannah.gnu.org/bugs/?64806>

_______________________________________________
Message sent via Savannah
https://savannah.gnu.org/




reply via email to

[Prev in Thread] Current Thread [Next in Thread]