# cc1 used greatest stack depth: xxx bytes left

## iceaway

When I try to emerge qemu my computer starts lagging really badly after a while, very hard to switch windows, type anything into consoles etc. When checking dmesg right after this happens I get:

[  100.516740] make used greatest stack depth: 4616 bytes left

[  156.897561] ar used greatest stack depth: 4480 bytes left

[  276.281353] as used greatest stack depth: 3992 bytes left

[  289.349700] cc1 used greatest stack depth: 3896 bytes left

Any ideas what could be causing this? Doesn't happen with other packages (not any that I have noticed so far, anyway).

----------

## azp

A quick googling shows two answers saying "it's nothing to worry about, you've just enabled debugging output in your kernel".

http://www.mail-archive.com/gentoo-amd64@lists.gentoo.org/msg11510.html

http://lists.ozlabs.org/pipermail/linuxppc-dev/2010-January/079911.html

----------

## iceaway

 *azp wrote:*   

> A quick googling shows two answers saying "it's nothing to worry about, you've just enabled debugging output in your kernel".
> 
> http://www.mail-archive.com/gentoo-amd64@lists.gentoo.org/msg11510.html
> 
> http://lists.ozlabs.org/pipermail/linuxppc-dev/2010-January/079911.html

 

I found those results as well, but neither of them indicated any computer lag. But both times when I tried to emerge qemu, they appeared in the dmesg log. Possibly these messages are unrelated to the computer lag, but it was all I could see in the logs indicating some kind of error/warning.

----------

## DirtyHairy

How much ram do you have? Do you run several make instances in parallel (make -j)? Have you tried monitoring memory usage during the compile?

----------

## iceaway

 *DirtyHairy wrote:*   

> How much ram do you have? Do you run several make instances in parallel (make -j)? Have you tried monitoring memory usage during the compile?

 

I have 4GB of RAM and I have -j5 in my makeopts. It seems weird though that his has never happened before, for any package. I did not watch my memory usage, I could barely switch windows in gnome so I focused on getting a CTRL-C to the make processes. I didn't dare tying to open up a new terminal  :Smile: 

I can try adjusting my makeopts, and watch the memory usage, to see if that helps.

----------

## DirtyHairy

 :Smile:  With 4GB ram memory problems seem a bit far-fetched, but on the other hand, in nasty cases, the compiler can eat up several 100s of MBs, so, with make -j5, I guess it is worth checking.

----------

## iceaway

 *DirtyHairy wrote:*   

>  With 4GB ram memory problems seem a bit far-fetched, but on the other hand, in nasty cases, the compiler can eat up several 100s of MBs, so, with make -j5, I guess it is worth checking.

 

On the other hand, the different gcc threads/processes that compile the code will all have their own stacks, so the number of parallel compiles shouldn't be the issue. I'll give it a shot however and see if it yields any different results.

----------

## DirtyHairy

To clarify: I don't thing that the stack depth messages are related to the problem, I more suspect that the machine starts swapping.

----------

## iceaway

I think I have found the problem, seems like it was a memory usage issue. I googled around some more and found this:

https://bugs.launchpad.net/gcc-linaro/+bug/714921

It appears to be a bug in gcc which causes very high memory usage when compiling just qemu. 

I compiled it successfully using -j1 in my make opts. Thanks for all your help!

----------

## azp

Cool that you found it, and weird that it only happens when compiling qemu!

----------

