user space gnome-terminal overflows / file system

Bug #1320157 reported by Sergei Vorobyov
12
This bug affects 2 people
Affects Status Importance Assigned to Milestone
gnome-terminal (Ubuntu)
Confirmed
Undecided
Unassigned

Bug Description

I have two partitions on my system:

$ df -h
Filesystem Size Used Avail Use% Mounted on
/dev/sda3 23G 12G 11G 52% /
/dev/sda6 98G 67G 27G 72% /home

When I run a user application (on /home) which produces lots of debugging output to the terminal, it quickly (less than a day) overflows the root file system /. I think I figured the reason for that:

I selected the "unlimited" option for scrolling back in the gnome terminal.

The question is this: why does it overflow the / rather than the /home partition? May be "unlimited" should be understood as "unlimited within reasonable limits"?

I earlier reported it as

https://bugs.launchpad.net/ubuntu/+source/e2fsprogs/+bug/1319667

(Of course I am not going to use this in a production application. It popped up in a stress testing, where I modeled events which happen usually once or twice a minute at accelerated speed, of thousands of times per second)

1)
$ lsb_release -rd
Description: Ubuntu 14.04 LTS
Release: 14.04

2)
# apt-cache policy gnome-terminal
gnome-terminal:
  Installed: 3.6.2-0ubuntu1
  Candidate: 3.6.2-0ubuntu1
  Version table:
 *** 3.6.2-0ubuntu1 0
        500 http://se.archive.ubuntu.com/ubuntu/ trusty/main amd64 Packages
        100 /var/lib/dpkg/status

3) I expected it to chop off the terminal output when it grew unreasonably big, or at least not to overflow the / partition, staying in /home instead.

4) it overflew the / partition instead

ProblemType: Bug
DistroRelease: Ubuntu 14.04
Package: gnome-terminal 3.6.2-0ubuntu1
ProcVersionSignature: Ubuntu 3.13.0-24.47-generic 3.13.9
Uname: Linux 3.13.0-24-generic x86_64
ApportVersion: 2.14.1-0ubuntu3
Architecture: amd64
Date: Fri May 16 11:18:01 2014
InstallationDate: Installed on 2014-02-10 (94 days ago)
InstallationMedia: Ubuntu 13.10 "Saucy Salamander" - Release amd64 (20131016.1)
SourcePackage: gnome-terminal
UpgradeStatus: Upgraded to trusty on 2014-04-22 (24 days ago)

Revision history for this message
Sergei Vorobyov (svorobyov) wrote :
Revision history for this message
Sergei Vorobyov (svorobyov) wrote :

the reason I think this is the "unlimited" gnome-terminal window is this:

when I run the same application with

./app > /dev/null

the / partition does not overflow

Revision history for this message
Egmont Koblinger (egmont-gmail) wrote :

> The question is this: why does it overflow the / rather than the /home partition?

gnome-terminal stores the scrollback content in a temporary file, opened at the standard location which is /tmp by default, overridable with the standard TMPDIR environment variable.

> May be "unlimited" should be understood as "unlimited within reasonable limits"?

g-t tries to do what you ask from this. If you ask this to remember everything, it tries to store everything. What do you mean by "reasonable limits"? E.g. 1 million lines? Feel free to set this in gnome-terminal's preferences :)

Revision history for this message
Sergei Vorobyov (svorobyov) wrote : Re: [Bug 1320157] Re: user space gnome-terminal overflows / file system
Download full text (3.7 KiB)

> gnome-terminal stores the scrollback content in a temporary file, opened
> at the standard location which is /tmp by default, overridable with the
> standard TMPDIR environment variable

this default/standard location /tmp is certainly inadmissible, since it's
an obvious welcome hackers breach. Users should be restricted to use their
own quotas, even for the g-t. If there are thousands applications being
regularly used on a system which behave similarly, should all of them be
audited and reconfigured against such gotchas?

On Mon, May 19, 2014 at 10:39 PM, Egmont Koblinger <email address hidden> wrote:

