gnome-terminal writes to /tmp on every line of output

Bug #865082 reported by Roman Yepishev
10
This bug affects 2 people
Affects Status Importance Assigned to Milestone
Gnome Virtual Terminal Emulator
Confirmed
Medium
vte (Ubuntu)
Triaged
Medium
Unassigned

Bug Description

STR:

1. Start xterm
2. Run "python -mpyinotify /tmp"
3. Start gnome-terminal.
4. Run some command like ls

Actual Results:

Observe a ton of IN_MODIFY lines such as
<Event dir=False mask=0x2 maskname=IN_MODIFY name=vteD7DX2V path=/tmp pathname=/tmp/vteD7DX2V wd=1 >
<Event dir=False mask=0x2 maskname=IN_MODIFY name=vte1XDX2V path=/tmp pathname=/tmp/vte1XDX2V wd=1 >
<Event dir=False mask=0x2 maskname=IN_MODIFY name=vte72DX2V path=/tmp pathname=/tmp/vte72DX2V wd=1 >
<Event dir=False mask=0x2 maskname=IN_MODIFY name=vteD7DX2V path=/tmp pathname=/tmp/vteD7DX2V wd=1 >
<Event dir=False mask=0x2 maskname=IN_MODIFY name=vte1XDX2V path=/tmp pathname=/tmp/vte1XDX2V wd=1 >
<Event dir=False mask=0x2 maskname=IN_MODIFY name=vteD7DX2V path=/tmp pathname=/tmp/vteD7DX2V wd=1 >
<Event dir=False mask=0x2 maskname=IN_MODIFY name=vte1XDX2V path=/tmp pathname=/tmp/vte1XDX2V wd=1 >
<Event dir=False mask=0x2 maskname=IN_MODIFY name=vte72DX2V path=/tmp pathname=/tmp/vte72DX2V wd=1 >
<Event dir=False mask=0x2 maskname=IN_MODIFY name=vteD7DX2V path=/tmp pathname=/tmp/vteD7DX2V wd=1 >
<Event dir=False mask=0x2 maskname=IN_MODIFY name=vte1XDX2V path=/tmp pathname=/tmp/vte1XDX2V wd=1 >

Or, when idle -
<Event dir=False mask=0x1 maskname=IN_ACCESS name=vteGFOF2V path=/tmp pathname=/tmp/vteGFOF2V wd=1 >
<Event dir=False mask=0x1 maskname=IN_ACCESS name=vteI7NF2V path=/tmp pathname=/tmp/vteI7NF2V wd=1 >
<Event dir=False mask=0x1 maskname=IN_ACCESS name=vteVCOF2V path=/tmp pathname=/tmp/vteVCOF2V wd=1 >
<Event dir=False mask=0x1 maskname=IN_ACCESS name=vteGFOF2V path=/tmp pathname=/tmp/vteGFOF2V wd=1 >
<Event dir=False mask=0x1 maskname=IN_ACCESS name=vteI7NF2V path=/tmp pathname=/tmp/vteI7NF2V wd=1 >
<Event dir=False mask=0x1 maskname=IN_ACCESS name=vteVCOF2V path=/tmp pathname=/tmp/vteVCOF2V wd=1 >
<Event dir=False mask=0x1 maskname=IN_ACCESS name=vteGFOF2V path=/tmp pathname=/tmp/vteGFOF2V wd=1 >
<Event dir=False mask=0x1 maskname=IN_ACCESS name=vteI7NF2V path=/tmp pathname=/tmp/vteI7NF2V wd=1 >
<Event dir=False mask=0x1 maskname=IN_ACCESS name=vteVCOF2V path=/tmp pathname=/tmp/vteVCOF2V wd=1 >
<Event dir=False mask=0x1 maskname=IN_ACCESS name=vteGFOF2V path=/tmp pathname=/tmp/vteGFOF2V wd=1 >

This looks like vte code storing something. According to this question - http://ubuntuforums.org/showthread.php?t=1830432,
"Sometimes vte creates temporary files which contains a copy of the whole scrollback buffer, [...]".

Expected results:
Nothing is being written to this dir at this rate by gnome-terminal.

