Was the error "ERROR:NULL error message" ?
Yes, that's the one. I've been able to reproduce the bug once a night on the sx260, and I'm tracking it down slowly but surely. The bug happens when lua calls wait_click(10) or sleep(10). I set a variable to a different number in the C code for each function that my script calls, and sleep(10) is the culprit with this in the script:
repeat sleep(10) until get_shot_ready()
I did a lot of investigating of the keyboard functions. They aren't totally thread safe, but I couldn't show that was causing a problem.
I also dug into lua as far as I could get, and came up with a possibility. The sleep(10) function calls lua_yield( L, 0 ). lua_count_hook () also calls lua_yield(), which creates the possibility of a double yield with no resume. There's a test for that, but it might be fooled under rare timing conditions (I think?).
Anyway, scripts have a voluntary yield when they call sleep(10), and a preemptive yield from lua_count_hook(). My script doesn't need the preemptive yield, since it spends most of its time in a sleep(10) loop. So I'm trying disabling the preemptive yield with:
set_yield(-1,-1)
The script works fine this way. In fact, this reduces the time waiting for the script to set the exposure between shots to 10 msec each time, instead of 10 or 20 msec. I'll keep it in the script even if it doesn't fix the lua error bug. But I've got my fingers crossed that this is the problem, and I won't see that error again!
Last Wednesday, I caught a pretty nice sunset time lapse from the top of Spencer's Butte with the SX260, but the lua error stopped it while the clouds were still lit up. Here's the latest tests:
http://www.youtube.com/watch?v=6DWLPU0y4Ig#wsThe G1X doesn't seem to trigger the bug (yet), and I only saw it once with the SX50. Here's the latest test with these two cameras:
http://www.youtube.com/watch?v=HA7fh8viei0#wshttp://www.youtube.com/watch?v=hkBVi7MKB78#ws