standard output: Resource temporarily unavailable

Bug #151440 reported by Daniel Gonzalez
4
Affects Status Importance Assigned to Milestone
linux (Ubuntu)
Expired
Undecided
Unassigned

Bug Description

I am running Gutsy, upgraded on the 9 October 2007.
The current kernel is:
Linux version 2.6.22-14-generic (buildd@palmer) (gcc version 4.1.3 20070929 (prerelease) (Ubuntu 4.1.2-16ubuntu2)) #1 SMP Tue Oct 9 09:51:52 GMT 2007

I have an amd x2, but I am running the 32 bit OS (or so I think).

Currently I have KSysguard, Firefox, emacs and Rhythmbox running.

I am developing using tcl scripting. I run my tcl script from an xterm, with output teed to a log file in the form:

./tcl_script | tee log_file

The script produces a lot of output, quite fast. Around 50% of the times the script stops and I get the message:
"tee: write error"

Sometimes I see also: "tee: standard output: Resource temporarily unavailable"

I get the following message

The error seems to disappear if I redirect the output of tee to a file in the way:

./tcl_script | tee log_file > file

This same script is working fine in other machines (Solaris). I do not attach the script since it is actually a very big test suite.

more information

 lspci
00:00.0 RAM memory: nVidia Corporation MCP61 Memory Controller (rev a1)
00:01.0 ISA bridge: nVidia Corporation MCP61 LPC Bridge (rev a2)
00:01.1 SMBus: nVidia Corporation MCP61 SMBus (rev a2)
00:01.2 RAM memory: nVidia Corporation MCP61 Memory Controller (rev a2)
00:02.0 USB Controller: nVidia Corporation MCP61 USB Controller (rev a2)
00:02.1 USB Controller: nVidia Corporation MCP61 USB Controller (rev a2)
00:04.0 PCI bridge: nVidia Corporation MCP61 PCI bridge (rev a1)
00:05.0 Audio device: nVidia Corporation MCP61 High Definition Audio (rev a2)
00:06.0 IDE interface: nVidia Corporation MCP61 IDE (rev a2)
00:07.0 Bridge: nVidia Corporation MCP61 Ethernet (rev a2)
00:08.0 IDE interface: nVidia Corporation MCP61 SATA Controller (rev a2)
00:08.1 IDE interface: nVidia Corporation MCP61 SATA Controller (rev a2)
00:09.0 PCI bridge: nVidia Corporation MCP61 PCI Express bridge (rev a2)
00:0b.0 PCI bridge: nVidia Corporation MCP61 PCI Express bridge (rev a2)
00:0c.0 PCI bridge: nVidia Corporation MCP61 PCI Express bridge (rev a2)
00:0d.0 VGA compatible controller: nVidia Corporation GeForce 6100 nForce 430 (rev a2)
00:18.0 Host bridge: Advanced Micro Devices [AMD] K8 [Athlon64/Opteron] HyperTransport Technology Configuration
00:18.1 Host bridge: Advanced Micro Devices [AMD] K8 [Athlon64/Opteron] Address Map
00:18.2 Host bridge: Advanced Micro Devices [AMD] K8 [Athlon64/Opteron] DRAM Controller
00:18.3 Host bridge: Advanced Micro Devices [AMD] K8 [Athlon64/Opteron] Miscellaneous Control

lsmod

