"make: write error: stdout" on parallel builds

Bug #1814393 reported by eocanha
76
This bug affects 15 people
Affects Status Importance Assigned to Milestone
linux-signed (Ubuntu)
Fix Released
Undecided
Unassigned

Bug Description

- Release of Ubuntu: 18.04.1 LTS (Kubuntu).
- Package version: linux-image-4.15.0-44-generic, linux-image-4.15.0-45-generic.
- Expected outcome: Large parallel make build completing properly.
- What happened instead: Build stops with "make: write error: stdout".

Full explanation:

Since the update to kernel 4.15.0-44 (linux-image-4.15.0-44-generic) in Kubuntu Bionic I'm experiencing issues in my ThinkPad P52 laptop during large parallel builds of source code (eg: a buildroot full rebuild for a work project). Note that this reports isn't about kernel builds, but about large project builds in general.

I don't think it's relevant, but I'm running those builds in an schroot with the same Ubuntu Bionic distro I'm also using as main host distro.

The specific error I get is this (in Spanish):

  make[4]: error al escribir: stdout

I call Buildroot's make like this from KDE Konsole with "infinite history buffer" enabled (uses a tmp file to store the logs):

  V=1 make ...some stuff... 2>&1

However, the error is reproducible in Konsole even if I call make without options and also if I use "limited (in-memory) history buffer" as well as "no history buffer". Buildroot autoselects a parallelization level (-j) automatically. In my case, I'm using a Xeon E-2176 CPU with 12 threads.

Searching on the Internet I found a thread[1] where people from the GNU Make project say that the error may be coming from the C runtime library (and I suspect originating from the kernel).

I can NOT reproduce the issue on linux-image-4.15.0-43-generic (selected from grub at boot), but I experience it with linux-image-4.15.0-44-generic and linux-image-4.15.0-45-generic. That's why I'm reporting this bug against the linux package.

