# Hard shutdown when compiling C++ modules



## SocialHaze (Aug 2, 2012)

Hello,

I've been experiencing problems when building certain ports, notoriously Chromium and OpenOffice which are both in C++.

My laptop emergency shutsdown.

It's an i3-380M, 90ÂºC max temp.  I tried lowering the max temp in coretemp alas to no result.  This is leading me to think there might be something else but if I monitor the temperature manually and suspend the build when it borders the max temperature everything goes fine.

Any thoughts or insight?


----------



## SirDice (Aug 2, 2012)

Your machine most likely heats up too much and shuts down to protect itself.


----------



## SocialHaze (Aug 2, 2012)

Only on C++ builds?

I can compile some pretty hefty stuff written in C but large C++ builds (like Webkit, common to Chromium and OpenOffice) hardshut the machine.

It does overheat but I don't understand why it wouldn't also shutdown while compiling X or libav, for instance.


----------



## SirDice (Aug 2, 2012)

Fix the overheating issues, not the symptoms.


----------



## kpa (Aug 2, 2012)

See this thread:
http://forums.freebsd.org/showthread.php?t=33265


----------



## SocialHaze (Aug 2, 2012)

SirDice said:
			
		

> Fix the overheating issues, not the symptoms.



tjmax I lowered to 85ÂºC with no result.  The CPU should've been throttled by coretemp to remain 5ÂºC below the maximum allowed by the temperature sensors, no?

See /usr/src/sys/dev/coretemp/coretemp.c



			
				kpa said:
			
		

> See this thread:
> http://forums.freebsd.org/showthread.php?t=33265



I can buildworld with GCC just fine.

ACPI has nothing to do with it because the firmware handles fan speeds just fine.  Boots up full spin if it hard shutdown because of temperature issues.


----------



## SirDice (Aug 2, 2012)

I had to look this up... Tj(max) is the maximum junction temperature, which is the real temperature the chip is at. If your system is close to this temperature take out the CPU, reseat it and put some proper thermal paste between it and the cooler. It basically means your CPU can't get rid of it's excess heat.


----------



## SocialHaze (Aug 2, 2012)

SirDice said:
			
		

> I had to look this up... Tj(max) is the maximum junction temperature, which is the real temperature the chip is at. If your system is close to this temperature take out the CPU, reseat it and put some proper thermal paste between it and the cooler. It basically means your CPU can't get rid of it's excess heat.



Not going to happen.

Now knowing that:

- ACPI has nothing to do with this;
- CPU is throttled by the coretemp kernel module at 5ÂºC below the firmware upper limit; and
- This only happens on C++ builds but not on other CPU-intensive tasks like building the OS.

Can anyone offer a reasonable explanation and perhaps hint at a possible solution?


----------



## jb_fvwm2 (Aug 2, 2012)

Run freecolor every minute or so? Start Xorg first so that less memory gets allocated to the build and it runs slower? Start some other process in the background first which would do something similar? Alter the Makefile, commenting out the MAKE_JOBS_SAFE line ?


----------