ProblemType: Bug
DistroRelease: Ubuntu 11.10
Package: gnome-terminal 3.0.1-0ubuntu3
ProcVersionSignature: Ubuntu 3.0.0-12.19-generic 3.0.4
Uname: Linux 3.0.0-12-generic x86_64
NonfreeKernelModules: nvidia
ApportVersion: 1.23-0ubuntu2
Architecture: amd64
Date: Mon Oct 3 09:55:29 2011
EcryptfsInUse: Yes
InstallationMedia: Ubuntu 10.04 LTS "Lucid Lynx" - Release amd64 (20100429)
SourcePackage: gnome-terminal
UpgradeStatus: Upgraded to oneiric on 2011-08-30 (33 days ago)

Revision history for this message
Roman Yepishev (rye) wrote :
description: updated
Revision history for this message
Roman Yepishev (rye) wrote :

src/vtestream-file.h:

static inline void
_vte_file_stream_ensure_fd0 (VteFileStream *stream)
{
        gint fd;
        gchar *file_name;
        if (G_LIKELY (stream->fd[0]))
                return;

        fd = g_file_open_tmp ("vteXXXXXX", &file_name, NULL);
        if (fd != -1) {
                unlink (file_name);
                g_free (file_name);
        }

        stream->fd[0] = dup (fd); /* we do the dup to make sure ->fd[0] is not 0 */

        close (fd);
}

affects: gnome-terminal (Ubuntu) → vte (Ubuntu)
Revision history for this message
Pedro Villavicencio (pedro) wrote :

this looks like bug https://bugzilla.gnome.org/show_bug.cgi?id=631685 ; could you please share your thoughts there as well? Thanks.

Changed in vte (Ubuntu):
importance: Undecided → Medium
status: New → Triaged
Changed in vte:
importance: Unknown → Medium
status: Unknown → New
Revision history for this message
Egmont Koblinger (egmont-gmail) wrote :

Fyi: vte-0.34.9 will add caching (https://git.gnome.org/browse/vte/commit/?h=vte-0-34&id=b959b86). The amount of data written is still the same, but batched up in larger chunks.

Changed in vte:
status: New → Confirmed
Revision history for this message
Bryce Nesbitt (bryce2) wrote :

Probably related, here's a small sample as captured by the new "fatrace --filter W" utility on Ubuntu 14.04 LTS:

09:35:01.577176 gnome-terminal(8923): RW /tmp/#132358 (deleted)
09:35:01.588323 gnome-terminal(8923): W /tmp/#132359 (deleted)
09:35:01.588323 gnome-terminal(8923): RW /tmp/#132359 (deleted)
09:35:01.588323 gnome-terminal(8923): W /tmp/#132358 (deleted)
09:35:01.588323 gnome-terminal(8923): RW /tmp/#132358 (deleted)
09:35:01.604411 gnome-terminal(8923): W /tmp/#132359 (deleted)
09:35:01.604411 gnome-terminal(8923): RW /tmp/#132359 (deleted)
09:35:01.604411 gnome-terminal(8923): W /tmp/#132358 (deleted)
09:35:01.604411 gnome-terminal(8923): RW /tmp/#132358 (deleted)
09:35:01.606859 bash(12220): CW /home/bnesbitt/.bash_history
09:35:01.606859 bash(12220): RCWO /home/bnesbitt/.bash_history
09:35:01.610768 gnome-terminal(8923): CW /tmp/#132355 (deleted)
09:35:01.610768 gnome-terminal(8923): CW /tmp/#132355 (deleted)
09:35:01.610856 gnome-terminal(8923): CW /tmp/#132356 (deleted)
09:35:01.610856 gnome-terminal(8923): CW /tmp/#132356 (deleted)
09:35:01.636285 gnome-terminal(8923): W /tmp/#132359 (deleted)
09:35:01.636285 gnome-terminal(8923): RW /tmp/#132359 (deleted)
09:35:01.636285 gnome-terminal(8923): W /tmp/#132358 (deleted)
09:35:01.636285 gnome-terminal(8923): RW /tmp/#132358 (deleted)
09:35:01.666355 gnome-terminal(8923): W /tmp/#132359 (deleted)
09:35:01.666355 gnome-terminal(8923): RW /tmp/#132359 (deleted)
09:35:01.666355 gnome-terminal(8923): W /tmp/#132358 (deleted)
09:35:01.666355 gnome-terminal(8923): RW /tmp/#132358 (deleted)
09:35:01.677547 gnome-terminal(8923): W /tmp/#132359 (deleted)
09:35:01.677547 gnome-terminal(8923): RW /tmp/#132359 (deleted)
09:35:01.677547 gnome-terminal(8923): W /tmp/#132358 (deleted)
09:35:01.677547 gnome-terminal(8923): RW /tmp/#132358 (deleted)

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.