Closed Lorel closed 7 years ago
Test chunk:
func = 'function(params) func = function(value) local csv = nil if ccsv then csv = ccsv else csv = require("csv") end if not value then return {} end local array = (csv.parse)(value) local event = {} event.uniquecarrier = array[9] event.arrdelay = array[15] return event end if not cjson then cjson = SGX.cjson end return cjson.encode(func(table.unpack(cjson.decode(params)))) end'
data = '["2005,3,13,7,1120,1120,1239,1240,WN,1565,N317SW,79,80,65,-1,0,BHM,STL,410,4,10,0,,0,0,0,0,0,0"]'
for i=0,50000000,1 do
print("Process " .. i, sgxdecrypt(sgxprocess(sgxencrypt(func), sgxencrypt(data))))
end
Running this simple test:
luasgx
from f45fc5fba2766bcab501af3655f0bda83cbfe3fc the limit is 1225810, and everything crashes displaying the message "Illegal instruction (core dumped)"luasgx
from dafc59bbf2220b1447b8a6413a7f11cc764b89a5 the limit is 14177221, and everything crashes displaying the message "Illegal instruction (core dumped)"With EnclavedLua.signed.so
version from ec37d91fd9e29d7a4354f15eab579b06a4d41b5f, 100M calls have been done successfully
Bug in the way files were mocked: an ever-growing table (that relates file ids with the descriptive struct) Even though the filename was the same, a new pair <id,ptr> in every call was being allocated
Too many calls of
sgxprocess(func, params)
lead to a fatal error:Illegal instruction (core dumped)
In my case, it happens when 1266000 calls have been done with:func
:params
: string about 100 chars length, last one given:It looks like a kind of memory issue
During my discover of LuaSGX, I've noticed that when you give a malformed function to
sgxprocess
after having already called at least once the latter with a well-formed function, this is the previously evaluated function which is called into the enclaveThen I am suspecting like a kind of data persistence which should not happen
UPDATE During another run experiment, using the same workload, it failed at the 1242312th call with
params
value:So the failure is not related to the given datas