Module Size Used by
nls_iso8859_1 5120 1
nls_cp437 6784 1
vfat 14080 1
fat 54300 1 vfat
af_packet 24840 2
rfcomm 42136 2
l2cap 26240 11 rfcomm
bluetooth 57060 4 rfcomm,l2cap
sr_mod 17828 0
ipv6 273892 14
powernow_k8 16960 1
cpufreq_ondemand 9612 1
cpufreq_powersave 2688 0
cpufreq_conservative 8072 0
cpufreq_userspace 5280 0
cpufreq_stats 7232 0
freq_table 5792 3 powernow_k8,cpufreq_ondemand,cpufreq_stats
sbs 19592 0
dock 10656 0
ac 6148 0
video 18060 0
button 8976 0
container 5504 0
battery 11012 0
w83627ehf 19984 0
i2c_isa 5248 1 w83627ehf
lp 12580 0
usb_storage 73024 3
snd_hda_intel 263712 4
snd_pcm_oss 44672 0
snd_mixer_oss 17664 1 snd_pcm_oss
snd_pcm 80388 3 snd_hda_intel,snd_pcm_oss
snd_seq_dummy 4740 0
snd_seq_oss 33152 0
snd_seq_midi 9600 0
serio_raw 8068 0
ide_cd 32672 0
cdrom 37536 2 sr_mod,ide_cd
snd_rawmidi 25728 1 snd_seq_midi
psmouse 39952 0
snd_seq_midi_event 8448 2 snd_seq_oss,snd_seq_midi
parport_pc 37412 1
parport 37448 2 lp,parport_pc
nvidia 6221648 34
k8temp 6656 0
pcspkr 4224 0
snd_seq 53232 6 snd_seq_dummy,snd_seq_oss,snd_seq_midi,snd_seq_midi_event
agpgart 35016 1 nvidia
snd_timer 24324 3 snd_pcm,snd_seq
snd_seq_device 9228 5 snd_seq_dummy,snd_seq_oss,snd_seq_midi,snd_rawmidi,snd_seq
snd 54660 15 snd_hda_intel,snd_pcm_oss,snd_mixer_oss,snd_pcm,snd_seq_oss,snd_rawmidi,snd_seq,snd_timer,snd_seq_device
i2c_nforce2 7040 0
i2c_core 26112 4 w83627ehf,i2c_isa,nvidia,i2c_nforce2
shpchp 34580 0
pci_hotplug 32704 1 shpchp
soundcore 8800 1 snd
snd_page_alloc 11400 2 snd_hda_intel,snd_pcm
evdev 11136 3
ext3 133896 3
jbd 60456 1 ext3
mbcache 9732 1 ext3
sg 36764 0
sd_mod 30336 9
libusual 18448 1 usb_storage
sata_nv 20612 2
amd74xx 15260 0 [permanent]
ide_core 116804 3 usb_storage,ide_cd,amd74xx
ata_generic 8452 0
libata 125168 2 sata_nv,ata_generic
scsi_mod 147084 5 sr_mod,usb_storage,sg,sd_mod,libata
ohci_hcd 22916 0
forcedeth 51592 0
ehci_hcd 36108 0
usbcore 138248 5 usb_storage,libusual,ohci_hcd,ehci_hcd
thermal 14344 1
processor 32072 2 powernow_k8,thermal
fan 5764 1
fuse 47124 1
apparmor 40728 0
commoncap 8320 1 apparmor

Revision history for this message
shaped dither (shaped-dither) wrote :

Here's another report of this bug (from a blog-type post):

http://landley.net/notes.html#03-07-2008

Revision history for this message
Michael Nagel (nailor) wrote :

is this still broken with hardy?

Revision history for this message
Michael Nagel (nailor) wrote :

copied text from mentioned blog:

July 3, 2008

And now I'm remembering why replacing the command line utilities out of Ubuntu is so vital to getting a reliable build:

    tee: standard output: Resource temporarily unavailable
    tee: write error

The forkbomb script pipes the output of the build through "tee". If the xterm it's writing to ever gets scheduled slowly enough for the output pipe to fill up and cause a short write, tee _exits_. The busybox version of tee IS NOT THAT STUPID.

Grrrr.

Also, User Mode Linux has developed strange new bugs circa 2.6.25, and if you run it from a shell script and it gets a kernel panic, it sends a kill signal to every process in it session, which takes down the shell script running it. Meaning without toybox's oneit (to shut it down cleanly), I have to run UML under setsid (and then reset the tty afterwards) or else the shell script aborts when UML exits. (Even if I run it in a subshell.)

