fgetty

Bug #252652 reported by Jeff on 2008-07-28
4
Affects Status Importance Assigned to Milestone
Ubuntu PS3 Port
Undecided
Unassigned
fgetty (Ubuntu)
Undecided
Unassigned

Bug Description

Binary package hint: fgetty

fgetty crashes on ps3:
   segmentation fault

I downloaded the latest source from http://www.fefe.de/fgetty/, and did some tests. The debug build runs fine within a shell (i.e., run directly in shell as "fgetty tty2"). However, if I config it in /etc/event.d/tty2, it crashes as above.

My ubuntu: 7.10 on ps3.

Luca Falavigna (dktrkranz) wrote :

This is fixed in Hardy.

In order to have fgetty functional in Gutsy too, you can backport dietlibc package from Hardy and rebuild fgetty against it or using packages available in Dietlibc Hackers PPA: https://launchpad.net/~dietlibc-hackers/+archive.

Changed in fgetty:
status: New → Fix Released
Jeff (jiafu-gao) wrote :

Thank Luca for the fast fix!

I have trouble get the package through apt. Here is what I did:
 1) Added the URL to apt sources.lst (at the beginning),
 2) apt-get update
 3) apt-cache show dietlibc-dev
    Maintainer: Ubuntu MOTU Developers <email address hidden>
    Original-Maintainer: Gerrit Pape <email address hidden>
   Architecture: powerpc
   Source: dietlibc
   Version: 0.30-7ubuntu1
   Recommends: dietlibc (= 0.30-7ubuntu1)
   Suggests: dietlibc-doc
   Filename: pool/universe/d/dietlibc/dietlibc-dev_0.30-7ubuntu1_powerpc.deb
This tells me apt still get the old/official package.

How to resolve this? BTW, one feature I really like to apt-get is option -url <deb url> for one time use without all the hassle such modifying sources.lst and pdate etc.

Jeff (jiafu-gao) wrote :

I managed downloaded the package manually. When compiling without any change to the Makefile, I got:
  bin-ppc64/diet gcc -m64 -D__dietlibc__ -pipe -nostdinc -Os -mpowerpc64 -Wall -W -Wchar-subscripts -Wmissing-prototypes -Wmissing-declarations -Wno-switch -Wno-unused -Wredundant-decls -o bin-ppc64/elftrunc contrib/elftrunc.c
make: *** [bin-ppc64/elftrunc] Segmentation fault

However, if I change CROSS= to CROSS=ppu-, the build succeeded.

Could not test now since I am not at home.

Luca Falavigna (dktrkranz) wrote :

You can't download it because PPA doesn't support PPC architecture. Anyway, in order for PPC arch to be available, you can compile code with -fno-stack-protector, you should have no problems then.

Jeff (jiafu-gao) wrote :

> You can't download it because PPA doesn't support PPC architecture.
I went to the deb-src URL ([0] and [1]) directly, and use wget to download the source (the .tar.gz and .diff.gz). In the makefile, ppc arch is supported (so does ppc64). Not sure what do you mean by: PPA doesn't support PPC architecture.

> Anyway, in order for PPC arch to be available, you can compile code with -fno-stack-protector, you should have no problems then.
1) what does -fno-stack-protector do? Is it required for ppc and ppc64?
2) If so, we should add this option to the makefile for ppc64 (ppc always has this option).

In any case, I add this option to fgetty (not to dietlibc), and changed CROSS to ppu- in both Makefiles. fgetty works great. Thanks!

FYI, here is memory comparison:
 before login:
            VIRT RES SHR
 getty: 1864 612 544
 fgetty: 120 28 12
 after login:
 getty: getty is gone, but login stays, with about 1200k memory
 fgetty: both fgetty and login are gone.

So basically, for each tty, fgetty saves about half mega memory before login, saves 1M after login. Ubuntu comes with 6 ttys by default. So that is 3M, 6M respectively. This is significant savings for PS3.

We should makes this as the default for PS3, unless someone seems a drawback...

[0] http://ppa.launchpad.net/dietlibc-hackers/ubuntu/pool/main/d/dietlibc/
[1] http://ppa.launchpad.net/dietlibc-hackers/ubuntu/pool/main/f/fgetty/

Jeff ha scritto:
> In the makefile, ppc arch is supported (so does ppc64). Not sure what do you mean by: PPA doesn't support PPC architecture.

PPA doesn't build packages for PPA architecture, but regular buildds do.

> In any case, I add this option to fgetty (not to dietlibc), and changed
> CROSS to ppu- in both Makefiles. fgetty works great. Thanks!

If you can test your changes more deeply, I can upload a new revision in
Intrepid including them, so everyone would have a chance to use an
improved fgetty. Please, let me know ;)

Jeff (jiafu-gao) wrote :

> If you can test your changes more deeply,

Sure. In fact, I am now using fgetty as my only getty daily on my PS3. What kind of tests you want me to do?

BTW, I figured a way to test a getty without having to rebooting everytime. Here is what I do:
  - boot ubuntu with tty1 enabled with a good getty.
  - log in and config tty2 with a test a getty (by editting /etc/event.d/tty2)
  - run sudo init -q 3 (3 is the runlevel I am using)
  - now tty2 will be started (if it works), press Alt-F2 to test it
  - continue tty3 etc to test new gettys
Not perfect, but enough for me to test several gettys without rebooting. BTW, somehow, init -q does not stop getty already started even with that tty disabled.

Luca Falavigna (dktrkranz) wrote :

> What kind of tests you want me to do?

I'm OK with regular usage without noticing issues.
If you want, you can submit changes you did to fgetty, I'll be happy to
sponsor them in Intrepid.

Arnaud Jeansen (ajeans) wrote :

Sorry, I probably shouldn't have changed the status for PS3 port, the proposal to use fgetty to save ram for the PS3 might still apply.

Changed in ubuntu-ps3-port:
status: New → Fix Released
status: Fix Released → New
Arnaud Jeansen (ajeans) wrote :

So the "normal" getty is still used to enable 6 ttys (in jaunty beta).

The setting resides in the inittabs file in sysvutils. This file is then processed by a perl script from upstart, and the getty configuration ends up in /etc/event.d/tttyX

Now, I don't think it is possible to make sysvinit use elements (fgetty) from universe.

Even if that was possible, the switch to fgetty would have to be global (all arches at once) as configuration specific inittabs files are more the exception than the norm.

Arnaud Jeansen (ajeans) wrote :

@Jeff

Does this still work for you in Jaunty for the PS3?

I replaced getty by fgetty for ttys 2,3,4,5 and 6, but they failed on boot on my PS3. As this works fine for me on a Dell laptop, I'm thinking there might have been a regression on this.

Thanks

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

Other bug subscribers