Been having an issue with an A570 camera running CHDK a570-101a-1.2.0-3131-full. Camera suddenly crashes after working without issue for multiple days. I'm using a 32GB card with a 2MB boot partition. Camera is running a custom Lua script for timelapse photography.
I originally brought up the issue on IRC. reyalp and waterwingz offered assistance and suggestions. Original ROMLOG:
http://pastebin.com/YNiNzA5LI've since updated my script to log memory usage every 5 minutes, as the most obvious cause for the crash was an out of memory issue. Camera ran without issue for nearly 4 days until crashing, ROMLOG:
http://pastebin.com/8Lmb4iKGAdditional notes:
-I accidentally removed a call to collectgarbage() in the script; script ran without manually collecting garbage.
-Many unique strings are generated while logging, raising Lua memory usage. However, based on the logs, Lua is effective at automatic garbage collection.
-This may still be an out of memory issue, but it's worth noting that memory wasn't low before the most recent crash (below).
-Memory usage ranges:
-get_meminfo().allocated_size ~2MB
-get_meminfo().free_size ~85-280K
-Lua ~120-250K
-Memory gets scarce shortly after startup, but quickly recovers and stays within ranges above.
-Log excerpts below.
Log format:
[timestamp] <shots taken>/<get_jpg_count()>, <script runtime DAYS.HOURS:MINUTES:SECONDS>
<Temperature degrees F optical/CCD/battery>
<Battery voltage>
<SD card stats>
<Lua memory usage: collectgarbage("count") * 1024>
<get_meminfo() result (note: '-' indicates nil was returned): [heap name] <total_size>, <allocated_size>/<allocated_peak>/<allocated_count>, <free_size>/<free_block_max_size>/<free_block_count>
----------
STARTUP
----------
[2013-10-14 12:19:22] 16/9999, runtime 00:05:21
Temp Opt/CCD/Batt: 73/82/69
Batt: 3138 mV
Disk Free/Size: 30148/30190
Lua mem: 182272
Sys mem: [system] TOTAL -, ALLOCATED size/peak/count 2095352/-/2603, FREE size/block_max_size/block_count 208328/150864/200
----------
LOW MEMORY
----------
[2013-10-14 13:01:22] 142/9999, runtime 00:47:21
Temp Opt/CCD/Batt: 105/107/91
Batt: 3138 mV
Disk Free/Size: 29853/30190
Lua mem: 271360
Sys mem: [system] TOTAL -, ALLOCATED size/peak/count 2194020/-/3709, FREE size/block_max_size/block_count 109660/107268/127
[2013-10-14 13:22:01] 204/9999, runtime 01:08:01
Temp Opt/CCD/Batt: 109/111/93
Batt: 3138 mV
Disk Free/Size: 29710/30190
Lua mem: 320512
Sys mem: [system] TOTAL -, ALLOCATED size/peak/count 2249088/-/4254, FREE size/block_max_size/block_count 54592/33404/130
[2013-10-14 13:32:21] 235/9999, runtime 01:18:21
Temp Opt/CCD/Batt: 111/111/95
Batt: 3138 mV
Disk Free/Size: 29639/30190
Lua mem: 294912
Sys mem: [system] TOTAL -, ALLOCATED size/peak/count 2216476/-/3518, FREE size/block_max_size/block_count 87204/33404/588
[2013-10-14 13:37:41] 251/9999, runtime 01:23:41
Temp Opt/CCD/Batt: 111/111/95
Batt: 3138 mV
Disk Free/Size: 29603/30190
Lua mem: 131072
Sys mem: [system] TOTAL -, ALLOCATED size/peak/count 2036836/-/2719, FREE size/block_max_size/block_count 266844/50048/370
----------
DAY 2
----------
[2013-10-15 07:20:19] 1101/9999, runtime 19:06:19
Temp Opt/CCD/Batt: 53/60/51
Batt: 3121 mV
Disk Free/Size: 27894/30190
Lua mem: 180224
Sys mem: [system] TOTAL -, ALLOCATED size/peak/count 2092400/-/3375, FREE size/block_max_size/block_count 211280/69928/276
----------
DAY 3
----------
[2013-10-16 07:21:32] 3078/9999, runtime 1.19:07:32
Temp Opt/CCD/Batt: 55/62/53
Batt: 3116 mV
Disk Free/Size: 23752/30190
Lua mem: 153600
Sys mem: [system] TOTAL -, ALLOCATED size/peak/count 2086280/-/3077, FREE size/block_max_size/block_count 217400/47236/342
----------
FINAL LOGS BEFORE CRASH
----------
[2013-10-17 18:12:05] 6993/9712, runtime 3.05:58:04
Temp Opt/CCD/Batt: 68/80/64
Batt: 3142 mV
Disk Free/Size: 15479/30190
Lua mem: 224256
Sys mem: [system] TOTAL -, ALLOCATED size/peak/count 2210660/-/3900, FREE size/block_max_size/block_count 93020/9456/570
---script sleeps until sunrise---
[2013-10-18 07:24:01] 7005/9706, runtime 3.19:10:01
Temp Opt/CCD/Batt: 59/66/59
Batt: 3121 mV
Disk Free/Size: 15469/30190
Lua mem: 207872
Sys mem: [system] TOTAL -, ALLOCATED size/peak/count 2189016/-/3408, FREE size/block_max_size/block_count 114664/9456/678
[2013-10-18 07:29:02] 7019/9688, runtime 3.19:15:01
Temp Opt/CCD/Batt: 60/69/59
Batt: 3142 mV
Disk Free/Size: 15442/30190
Lua mem: 133120
Sys mem: [system] TOTAL -, ALLOCATED size/peak/count 2108844/-/2813, FREE size/block_max_size/block_count 194836/12228/395
---CRASH OCCURS AT 2013:10:18 07:30:20---