lua-users home
lua-l archive

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

Thanks for the reply Zachary.

I think I should clarify what is happening before going any further.

When I run the sieve script, It prints out prime numbers up to 53 and then it just sits there doing nothing. I have to hit ctrl-c to kill the process. I tried making LUAI_MAXVARS and LUAI_MAXUPVALUES much smaller but that did not seem to make a difference. Here is an example of what is printed:

/home/lua> lua sieve.lua


pid 23: failed 2

Now I also have a few versions of the sieve script that I modified slightly. I added some print statements to see if I could debug the script that way. Anyway, when I run those version of the script it prints out prime numbers but it never gets as far as the original script. Here is an example of what is printed with only a couple minor changes (I'm sure you can guess what they are):

/home/lua> lua sieve-t.lua
i=      2
n=      2
i=      3
n=      3
i=      4
i=      5
n=      5
i=      6
i=      7
n=      7
i=      8
i=      9
i=      10
i=      11
n=      11
i=      12
i=      13
n=      13
i=      14
i=      15
i=      16
i=      17
n=      17
i=      18
i=      19
n=      19
i=      20
i=      21
i=      22
i=      23
n=      23
i=      24
i=      25
i=      26
i=      27
i=      28
i=      29
n=      29
i=      30
i=      31
n=      31
i=      32
i=      33
i=      34
i=      35
i=      36
i=      37
n=      37
i=      38
i=      39
i=      40
i=      41
n=      41
00      42
00      43
n=      43
pid 24: failed 11

I should point out that I did not have to ctrl-c to kill the process for this version of the script, it exits on its own. Any idea what "failed 11" means?

The last few lines are interesting, notice how "i=" somehow magically turned into "00". Other variations of the script all seem to have there own unique weirdness.

So, any idea's on where I can go from here?