lua-users home
lua-l archive

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


Hi, Brian, list!

luaposix 5.1.2-1
lua-ev 1.1

OS X 10.6 and Ubuntu 9.10 x86_64

If I require lua-ev (nothing else needed), it breaks posix.fork():
child processes instantly die (they become zombies if you uncomment
the last line in the example). Please see below script to reproduce.

$ lua fork-ev.luanot requiring lua-ev
child pid is	28009
child is forked

$ lua fork-ev.lua --with-ev
requiring lua-ev
child pid is	28012
# note no "child is forked" message

Any clues?

Alexander.

--[[ fork-ev.lua ]]--

local use_ev = (select(1, ...) == "--with-ev")

pcall(require, 'luarocks.require')

local posix = require 'posix'

if use_ev then
  print("requiring lua-ev")
  local ev = require 'ev'
else
  print("not requiring lua-ev")
end

local pid = posix.fork()
if pid == 0 then
  print("child is forked")
else
  print("child pid is", pid)
end

-- while true do end