[General Questions and Answers] programmin:
I noticed some time ago that every few days or few weeks the Android 2.2 restarts on Optimus T. I searched and found lots of complaints (seems like a problem with Android in general?) but no solution. I wrote a Python script to try to track down this problem, and kept it running in SL4A:

import android
droid = android.Android()
import os, time
while (1):
print os.system("ps >/sdcard/ps.log; date > /sdcard/date.log; dmesg > /sdcard/dmesg.log")
time.sleep(1)

I ran it and after it restarted, I checked the files to see what it was doing right before crashing and rebooting. Among the dmesg I found a lot of repeating messages, one section looked a bit suspicious, where freezing tasks failed:

<4>[318167.964203] [Accelerometer] accel_power_on() : Power On
<4>[318167.972857] Restarting tasks ... done.
<6>[318167.999805] suspend: exit suspend, ret = -16 (2012-05-19 00:57:54.801113344 UTC)
<6>[318169.465067] PM: Syncing filesystems ... done.
<4>[318169.659290] Freezing user space processes ...
<3>[318169.670165] Freezing of tasks aborted after 0.01 seconds (699 tasks refusing to freeze):
<4>[318169.670712]
<4>[318169.670723] Restarting tasks ... done.
<6>[318169.691207] suspend: exit suspend, ret = -16 (2012-05-19 00:57:56.492516690 UTC)
<6>[318169.909787] PM: Syncing filesystems ... done.
<4>[318170.179340] Freezing user space processes ... (elapsed 0.01 seconds) done.
<4>[318170.190343] Freezing remaining freezable tasks ... (elapsed 0.00 seconds) done.
<4>[318170.190720] Suspending console(s) (use no_console_suspend to debug)
<4>[318170.191713] [Accelerometer] accel_power_off() : Power Off
<4>[318170.191745] [Ecompass] ecom_power_set() : Power Off
<7>[318170.192597] msmrtc_tod_proc_result: 05/19/2012 00:57:56 (05)
<7>[318170.193368] msmrtc_tod_proc_result: 05/19/2012 00:57:56 (05)
<7>[318170.193928] msmrtc_tod_proc_result: 05/19/2012 00:57:56 (05)
<7>[318170.194657] msmrtc_tod_proc_result: 05/19/2012 00:57:56 (05)
<6>[318170.195345] LGE: Android Vibrator Driver Suspend
<7>[318170.195373] <6>[msm_battery] msm_batt_suspend()...
<6>[318170.209093] thunderg_pwrsink_suspend_noirq: configure gpio for suspend
<6>[318170.209093] wakeup wake lock: rpcrotuer_smd_xprt
<6>[318170.209387] thunderg_pwrsink_resume_noirq: configure gpio for resume
<7>[318170.217893] <6>[msm_battery] msm_batt_resume()...
<6>[318170.219265] LGE: Android Vibrator Driver Resume
<7>[318170.220772] msmrtc_tod_proc_result: 05/19/2012 00:57:56 (05)
<7>[318170.222005] msmrtc_tod_proc_result: 05/19/2012 00:57:56 (05)
<4>[318170.222082] [Ecompass] ecom_power_set() : Power On
<4>[318170.224318] [Accelerometer] accel_power_on() : Power On
<4>[318170.230735] Restarting tasks ... done.
<6>[318170.252233] suspend: exit suspend, ret = 0 (2012-05-19 00:57:57.053883355 UTC)
<6>[318170.324958] PM: Syncing filesystems ... done.
<4>[318170.405000] Freezing user space processes ... (elapsed 0.03 seconds) done.
<4>[318170.442000] Freezing remaining freezable tasks ... (elapsed 0.00 seconds) done.
<4>[318170.443337] Suspending console(s) (use no_console_suspend to debug)
<4>[318170.446660] [Accelerometer] accel_power_off() : Power Off
<4>[318170.446785] [Ecompass] ecom_power_set() : Power Off

Are these anything related to random reboots, or is there a better way to diagnose what's wrong here?