Implemented tee in toybox and added that to the start of my $PATH while doing the RECORD_COMMANDS forkbomb. (Yeah, I could have just used the busybox version, but it was an excuse to add a small simple command to toybox. I still need to add a test suite for tee.)

Revision history for this message
Daniel Gonzalez (gonvaled) wrote : Re: [Bug 151440] Re: standard output: Resource temporarily unavailable

Hi Michael,

Unfortunately I am not able to reproduce the situation, since I am not
yet running Hardy.

BR,
Daniel

On Mon, Aug 4, 2008 at 11:06 PM, Michael Nagel <email address hidden> wrote:
> copied text from mentioned blog:
>
> July 3, 2008
>
> And now I'm remembering why replacing the command line utilities out of
> Ubuntu is so vital to getting a reliable build:
>
> tee: standard output: Resource temporarily unavailable
> tee: write error
>
> The forkbomb script pipes the output of the build through "tee". If the
> xterm it's writing to ever gets scheduled slowly enough for the output
> pipe to fill up and cause a short write, tee _exits_. The busybox
> version of tee IS NOT THAT STUPID.
>
> Grrrr.
>
> Also, User Mode Linux has developed strange new bugs circa 2.6.25, and
> if you run it from a shell script and it gets a kernel panic, it sends a
> kill signal to every process in it session, which takes down the shell
> script running it. Meaning without toybox's oneit (to shut it down
> cleanly), I have to run UML under setsid (and then reset the tty
> afterwards) or else the shell script aborts when UML exits. (Even if I
> run it in a subshell.)
>
> Implemented tee in toybox and added that to the start of my $PATH while
> doing the RECORD_COMMANDS forkbomb. (Yeah, I could have just used the
> busybox version, but it was an excuse to add a small simple command to
> toybox. I still need to add a test suite for tee.)
>
>
> ** Changed in: linux (Ubuntu)
> Sourcepackagename: None => linux
>
> --
> standard output: Resource temporarily unavailable
> https://bugs.launchpad.net/bugs/151440
> You received this bug notification because you are a direct subscriber
> of the bug.
>

Revision history for this message
Leann Ogasawara (leannogasawara) wrote :

Hi Daniel,

If an when you are able to test Hardy, please let us know your results. Thanks.

Changed in linux:
status: New → Incomplete
Revision history for this message
Leann Ogasawara (leannogasawara) wrote :

The Ubuntu Kernel Team is planning to move to the 2.6.27 kernel for the upcoming Intrepid Ibex 8.10 release. As a result, the kernel team would appreciate it if you could please test this newer 2.6.27 Ubuntu kernel. There are one of two ways you should be able to test:

1) If you are comfortable installing packages on your own, the linux-image-2.6.27-* package is currently available for you to install and test.

--or--

2) The upcoming Alpha5 for Intrepid Ibex 8.10 will contain this newer 2.6.27 Ubuntu kernel. Alpha5 is set to be released Thursday Sept 4. Please watch http://www.ubuntu.com/testing for Alpha5 to be announced. You should then be able to test via a LiveCD.

Please let us know immediately if this newer 2.6.27 kernel resolves the bug reported here or if the issue remains. More importantly, please open a new bug report for each new bug/regression introduced by the 2.6.27 kernel and tag the bug report with 'linux-2.6.27'. Also, please specifically note if the issue does or does not appear in the 2.6.26 kernel. Thanks again, we really appreicate your help and feedback.

Revision history for this message
Michael Nagel (nailor) wrote :

We are closing this bug report because it lacks the information we need to investigate the problem, as described in the previous comments. Please reopen it if you can give us the missing information, and don't hesitate to submit bug reports in the future. To reopen the bug report you can click on the current status, under the Status column, and change the Status back to "New". Thanks again!

Changed in linux:
status: Incomplete → Invalid
prasanth (ragaprasanth)
Changed in linux (Ubuntu):
status: Invalid → New
Revision history for this message
Ubuntu Kernel Bot (ubuntu-kernel-bot) wrote : Missing required logs.

