It would be useful to know what platform and what compiler version.
These things matter; for instance, with the clang that comes with the
new Ubuntu LTS a simple f:close() will cause a segfault on release
builds. I haven't found any issues with gcc, however, except the new
default of 4.6 is to leave out stack frames, which caused trouble on
Windows executable builds.
Oh, sure! My mistake; obviously that's a handy bit of background for this kind of problem.
I'm also using clang, but on OS X. So I'm guessing it could be the same issue as on Ubuntu?