Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
GCC emerge consistantly fails on Efika [SOLVED]
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Gentoo on PPC
View previous topic :: View next topic  
Author Message
Napalm Llama
Guru
Guru


Joined: 04 Jun 2005
Posts: 520
Location: Swansea, UK

PostPosted: Fri May 18, 2007 5:38 pm    Post subject: GCC emerge consistantly fails on Efika [SOLVED] Reply with quote

OK, I'm now officially at a loose end for what to do. Whenever I try to compile GCC on my new Efika, (which has its root partition on NFS and its swap file on its root partition), the system freezes halfway through. The terminals become unresponsive (both the original serial terminal and also any SSH sessions I've got open). Analysis of the network shows that I'm firing SSH packets at it and it's just ignoring them. But the system can't be completely dead, because it still returns pings.

This isn't just one version of GCC. I've tried 4.1.1, 4.1.1-r3 and 3.4.6-r2 with uclibc, and also 3.4.6-r2 with glibc and a hardened profile. They all exhibit the same behaviour.

The only thing I can think of is that it's a problem with the swap-on-NFS, which is set up like this:
Code:
losetup /dev/loop0 /swap
swapon /dev/loop0

...because occasionally, I just get an ebuild error and the system survives, and also occasionally I forget to set up the swap before I start the build. I'm thinking perhaps these two things correlate. I'll have to do some more investigation.

Do you think the swap thing could be to blame? I don't have a 2.5" hard disk for the machine and I don't want to splash out on one until I'm sure I'll have a system that'll work, so I can't find out for certain - kind of a catch-22, no?
_________________
splig: amd64; nForce3; sata; GeForce 6600gt agp
muttley: EFIKA 5200B - PPC SoC :)

Registered Linux User #381314
# killall humans


Last edited by Napalm Llama on Thu May 24, 2007 11:05 am; edited 1 time in total
Back to top
View user's profile Send private message
nixnut
Bodhisattva
Bodhisattva


Joined: 09 Apr 2004
Posts: 10974
Location: the dutch mountains

PostPosted: Fri May 18, 2007 5:40 pm    Post subject: Reply with quote

The efika has only 128MB ram, so you have to make sure you have enough swap space. Swap over nfs is possible afaik, but not all that easy and it's very very slow. See here for some information
_________________
Please add [solved] to the initial post's subject line if you feel your problem is resolved. Help answer the unanswered

talk is cheap. supply exceeds demand
Back to top
View user's profile Send private message
Napalm Llama
Guru
Guru


Joined: 04 Jun 2005
Posts: 520
Location: Swansea, UK

PostPosted: Fri May 18, 2007 6:03 pm    Post subject: Reply with quote

Yup, that's the HOWTO I followed. /swap is a 1Gb file that ought to provide the machine with all its virtual memory needs, but my concern is that having it on an NFS filesystem causes system instability in addition to horrible, horrible slowness.

Does that sound remotely feasible to you?

At the moment I'm deliberately running emerge gcc without the swap enabled, to see if I just get an ebuild error instead of a crash.

[edit 2007.05.19 1055UTC :]
OK, yesterday I deactivated the swap and ran emerge gcc twice. Both times I got an ebulid failure, rather than a crash. The second time, I also ran the following loop in another SSH login:
Code:
while [ 1 ]
do
  if [ ! -z "`ps aux | grep emerge | grep -v grep`" ]
  then
    date
    free
    echo
  fi
  sleep 2
done

This prints the current time, and how much free memory is available, every 2 seconds as long as emerge is running.

This is a typical free, just before the ebuild failed and the loop stopped printing anything:
Code:
             total       used       free     shared    buffers     cached
Mem:        126476     125008       1468          0          0       1628
-/+ buffers/cache:     123380       3096
Swap:            0          0          0

Not much memory left.

Last night I restarted the build for a third time, but with the swap re-enabled, and also with the loop running again. Again, the other shell that I left logged in is unresponsive, again I can't open a new SSH session, and again the ebuild output seems to have frozen. The odd thing is, the loop is still running, and it's still showing memory fluctuations, (or at least it was until a few minutes ago... hmm...), I'm thinking that perhaps this apparent "freeze" is indeed the system slowing right down because of the whole swap-on-NFS thing. I will leave it running for another 24 hours or so, see if anything changes, then post back.
_________________
splig: amd64; nForce3; sata; GeForce 6600gt agp
muttley: EFIKA 5200B - PPC SoC :)

Registered Linux User #381314
# killall humans
Back to top
View user's profile Send private message
widan
Veteran
Veteran


Joined: 07 Jun 2005
Posts: 1512
Location: Paris, France

PostPosted: Sun May 20, 2007 1:22 am    Post subject: Reply with quote

Napalm Llama wrote:
Do you think the swap thing could be to blame?

Swapping over NFS used to cause deadlocks in some situations, I don't know if it's still the case. The problem was that transfering swapped pages over NFS can require allocating even more local memory, which is already a scarce resource if you need to swap.
Napalm Llama wrote:
I don't have a 2.5" hard disk for the machine and I don't want to splash out on one until I'm sure I'll have a system that'll work, so I can't find out for certain - kind of a catch-22, no?

