lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


On Tue, 9 Oct 2007 07:27:15 -0600, "Patrick Donnelly"
<batrick.donnelly@gmail.com> wrote:

>First it would be helpful to see the different kinds of errors you are
>having. Why I mentioned problems with pairs() was that you are
>probably doing something like changing/adding/removing indexes from
>the table while iterating through it.

I'll check, but I'm pretty sure I'm not doing anything like that.

>This can cause very odd behavior
>and can easily result in some indexes becoming nil. As you read
>earlier, the order pairs() goes through a table is not defined, so you
>will easily see the program act differently each time it is run. I get
>the feeling your problem lies here, simply because of the randomness
>of the errors (where they take place in your code).

Actuall, it doesn't act differently every time it is run. Sometimes it
works exactly as I expect. Other times, every run has a different
error.

I wonder if it may be caused or related to a threading issue, or some
other program malfunctioning. I'm running it on a dual core machine.
Does the garbage collector run on a different thread? Could that cause
a race condition? This looks like a multithreading problem if it isn't
hardware.

Steve