> > The question is this: why does it overflow the / rather than the /home
> partition?
>
> gnome-terminal stores the scrollback content in a temporary file, opened
> at the standard location which is /tmp by default, overridable with the
> standard TMPDIR environment variable.
>
> > May be "unlimited" should be understood as "unlimited within
> reasonable limits"?
>
> g-t tries to do what you ask from this. If you ask this to remember
> everything, it tries to store everything. What do you mean by
> "reasonable limits"? E.g. 1 million lines? Feel free to set this in
> gnome-terminal's preferences :)
>
> --
> You received this bug notification because you are subscribed to the bug
> report.
> https://bugs.launchpad.net/bugs/1320157
>
> Title:
> user space gnome-terminal overflows / file system
>
> Status in “gnome-terminal” package in Ubuntu:
> New
>
> Bug description:
> I have two partitions on my system:
>
> $ df -h
> Filesystem Size Used Avail Use% Mounted on
> /dev/sda3 23G 12G 11G 52% /
> /dev/sda6 98G 67G 27G 72% /home
>
> When I run a user application (on /home) which produces lots of
> debugging output to the terminal, it quickly (less than a day)
> overflows the root file system /. I think I figured the reason for
> that:
>
> I selected the "unlimited" option for scrolling back in the gnome
> terminal.
>
> The question is this: why does it overflow the / rather than the /home
> partition? May be "unlimited" should be understood as "unlimited
> within reasonable limits"?
>
> I earlier reported it as
>
> https://bugs.launchpad.net/ubuntu/+source/e2fsprogs/+bug/1319667
>
> (Of course I am not going to use this in a production application. It
> popped up in a stress testing, where I modeled events which happen
> usually once or twice a minute at accelerated speed, of thousands of
> times per second)
>
> 1)
> $ lsb_release -rd
> Description: Ubuntu 14.04 LTS
> Release: 14.04
>
> 2)
> # apt-cache policy gnome-terminal
> gnome-terminal:
> Installed: 3.6.2-0ubuntu1
> Candidate: 3.6.2-0ubuntu1
> Version table:
> *** 3.6.2-0ubuntu1 0
> 500 http://se.archive.ubuntu.com/ubuntu/ trusty/main amd64
> Packages
> 100 /var/lib/dpkg/status
>
> 3) I expected it to chop off the terminal output when it grew
> unreasonably big, or at least not to overflow the / partition, staying
> in /home instead.
>
>
> 4) it overflew the / partition instead
>
> ProblemType: Bug
> DistroRelease: Ubuntu 14.04
> Package: gnome-terminal 3.6.2-0ubuntu1
> ProcVers...

Read more...

Revision history for this message
Egmont Koblinger (egmont-gmail) wrote :

> this default/standard location /tmp is certainly inadmissible

If it is, then I guess you're arguing that /tmp shouldn't exist at all. It exists, it has its purpose, and g-t uses that for that purpose.

If /tmp is inadmissible, what would be a better location? The user's home, which potentially lies on a networking filesystem and hence can be magnitudes slower than desired?

> since it's an obvious welcome hackers breach.

What do you mean by this? There are ways to safely open a file there (i.e. without race condition), and g-t does that.

> Users should be restricted to use their own quotas, even for the g-t.

By default, no user quotas are set up for /home or /tmp. Feel free to set up for both (if they are on separate partition – if they are on the same partition then it's one common quota that you need).

> If there are thousands applications being regularly used on a system which behave similarly, should all of them be audited and reconfigured against such gotchas?

Ideally, all of them should respect TMPDIR. If you want your temporary files to be opened in your home, set TMPDIR accordingly and you're done, but please don't claim it should be the default.

Gnome-terminal needs a temporary file to store your unlimited scrollback. It opens it exactly at the standard location with can be altered via standard means. Sorry, I don't get you, what's your problem here? Are you arguing that the standard Unix file system layout is broken?

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

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

Changed in gnome-terminal (Ubuntu):
status: New → Confirmed
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.