LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux From Scratch (https://www.linuxquestions.org/questions/linux-from-scratch-13/)
-   -   Out of Memory gcc-3.4.1 -Pass 1 (https://www.linuxquestions.org/questions/linux-from-scratch-13/out-of-memory-gcc-3-4-1-pass-1-a-481091/)

status1 09-06-2006 07:57 PM

Out of Memory gcc-3.4.1 -Pass 1
 
Hello,
I am trying to install LFS for the first time on a laptop
with 128 mb ram.
The LFS is verxion 6.0 that came with the book LFS 2-nd edition.
I am somewhat new to linux but I know some of the basics.
I got to the point of installing GCC-3.4.1 and I am stuck because I am getting out of memory messages and getting stopped.
My first question is :
Is this a real problem or is it caused by something else ?
In other words is 128 mb enough to be able to install
and compile gcc-3.4.1 ?
Another question I have is for someone who used the cd from the book.
On page 21 it mentions the packages needed one of them being gcc-3.4.1 27000kb however I don't have that on the cd
The closest one I have is gcc-core-3.4.1.tar.bz2 plus 2 other ones (c++ and testsuites I believe) in place where
the word "core" is.
Am I supposed to use just the "core" file or all 3 or
none of the above and download the exact file ?
The "out of memory" messages comes with different numbers
because it gets stuck at different places every time I run it so I didn't include them here but I could if that makes it easier to diagnose this problem

w3bd3vil 09-06-2006 08:02 PM

128mb ram couldnt be the problem. do you have enough space on the hdd, paste the output of df -H. gcc-core will do.
and try to paste in the exact errors you get and the command you input too.

status1 09-07-2006 06:51 PM

Hello,
I set up the linux partition with 5gb and the swap with 1gb
I am not sure how best to transfer the output from the laptop to the pc so I will just have to type in
Here is the output of df -H after just loging in and without doing anything
Filesystem size used avail use% mounted on
/dev/hdc 348M 348M 0 100% /.cdrom
none 131M 0 131M 0% /dev/shm
/dev/loop0 384M 384M 0 100% /usr
/dev/loop1 14M 14M 0 100% /opt

Then what I do is I mount my floppy because I made some script files to
save on retyping everytime I reboot and run my first script which sets up the lfs so after that I have 2 more lines at the bottom of the list

/dev/fd0 1.5M 30k 1.4M 3% /mnt/floppy
/dev/hd7 6.3g 29k 5.9g 1% /mnt/lfs

How is it so far ?
It will take some time compile the program so I will have to do that tommorrw
What is the best way to paste the errors ?
I am not sure that I will be able to type much after it stops but I will give it a try

status1 09-08-2006 02:08 PM

Hello,
Here is the error messages that I get after compiling for about 20 minutes
This is after I run the comand make BOOT_LDFLAGS="-static" bootstrap

Normal free: 928kb min:476kb low:952kb high:1428kb active:147976kb inactive:
84348kb present: 245632kb
Protections: 0 238 238
high mem free:0kb min:128kb low:256kb high:384kb active:0kb inactive:0kb present :0kb
Protections: 0 0 0
DMA some numbers here
Normal some numbers here
Highmem: empty
Swap cache : add 0, delete 0, find 0/0, race 0+0
Out of Memory: Killed process 14245 (cc1)
xgcc: Internal error Terminated (program cc1)
Submit full bug report URL...
make[2] *** [insn-attrtab.o] Error 1
make[2] Leaving directory '/2/gcc'
make[1] *** [stage2_build] Erroe 2
make[1] Leaving directory '2//gcc'
make *** [bootstrap] Error 2

Can anyone make any sense out of this ?
I ran it again while I was typing this and it's pretty much the same except
the Out of Memory killed process is 14579(cc1)
The df -H command has the same output before and after compiling

Any ideas anyone ?

In the book it sais that the bootstrap command compiles it once and then uses that program to compile itself a 2nd and a 3rd time and then compares them
Is it possible to break the bootstrap command or to use a different command to do this proccess on step at a time to help narrow down where the problem is ?

druuna 09-08-2006 05:05 PM

Hi,

You mention that you have a 1Gb swap partition. Is it activated?

Use top or free or cat /proc/swaps to check.

If swap is missing:

swapon /dev/hd<yourswappartition>

Hope this helps.

status1 09-08-2006 06:20 PM

Hello,
Thanks for the tip
The swap was not activated
I wonder why this was not mentioned in the book
I will run it again and see if the problem goes away

druuna 09-09-2006 04:52 AM

Hi,

It (making and activating swap) is mentioned in the book (LFS 6.2 chapter 2.3 and 2.4). Older version also mention it. I do believe that your initial problem will be solved by turning swap on.

Anyway, hope this gets you going again.

status1 09-09-2006 10:39 AM

Hello,
I have the lfs 6.0 2nd edition and I don't see that mentioned in those chapters
It should be right after mkswap command but it's not there

Well I tried to compile it with the swap activated but I seem to have other problems now.
I compiled it without doing the Binutils first to save some time
It compiled for a lot longer this time (about 1hr) so I was checking it from time to time. I saw it going thru stage 1 and 2 and then when I checked it again it rebooted for some reason.
After loging in, it continued a little with an error something about
init id1 respawning too fast: disabled for 5 minutes then after waiting for 5
minutes it rebooted again and after loging in again I did not get anything
just a blinking cursor without the prompt

So I tried it again this time installing Binutils first but now when I get to decompress the gcc-3.4.1 file it runs for a while and then it slows down
severely.
After slowing down to a file every 10-15 seconds it gets to a file called
MD5SUMS and it stays there for more than 20 minutes after which I gave up
because I felt it was taking too long. The cd is getting accessed and the hard drive led is blinking but no progress is made.
Also after I stopped it every time I issue a command it takes much longer
to execute
Is a 1gb swap size enough ?
Perhaps I should start a new thread since I don't have the initial problem
but it may still be memory/swap related

druuna 09-09-2006 11:14 AM

Hi,

Quote:

Originally Posted by status1
I have the lfs 6.0 2nd edition and I don't see that mentioned in those chapters
It should be right after mkswap command but it's not there

Earlier version of the LFS book do not show this command, but it is/supposed to be basic knowledge (if you want to start with LFS that is).

Quote:

Well I tried to compile it with the swap activated but I seem to have other problems now.
I compiled it without doing the Binutils first to save some time
It compiled for a lot longer this time (about 1hr) so I was checking it from time to time. I saw it going thru stage 1 and 2 and then when I checked it again it rebooted for some reason.
After loging in, it continued a little with an error something about
init id1 respawning too fast: disabled for 5 minutes then after waiting for 5
minutes it rebooted again and after loging in again I did not get anything
just a blinking cursor without the prompt
You really need to follow the steps in the correct order. It's no use continueing if you have forgotten the previous step.

Quote:

So I tried it again this time installing Binutils first
Did you start with a clean sheet? Removing the old stuff, setting needed variables etc.

Quote:

but now when I get to decompress the gcc-3.4.1 file it runs for a while and then it slows down
severely.
After slowing down to a file every 10-15 seconds it gets to a file called
MD5SUMS and it stays there for more than 20 minutes after which I gave up
because I felt it was taking too long. The cd is getting accessed and the hard drive led is blinking but no progress is made.
How did you check the progress? Although I do agree that 20 minutes is rather a long time, even with 128Mb/1Gbswap.

Only sensible thing I can suggest: Start over, use the 6.2 book and its packets/patches and follow every step.

status1 09-09-2006 12:46 PM

Quote:

Originally Posted by druuna
Hi,



Earlier version of the LFS book do not show this command, but it is/supposed to be basic knowledge (if you want to start with LFS that is).

.

If it's supposed to be basic knowledge why mention it in ver 6.2 and not the earlier versions ?
Shouldn't that be the other way around ?
Just curious

Quote:

Originally Posted by druuna
You really need to follow the steps in the correct order. It's no use continueing if you have forgotten the previous step.
.

I did not forget. That was on purpose to see if that solved the problem and to save time which it did

Quote:

Originally Posted by druuna
Did you start with a clean sheet? Removing the old stuff, setting needed variables etc.
.

This may be a dumb question but do I not start with a clean sheet everytime I reboot untill a certain point ?
I do not leave my computer on if I am not using it

Quote:

Originally Posted by druuna
How did you check the progress? Although I do agree that 20 minutes is rather a long time, even with 128Mb/1Gbswap.
.


By progress I just meant that it's not going to the next file It's just sitting there doing something but I don't know what


Quote:

Originally Posted by druuna
Only sensible thing I can suggest: Start over, use the 6.2 book and its packets/patches and follow every step.


Thanks but if it's not working with 6.0 I am not going to try another version just to see if it works faster

druuna 09-09-2006 01:23 PM

Hi,

Quote:

Originally Posted by status1
If it's supposed to be basic knowledge why mention it in ver 6.2 and not the earlier versions ?
Shouldn't that be the other way around ?
Just curious

These 'details' are filled in during the development of LFS. The main focus was/is on building your own linux box, from the ground up. For some (or a lot, depending on experience) of the things that need to be done, a certain level of experience is expected.

LFS is, and always will be, work in progress.....

Quote:

This may be a dumb question but do I not start with a clean sheet everytime I reboot untill a certain point ?
I do not leave my computer on if I am not using it
That is indeed starting with a clean sheet. Even cleaner than I ment :-)

After each reboot certain things need to be re-done in order to continue with the LFS build.

Among other things: setting the LFS variable, mounting etc etc.

Just in case, here's a hint on LFS: resume work after a break

Quote:

By progress I just meant that it's not going to the next file It's just sitting there doing something but I don't know what
I do think that memory/swap isn't the problem (just a feeling), but if memory is (too) low a lot of swapping is needed to get the deed done and that cane take a lot of time. But 20 minutes for a md5 file is (too?) long.

Quote:

Thanks but if it's not working with 6.0 I am not going to try another version just to see if it works faster
I understand, the reason I suggested it is this: 6.0 has evolved (fixed bugs, some packages upgraded, swapon is added ;) etc.).