If you have an external drive with a USB port, you can try with that (but only use a real hard drive, not a USB key - swapping over a flash device will quickly kill it).

You will also want to move the root filesystem to a local device as soon as practical, especially if you're going to do a lot of compiling. Compiles over NFS are very slow due to the numerous file accesses involved, and a system with only 128 MB of RAM can't keep a significant amount of files in cache.
Back to top
View user's profile Send private message
Napalm Llama
Guru
Guru


Joined: 04 Jun 2005
Posts: 520
Location: Swansea, UK

PostPosted: Sun May 20, 2007 10:10 am    Post subject: Reply with quote

widan wrote:
especially if you're going to do a lot of compiling

Compiling stuff? On Gentoo? Where'd you get that idea from? :lol:

As it happens I do have a hard drive in a USB enclosure, but the whole thing is taken up with encrypted partitions, used as backup for my main PC - and I don't have a spare drive to stick inside it.

There have been no changes at all from the Efika in almost 24 hours - the consoles are still frozen, etc. Even with an immense slowdown, I can't see a system taking this long just to compile one piece of a program before the ebuild output scrolls to the next block of text (you can tell from my technical language that I'm an experienced dev :) )

It's looking more and more like I've got no option but to buy that hard disk and see what happens...
_________________
splig: amd64; nForce3; sata; GeForce 6600gt agp
muttley: EFIKA 5200B - PPC SoC :)

Registered Linux User #381314
# killall humans
Back to top
View user's profile Send private message
nixnut
Bodhisattva
Bodhisattva


Joined: 09 Apr 2004
Posts: 10974
Location: the dutch mountains

PostPosted: Sun May 20, 2007 11:42 am    Post subject: Reply with quote

You may want to use another machine to build stuff for the efika. With crossdev you can setup a cross compile toolchain that will let you do just that.
_________________
Please add [solved] to the initial post's subject line if you feel your problem is resolved. Help answer the unanswered

talk is cheap. supply exceeds demand
Back to top
View user's profile Send private message
Napalm Llama
Guru
Guru


Joined: 04 Jun 2005
Posts: 520
Location: Swansea, UK

PostPosted: Sun May 20, 2007 3:20 pm    Post subject: Reply with quote

That's a whole different thread which I haven't gotten around to posting yet. For some reason crossdev fails to compile either glibc or uclibc when I'm trying to set it up - so until that's fixed everything has to be compiled on the Efika.

Nothing's easy...
_________________
splig: amd64; nForce3; sata; GeForce 6600gt agp
muttley: EFIKA 5200B - PPC SoC :)

Registered Linux User #381314
# killall humans
Back to top
View user's profile Send private message
widan
Veteran
Veteran


Joined: 07 Jun 2005
Posts: 1512
Location: Paris, France

PostPosted: Sun May 20, 2007 3:20 pm    Post subject: Reply with quote

Napalm Llama wrote:
Compiling stuff? On Gentoo? Where'd you get that idea from? :lol:

I should have written "... a lot of native compiling ..." :). A lot of patience is required to do that on a slow machine, and even more so over NFS.
Back to top
View user's profile Send private message
Napalm Llama
Guru
Guru


Joined: 04 Jun 2005
Posts: 520
Location: Swansea, UK

PostPosted: Sun May 20, 2007 3:25 pm    Post subject: Reply with quote

I've got that patience. I won't actually *need* the system to be in working order until next January, when my current web hosting runs out. So I can just tell the Efika to start the ebuild and leave it sitting unobtrusively in the corner for however long it takes. (I leave my main PC [which is currently providing NFS] switched on most of the time anyway.)

Although having said that, obviously it'd be nice to get it up to speed sooner rather than later, so I can have some fun with it!


[edit:]
Ah, apparently I did start that thread about crossdev, but nobody replied to it: https://forums.gentoo.org/viewtopic-t-557448.html


[edit again:]
OK, apparently only the Efika's SSH terminals are locked up. I tried Ctrl-C on the serial terminal (which the gcc ebuild was running on) and I got this:
Code:
sandbox:  Signal already caught and busy still cleaning up!

Curioser and curioser :?
_________________
splig: amd64; nForce3; sata; GeForce 6600gt agp
muttley: EFIKA 5200B - PPC SoC :)

Registered Linux User #381314
# killall humans
Back to top
View user's profile Send private message
Napalm Llama
Guru
Guru


Joined: 04 Jun 2005
Posts: 520
Location: Swansea, UK

PostPosted: Thu May 24, 2007 11:08 am    Post subject: Reply with quote

OK, I've fixed it.

I went and bought a hard disk anyway, and copied everything onto it, and then once everything was up and running I issued that oh-so-troublesome emerge gcc command again. Just checked on its progress now, and it's done. It worked. Swap-over-NFS was to blame, and swap-on-local-partition works beautifully :)

Thankyou for all your help!
_________________
splig: amd64; nForce3; sata; GeForce 6600gt agp
muttley: EFIKA 5200B - PPC SoC :)

Registered Linux User #381314
# killall humans
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Gentoo on PPC All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum