I've found that if a script is left running that repeatedly calls "cat /sys/class/thermal/thermal_zone0/temp", eventually the script will hang while trying to read the temperature data. On a number of occasions I've had this happen after 2-3 days (reading the temp value every 2 seconds). The only solution is a reboot. Each time, the "hang" has been caused by the read of temp from thermal_zone0 blocking, and never completing.
Is there some sort of memory leak or other resource leak in this driver that causes a failure after many repeated reads?
A quick look at the blocking processes currently running on my system, in case the process states are of any help:
- Code: Select all
pi@raspberrypi ~ $ ps aux|grep cat
USER PID %CPU %MEM VSZ RSS TTY STAT START TIME COMMAND
pi 30071 0.0 0.0 3204 488 pts/1 DN Jan04 0:00 cat /sys/class/thermal/thermal_zone0/temp
pi 30740 0.0 0.0 3204 488 pts/1 DN 03:16 0:00 cat /sys/class/thermal/thermal_zone0/temp
pi 30755 0.0 0.0 3204 488 pts/1 D+ 03:17 0:00 cat /sys/class/thermal/thermal_zone0/temp
Running "cat /sys/class/thermal/thermal_zone0/temp" at the command line will block in such a way that even ctrl-c won't get back to the prompt. Not even kill -9 will kill these "cat" processes...
This is my current Raspbian kernel:
- Code: Select all
Linux raspberrypi 3.2.27+ #250 PREEMPT Thu Oct 18 19:03:02 BST 2012 armv6l GNU/Linux
I'll put off rebooting this system for another day or so in case anyone has any ideas.