status1 09-09-2006 06:06 PM

Quote:

Originally Posted by druuna
Hi,
After each reboot certain things need to be re-done in order to continue with the LFS build.
Among other things: setting the LFS variable, mounting etc etc.
Just in case, here's a hint on LFS: resume work after a break
.

I read that article that's why I started working on lfs again
after giving up because of all the retyping
I just a made a small improvement to that. I put the instructions into small files so I only have to execute a few simple files which I put on a floppy so I just have to mount
the floppy manually and execute a few files

Quote:

Originally Posted by druuna
I understand, the reason I suggested it is this: 6.0 has evolved (fixed bugs, some packages upgraded, swapon is added ;) etc.)
.

Well , I was hoping that all the bugs were worked out before the book was printed. That's why I am here hoping that someone has already noticed this problem and found a fix for it


I ran gcc-3.4.1 again without installing binutils first just to find out how it stopped.
I was watching it closely and it ran about 15 minutes into stage 2 after which it started showing Out of memory messages again but I didn't see that because it ran a little bit further and finishing with the INIT : ID "1" respawning too fast : disabled for 5 minutes after which it just reboots
One other clue perhaps is that when I reboot it doesn't do it right away. It starts killing all the Out of memory processes first.

So it looks like I have to give it up again unless someone has a solution for this
So even with the swapon it gives an Out of memory message
but it's much later in the compilation. That's if I run gcc-3.4.1 first.
If I run binutils first with swapon then I can't even run gcc-3.4.1 because it slows down so much during decompressing that it's virtually unusable

