bug-make
[Top][All Lists]
Advanced

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

[bug #63111] Regression. make runs out of file descriptors.


From: Dmitry Goncharov
Subject: [bug #63111] Regression. make runs out of file descriptors.
Date: Mon, 26 Sep 2022 17:40:01 -0400 (EDT)

Follow-up Comment #1, bug #63111 (project make):

A user reported an issue where make runs out of file descriptors.

The original bug report is here
https://lists.gnu.org/archive/html/bug-make/2022-09/msg00122.html


This makefile in question has the following problematic make code

++++
%.tab.c %.tab.h %.output: %.y
    @$(VECHO) BISON $@
    $(BISON) -b $(basename $(basename $@)) -d $<
%.d: %.c
    @$(VECHO) DEP $<
    $(CC) $(CPPFLAGS) $(CFLAGS) -MM -MG -MT "$*.o $@" $< > $@
-include $(DTC_OBJS:%.o=%.d)
----

The following takes place.
1. make needs to include parser.tab.d.
2. make finds rule '%.d: %.c', which depends on parser.tab.c.
3. make needs to build parser.tab.c.
4. make finds rule '%.tab.c %.tab.h %.output: %.y'. Note, this rule also has
parser.output listed as a target.
5. make runs the recipe and builds parser.tab.c. Note, the recipe does not
build parser.output.
6. make runs the recipe of rule '%.d: %.c' and generates parser.tab.d.
7. make re-executes itself to read updated parser.tab.d.
8. Normally, there should be no more re-exec. However, due to missing
parser.output, the cycle repeats.

Here is a minimal makefile which reproduces the issue.

++++
$ ls
hello.x  makefile
$ cat makefile
all: hello.q
%.q %.bogus: %.x; touch $*.q
hello.d: hello.q; touch $@
-include hello.d
$ ASAN_OPTIONS=detect_leaks=0 ~/src/make/l64/make -R --debug=m
GNU Make 4.3.90
Built for x86_64-pc-linux-gnu
Copyright (C) 1988-2022 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.
Reading makefiles...
Updating makefiles....
  File 'hello.d' does not exist.
    File 'hello.q' does not exist.
   Must remake target 'hello.q'.
touch hello.q
   Successfully remade target file 'hello.q'.
 Must remake target 'hello.d'.
touch hello.d
 Successfully remade target file 'hello.d'.
Re-executing[1]: /home/dgonchar/src/make/l64/make -R --debug=m
GNU Make 4.3.90
Built for x86_64-pc-linux-gnu
Copyright (C) 1988-2022 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.
Reading makefiles...
Updating makefiles....
    Grouped target peer 'hello.bogus' of file 'hello.q' does not exist.
   Must remake target 'hello.q'.
touch hello.q
   Successfully remade target file 'hello.q'.
  Prerequisite 'hello.q' is newer than target 'hello.d'.
 Must remake target 'hello.d'.
touch hello.d
 Successfully remade target file 'hello.d'.
Re-executing[2]: /home/dgonchar/src/make/l64/make -R --debug=m
GNU Make 4.3.90
^C
----

This is clearly a problem in the makefile. However, make-4.3 allows this.
The change in behavior was introduced in
fabb03eac412b5ea19f1a97be31dc8c6fa7fc047.

i see atleast the following options
1. revert fabb03eac412b5ea19f1a97be31dc8c6fa7fc047.
2. keep the code as is and expect the users to fix their makefile. So far,
Andreas reported dtc and coreutils affected.


    _______________________________________________________

Reply to this item at:

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

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




reply via email to

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