lua-users home
lua-l archive

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


David Olofson wrote:
I thought I'd warn fellow Lua users about something which has
caused me quite a lot of debugging anguish: it's not safe to compile
Lua with -fomit-frame-pointer if you're compiling with mingw.  It
can cause longjmp() to crash horribly.  (This probably depends on
the mingw version but from googling around it looks like various
people have experienced this problem; YMMV.)

So if you're wondering why, for example, your pcall() errors
always terminate the program badly... this could be it.

Do you have a link to some explanation of what happens, more specifically? Does it just plain break longjmp(), or just cause it to malfunction in certain cases?

Not really (I didn't keep many links).  You could try googling
around yourself.  For example, someone's experimental notes:
http://lists.gnu.org/archive/html/gcl-devel/2004-06/msg00004.html
(with an interesting link also within that message, regarding
the Io language.)

FYI I'm using mingw'd GCC 3.1.1 and tested a spectrum of mingw-
runtimes from 2.x to 3.x.  In the example above, someone
sees the problem in mingw'd GCC 3.2.3 and someone else possibly
(it's not clear) in 3.3.1 and/or 3.4.0.  Having removed my
-fomit-frame-pointer, win32 longjmp()s are happy again.

Hmm, some google'd links (the Yet Another Prolog configure.in)
mutter about this issue affecting cygwin (of which mingw32 is
a fork) too.

--Adam
--
Adam D. Moss   . ,,^^   adam@gimp.org   http://www.foxbox.org/   co:3