LUA script gives bogus error messages - page 2 - General Discussion and Assistance - CHDK Forum

LUA script gives bogus error messages

  • 14 Replies
  • 5093 Views
Re: LUA script gives bogus error messages
« Reply #10 on: 25 / October / 2008, 01:51:41 »
Advertisements
Hi Reyalp,

I can confirm that the modification works on my SD500. The original script now works without problems! Thanks for the amazingly quick finding and solving. I am rather new here but also rather curious.... Could you please elaborate a bit more on "I replaced open/read with Fut*"? Is that a different library method to access files or something?

Thanks a bunch!

TheJez

*

Offline reyalp

  • ******
  • 12111
Re: LUA script gives bogus error messages
« Reply #11 on: 25 / October / 2008, 02:13:10 »
Hi Reyalp,

I can confirm that the modification works on my SD500. The original script now works without problems! Thanks for the amazingly quick finding and solving. I am rather new here but also rather curious.... Could you please elaborate a bit more on "I replaced open/read with Fut*"? Is that a different library method to access files or something?
Yes, there's 3 or 4 different file IO APIs. Since we only know what we've figured out from reverse engineering, it's not always clear when a particular one should be used.
see this thread for example io functions: Foo_Fut vs. Foo vs. foo ?
this is probably also related The difference between malloc() and umalloc()

I'll check in the fix now that it has been tested on a few cams. There's a number of other places where this may be an issue as well.

Using Fut does have a downside: opening a FILE * allocates a bit over 32K of memory, which is freed when you close the file. I suspect that using read() with uncached (umalloc) memory would work. We should probably test that.

edit:
attached a new build. I'd appreciate if you could test that.
« Last Edit: 25 / October / 2008, 02:25:35 by reyalp »
Don't forget what the H stands for.

Re: LUA script gives bogus error messages
« Reply #12 on: 25 / October / 2008, 02:29:16 »
Ok, thanks for the elaboration. Things are getting more clear now  :). If you want to me to test a build with read() and umalloc(), just let me know...

TheJez

Edit: Ah, I just missed that new build. I'll give it a try...

Re: LUA script gives bogus error messages
« Reply #13 on: 25 / October / 2008, 02:38:01 »
Ok, I gave it a try and this new build works as well! So it appears we have two options to choose from to fix this problem. I'll leave it up to your experience to choose the best one  :)

Thanks again!

Now there's one more issue I encountered, but that is totally unrelated to this. I'll open a new thread for that...

The Jez


Re: LUA script gives bogus error messages
« Reply #14 on: 25 / October / 2008, 17:56:07 »
 Thanks reyalp for the quick build.  While I had an error at first, the script is now working.  I'm figuring user error on my part.

 

Related Topics