This bug is missing log files that will aid in diagnosing the problem. While running an Ubuntu kernel (not a mainline or third-party kernel) please enter the following command in a terminal window:

apport-collect 151440

and then change the status of the bug to 'Confirmed'.

If, due to the nature of the issue you have encountered, you are unable to run this command, please add a comment stating that fact and change the bug status to 'Confirmed'.

This change has been made by an automated script, maintained by the Ubuntu Kernel Team.

Changed in linux (Ubuntu):
status: New → Incomplete
tags: added: gutsy
Revision history for this message
prasanth (ragaprasanth) wrote :

Hi,

I am also experiencing this issues recently in my machine 4.15.0-45-generic #48~16.04.1-Ubuntu
which doesn't yield any log rather than

"tee: 'standard output': Resource temporarily unavailable"

Moreover, I haven't seen this before, I used to get my work logs previously too. but this is strange which occurs recently in the "tee"

Thanks,
Prasanth

Revision history for this message
yonglong liu (tony1009) wrote :

Hi,
     I met this issue today, and my machine info is
     Linux yonglong 4.4.0-142-generic #168~14.04.1-Ubuntu SMP Sat Jan 19 11:26:28 UTC 2019 x86_64 x86_64 x86_64 GNU/Linux
     Every time the log is "tee: 'standard output': Resource temporarily unavailable".
      tee (GNU coreutils) 8.21 ) & tee (GNU coreutils) 8.21 ) both have this issue.

    I installed "TeamViewer 13" & "YouCompleteMe" for vim a few days ago. And all libs have updated by "software & update" .
   who can help fix this issue ?

Revision history for this message
Kelledin (kelledin-3) wrote :

Also encountering this issue with "tail -f <log>", for a log file produced by a script with a LOT of rapid output.

Similar issues happen with a simple bash builtin like "read -s -t 1 -N 1 <var>": it periodically gets in a state where it immediately reports "read: 0: read failed: Resource temporarily unavailable". I initially noticed this with a log watcher script that periodically (every 1s) gathers the tail-end of a log file (same one I'm monitoring with "tail -f" above), then checks for single-character user commands between log polling cycles. I verified that stdin was NOT left in a non-blocking state and managed to reproduce it without even watching the log file or doing anything else (just a tight loop with the above "read" command). This happens a lot more frequently than "tail -f" getting interrupted above, and the event tends to repeat in bursts.

This has so far happened under MATE Terminal and konsole, with or without byobu. It does not happen with other distros I've tried. Nothing amiss appears in the system/kernel logs around this time either. Load average on this system commonly reaches 10-16 with almost no swap usage (it's an 8-core+8-thread machine doing various CI builds). I have yet to try it on a text-only TTY, but I suppose I could try that next.

System info: Ubuntu 18.04.2
Linux motsognir 4.15.0-45-generic #48-Ubuntu SMP Tue Jan 29 16:28:13 UTC 2019 x86_64 x86_64 x86_64 GNU/Linux

Revision history for this message
Kelledin (kelledin-3) wrote :

Further info:

This happens even if I start my "tail -f" process or "read -t 1" loop within a chroot environment running a completely different distro, under an Ubuntu 18.04 terminal. The distro in question (really a custom from-scratch distro) has never had this problem when running as the real root distro.

So the root cause of this problem is likely something low-level: either the terminal emulator or the system kernel.

Revision history for this message
Kelledin (kelledin-3) wrote :

And...this problem goes away if I run the same "tail -f" or "read -t 1" loop on a text-only TTY, or under a "screen" session within a terminal emulator.

So it's probably a problem with the terminal emulators (MATE terminal and konsole). I'm guessing screen is able to insulate the TTY environment from the GUI emulator enough to sidestep this problem.

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

[Expired for linux (Ubuntu) because there has been no activity for 60 days.]

Changed in linux (Ubuntu):
status: Incomplete → Expired
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.