[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Reading from io.popen handle crashes in release build Lua
- From: Shane Liesegang <shane@...>
- Date: Sun, 8 Jul 2012 09:12:08 -0400
I have this bit of (what I think is) innocuous Lua code:
local f = assert(io.popen(path .. " -version", 'r'))
local s = assert(f:read('*a'))
f:close()
Where
"path" is a string pointing to a configuration program, and I do some
processing on "s" afterwards to make sure it's at the correct version
before proceeding.
This worked fine in Lua 5.1.5, and it works fine when I build Lua
5.2.1 in debug mode, but when I have a release version of the lua
executable, it crashes on the second line with "Interrupted system
call."
I'm not sure which optimization in my particular Release
configuration is causing the issue, but I figured it worth asking
if anyone had an idea of what might cause a problem like this, what
might have changed in io between 5.1 and 5.2, etc.
Is there a new, better way to get the output from an external program?