lua-users home
lua-l archive

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


On 05/11/2012 09:46, ms2008vip wrote:

Howdy:

          I want to execute background processes concurrently from a lua script
like :

a = io.popen("deploy.exp" .. ip1):read("*a")
b = io.popen("deploy.exp" .. ip2):read("*a")

where a,b are continually running processes. When i do this as above, b will only run when a is finished. And the deploy.exp script is an expect script which
  used to ssh few servers, and execute some commands. Then I need to fetch some text from a and b. Any idea on this? I tryed with the ExtensionProposal API.
When I tried that I get one error messages that say: "*** glibc detected *** free(): invalid next size (fast): 0x08aa2300 *** abort".

The part code is

for k,v in pairs(single) do
command =  k .. " 1 " ..  table.concat(v, " ")
local out = io.pipe()
local pro = assert(os.spawn("./spaw.exp " .. command,{
       stdout = out,
}))
if not proc then error("Failed to aprogrinate! "..tostring(err)) end
print(string.rep("#", 50))
local exitcode = proc:wait()
end

Has anybody any experience (or advice / where we should look) with this? or give me a sample? Thanks

BTW: I tried the luaposix, but I can't find any sample by posix.fork(). Does anyone could share one? TKS

This glibc error always comes up about mem alloc defaults. free detects the issue but often it's not a freeing error (like double free) properly. Is there a chance one can isolate the C sides of the problem (and use Valgrind...)?

Denis