Interestingly enough, I can NOT reproduce the issue on linux-image-4.15.0-45-generic (haven't tried previous versions) when building from xterm instead of Konsole. Unfortunately, this laptop has a 4K screen and xterm isn't an option for me.

If I build redirecting stdout and stderr to different files to avoid terminal output and then watching the stdout file with tail -f, the tail command eventually finishes although the build continues and I can keep watching it by running tail again. An infinite build loop never finishes with this redirection (error not reproducible). Same results with the 2>&1 redirection to a single file.

All this looks a bit like a poltergeist, but the only thing I'm sure about is that it all started with the upgrade from 4.15.0-43 to -44 and it continues on -45.

Thank you.

[1] http://gnu-make.2324884.n4.nabble.com/Spurious-quot-write-error-quot-on-parallel-builds-td15695.html

Revision history for this message
Sebastian Urban (surban--) wrote :

I am seeing the same problem on a fully updated Ubuntu system running Linux 4.15.0-45.

Revision history for this message
Launchpad Janitor (janitor) wrote :

Status changed to 'Confirmed' because the bug affects multiple users.

Changed in linux-signed (Ubuntu):
status: New → Confirmed
Revision history for this message
Mark Owen (mowen01) wrote :

I'm running 16.04 and seeing the same problem on Linux 4.15.0-45. I can also confirm that when booting with 4.15.0-43 I no longer see the problem.

Revision history for this message
Patrick Doyle (wpdster) wrote :

I have this problem as well on 16.04LTS with kernel 4.15.0-45-generic #48.

Revision history for this message
Leo Soares (leojrfs) wrote :

affects me

Ubuntu 18.04.2 LTS: 4.15.0-45-generic

Revision history for this message
R. Diez (rdiezmail-ubuntu) wrote :

I have recently started experiencing the same problem.

Ubuntu 16.04.5 LTS

Kernel 4.15.0-45-generic #48~16.04.1-Ubuntu SMP Tue Jan 29 18:03:48 UTC 2019 x86_64 x86_64 x86_64 GNU/Linux

Revision history for this message
R. Diez (rdiezmail-ubuntu) wrote :

This problem happens with both the standard GNU Make 4.1 that comes with Ubuntu 16.04.5, and with a self-compiled GNU Make 4.2.1.

The error only happens if make is writing to stdout. If you redirect to a file like this:

make ... blah... blah... 2>&1 >"$HOME/Build.log"

Then it runs fine.

Revision history for this message
R. Diez (rdiezmail-ubuntu) wrote :

It is not GNU Make itself. If I pipe GNU Make's output to tee, then it is tee that fails:

tee: 'standard output': Resource temporarily unavailable

Revision history for this message
Leo Soares (leojrfs) wrote :

I can confirm that this does not happen via ssh.

Revision history for this message
Scott Kazimour (scottkaz) wrote :

This happens for me with 18.04, kernel 4.15.0-45-generic.

It does not happen with 4.15.0-43-generic.

Running on xterm (as opposed to terminator) it still happens, but much later in the build.

Revision history for this message
Per Gregers Bilse (bilse) wrote :

I can confirm this. I noticed after the upgrade from 4.15.0-43-generic, but at first wasn't sure if I had messed up my build; I downgraded to 43 and forgot about it until the system upgraded again yesterday. I'm now on 45, and my build fails as before, an excerpt:

/bin/sh: line 0: echo: write error: Resource temporarily unavailable
mv ../../bcmdrivers/broadcom/char/pktflow/bcm963138/fcache.o_tmp ../../bcmdrivers/broadcom/char/pktflow/bcm963138/fcache.o
/bin/sh: line 0: echo: write error: Resource temporarily unavailable
scripts/Makefile.build:258: recipe for target '/home/bilse/bcm_50203/bcmdrivers/broadcom/char/adsl/bcm963138/BcmAdslCore.o' failed
make[4]: *** [/home/bilse/bcm_50203/bcmdrivers/broadcom/char/adsl/bcm963138/BcmAdslCore.o] Error 1
make[4]: *** Waiting for unfinished jobs....
[...]
make[4]: write error: stdout
scripts/Makefile.build:423: recipe for target '../../bcmdrivers/broadcom/char/pktflow/bcm963138' failed
make[3]: *** [../../bcmdrivers/broadcom/char/pktflow/bcm963138] Error 1
scripts/Makefile.build:423: recipe for target '../../bcmdrivers/broadcom/char/adsl/bcm963138' failed
make[3]: *** [../../bcmdrivers/broadcom/char/adsl/bcm963138] Error 2
make[3]: write error: stdout
Makefile:1201: recipe for target '../../bcmdrivers' failed
make[2]: *** [../../bcmdrivers] Error 1
make[2]: *** wait: No child processes. Stop.
make[2]: write error: stdout
Makefile:476: recipe for target 'inner_kernelbuild' failed
make[1]: *** [inner_kernelbuild] Error 1
make[1]: Leaving directory '/home/bilse/bcm_50203'
Makefile:473: recipe for target 'kernelbuild' failed
make: *** [kernelbuild] Error 2
bilse@ub40:~/bcm_50203$ uname -a
Linux ub40 4.15.0-45-generic #48~16.04.1-Ubuntu SMP Tue Jan 29 18:03:48 UTC 2019 x86_64 x86_64 x86_64 GNU/Linux
bilse@ub40:~/bcm_50203$

Revision history for this message
Jburgess777 (jburgess777) wrote :

This looks to me like it might be a duplicate of: https://bugs.launchpad.net/ubuntu/+source/linux/+bug/1813873

Revision history for this message
gmaka (gmaka) wrote :

This is happening to me, started in the last 10 days or so:
$ uname -r -v
4.15.0-45-generic #48~16.04.1-Ubuntu SMP Tue Jan 29 18:03:48 UTC 2019

Revision history for this message
gmaka (gmaka) wrote :

I can confirm that moving back to 4.15.0-43-generic avoids this issue.

Revision history for this message
Éric Hoffman (ehoffman-videotron) wrote :

I have yet to see any issue (i.e. it's working fine) with 4.15.0.46 (I used xenial-proposed to upgrade).

As the rest of you, I had constant issue with this in 4.15.0-45

So yes, maybe it is related to the tty bug. This does seem to be consistent with the behavior I was seeing with current kernel. For example, I had many 'resources busy' and other output-related messages on make output.

And, doing:

  make -j8 2>&1 | tee outfile.txt

I often saw the console just stop outpointing any text (although the compilation continued, and completed, in the background).

So, Jburgess777 you may be correct about the duplicate...

Regards,
Eric

_zibuyu (zibuyujun)
Changed in linux-signed (Ubuntu):
status: Confirmed → Fix Released
Revision history for this message
_zibuyu (zibuyujun) wrote :

Sorry, operation error. The problem is not solved.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.