Just out of curiosity if anyone knows
what is being used as swap if swap is not activated ?

druuna 09-10-2006 04:31 AM

Hi,

I start to wonder if LFS is the problem, your mention of the 'respawning too fast' message makes me to believe that the base system isn't working correctly. This message cannot come from LFS, 'cause it's not the active OS.

- What are you using as your base? A LFS liveCD or something else?
- Any strange things during/after startup?
- Did your base system met all the Host Requirements (6.2)?

BTW: If no swap (or swapfile) is activated/created, only memory is used.

status1 09-10-2006 09:23 AM

Hello,
I think I know what the problem is but I am not sure how to fix it at this moment.
In the book where it says to make a separate directory "mkdir../binutils"
Where is that located ?
Is it in the root directory or the /mnt directory ?

The other problem is that when I switch to the lfs environment I cannot create
any directories in ../ because I get Permission denied

So I am thinking I was compiling as root (not lfs) in the ramdisk portion of lfs and I guess after a while the ramdisk runs out of memory.
Is that possible ?

BTW I read that article "LFS: resume work after a break" and it says that if
you are not using a swap file you don't need to activate it.
So I tried it again without making/activating the swap and it was pretty much the same so I guess that means that I am only using the memory.

So I have to figure out how to make a directory as lfs and where to place it.

druuna 09-10-2006 09:54 AM

Hi,

Quote:

I think I know what the problem is but I am not sure how to fix it at this moment.
In the book where it says to make a separate directory "mkdir../binutils"
Where is that located ?
Is it in the root directory or the /mnt directory ?
cd $LFS/sources
tar jxf binutils-2.16.1.tar.bz2
cd binutils-2.16.1
mkdir -v ../binutils-build
cd ../binutils-build
<rest of the steps>


Version number may differ, but you hopefully get the point.

Quote:

BTW I read that article "LFS: resume work after a break" and it says that if
you are not using a swap file you don't need to activate it.
So I tried it again without making/activating the swap and it was pretty much the same so I guess that means that I am only using the memory.
You definitely need swap. 128Mb is not enough if you do not have an active swap partition.

But like I said before, I think that memory/swap is not the reason, it's the result of something else.

BTW: Does your base system meet the requirements that are needed to install LFS 6.0?


All times are GMT -5. The time now is 12:23 AM.