-->
Page 1 of 2

Longer Lua programs are unstable.

PostPosted: Sun Mar 20, 2016 7:07 am
by jankop
I need advice, please.
For some days I struggle with a general problem.
Why attached program crashes ?
In the moment, when my Lua program has a size of about 5kB or larger , it happens unstable and node.compile() crashes too.
I am test it with several ESP8266-01 and different versions of Lua, but always the same result.
Code: Select allbuff1 =('1234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890'..
'1234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890'..
'1234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890'..
'1234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890'..
'1234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890'..
'1234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890'..
'1234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890'..
'1234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890'..
'1234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890'..
'1234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890'..
'1234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890'..
'1234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890'..
'1234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890'..
'1234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890'..
'1234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890'..
'1234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890'..
'1234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890'..
'1234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890'..
'1234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890'..
'1234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890'..
'1234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890'..
'1234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890'..
'1234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890'..
'1234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890'..
'1234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890'..
'1234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890'..
'1234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890'..
'1234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890'..
'1234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890'..
'1234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890'..
'1234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890'..
'1234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890'..
'1234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890'..
'1234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890'..
'1234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890'..
'1234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890'..
'1234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890'..
'12345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345')
print(#buff1)
print(buff1)

print("END off programm")

Re: Longer Lua programs are unstable.

PostPosted: Sun Mar 20, 2016 7:42 am
by xtal
works ok on esp-12 with sdk 151
With esp-01 there may be a sdk cutoff , because of 512k spiff
try sdk 0.9.6 that was stable if that fails try putting the concatenate on the front of
strings instead of back....you never know it just may work

length = 3795
buffer~~~~~~~~~~~~~~
end of pgm

Re: Longer Lua programs are unstable.

PostPosted: Sun Mar 20, 2016 12:54 pm
by TerryE
The 0.96 version has a lot of bugs and little free memory. A custom dev build with only the modules that you need should give you a node.heap() of around 45Kb. I cam compile your test case with no problems.

Re: Longer Lua programs are unstable.

PostPosted: Sun Mar 20, 2016 2:42 pm
by jankop
Thank you for answer. I tested the latest version of Lua, but without result. I tried the 3nd module ESP826-01 and it sick again. I'll do solder module 12E for new testing.