Bug 5824 (int-144423)

Summary: Maximum number of pseudo terminals too low (4)
Product: [Maemo Official Applications] Utilities Reporter: Lucas Maneos <maemo>
Component: X TerminalAssignee: unassigned <nobody>
Status: RESOLVED FIXED QA Contact: osso-xterm-bugs
Severity: normal    
Priority: Low CC: andre_klapper, dufkaf, jknutar, marius, qwercik, trippin1
Version: 5.0/(2.2009.51-1)Keywords: easyfix
Target Milestone: 5.0/(10.2010.19-1)   
Hardware: N900   
OS: Maemo   

Description Lucas Maneos (reporter) 2009-10-26 23:27:24 UTC
SOFTWARE VERSION:
1.2009.41-10

STEPS TO REPRODUCE THE PROBLEM:
1. Start 4 osso-xterms and/or inbound ssh sessions.
2. Try to start another, or update some packages with the application manager
etc.

EXPECTED OUTCOME:
System able to cope with reasonable requests for ptys.

ACTUAL OUTCOME:
Only 4 ptys available.

REPRODUCIBILITY:
Always

EXTRA SOFTWARE INSTALLED:

OTHER COMMENTS:
Problem package: mini-rc, file /etc/init.d/rcS:
"echo 4 > /proc/sys/kernel/pty/max"

ISTR a similar problem back in the 770 days, but I can't find the relevant bug.
 In Diablo /proc/sys/kernel/pty/max is set to 16 which is a reasonable value.
Comment 1 Andre Klapper maemo.org 2009-10-27 18:53:28 UTC
Question in int-99726 is "I don't know the ramifications such a change might
have".
Error should still be "Unspecified error" when trying to open the 5th one.
Comment 2 Lucas Maneos (reporter) 2009-10-27 21:19:37 UTC
(In reply to comment #1)
> Question in int-99726 is "I don't know the ramifications such a change might
> have".

The only ramification is the kernel using a few more bytes of RAM, and there's
no other change required (the corresponding character special device files are
created automagically in the devfs filesystem). Note that 4 is not the kernel
default, but just an arbitrary value applied by the init script.  FWIW with the
out-of-the-box 16 ptys in Diablo I never hit this problem.

See also the previous fix:
<http://lists.maemo.org/pipermail/maemo-commits/2007-November/009969.html>
which mentions NB#71003.
Comment 3 Faheem Pervez maemo.org 2009-11-02 18:57:12 UTC
This is definitely a regression from the Diablo days. As pointed out, Diablo's
default is 16. I doubt a device that, in addition to having the
Diablo-running-devices' 256MB of RAM, has 768MB of swap cannot handle some more
PTYs. 

This bug also affects the Application Manager's ability to install stuff when
having 4 Terminals open.
Comment 4 Marius Gedminas 2009-11-05 18:24:23 UTC
Workaround:

  sudo gainroot
  echo -n 16 > /proc/sys/kernel/pty/max

the -n is important.
Comment 5 Faheem Pervez maemo.org 2009-11-05 18:42:13 UTC
The workaround is not needed; editing /etc/init.d/rcS as mentioned in #1 makes
the change permanent. The point of this bug is getting Nokia to revert this
idiotic change which has caused a regression.
Comment 6 Jan Knutar 2009-11-30 09:08:04 UTC
Still present in 1.2009.42-11
Workaround/fix still works.
Comment 7 Andre Klapper maemo.org 2009-12-31 15:51:47 UTC
This has been fixed in package
mini-rc 0.2.67+0m5
which is part of the internal build version
2009.52-9
(Note: 2009 is the year, and the number after is the week.)

A future public update released with the year/week later than this internal
build version will include the fix. (This is not always already the next public
update.)
Please verify that this new version fixes the bug by marking this bug report as
VERIFIED after the public update has been released and if you have some time.


To answer popular followup questions:
 * Nokia does not announce release dates of public updates in advance.
 * There is currently no access to these internal, non-public build versions.
   A Brainstorm proposal to change this exists at
http://maemo.org/community/brainstorm/view/undelayed_bugfix_releases_for_nokia_open_source_packages-002/
Comment 8 Andre Klapper maemo.org 2010-01-04 20:59:39 UTC
*** Bug 7638 has been marked as a duplicate of this bug. ***
Comment 9 Frantisek Dufka maemo.org 2010-02-18 11:02:23 UTC
(In reply to comment #7)
> This has been fixed in package
> mini-rc 0.2.67+0m5
> which is part of the internal build version
> 2009.52-9

I have updated to 3.2010.02-8 (via SSU) and /proc/sys/kernel/pty/max is still
set to 4.

dpkg -l mini-rc prints 0.2.66+0m5 so this fix is not part of 3.2010.02-8
Comment 10 Andre Klapper maemo.org 2010-03-15 20:56:59 UTC
Setting explicit PR1.2 milestone (so it's clearer in which public release the
fix will be available to users).

Sorry for the bugmail noise (you can filter on this message).