[Top][All Lists]

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

[Chicken-users] setjmp/longjmp on mingw

From: Jonah Beckford
Subject: [Chicken-users] setjmp/longjmp on mingw
Date: Tue, 1 Jun 2004 18:31:58 -0400

The nsample executable was crashing on my MinGW, giving an "Invalid memory
access" error when calling longjmp(C_restart, 1) from C_reclaim.  I think
the problem has been there for a significant time.

I decided to see if it was a problem with setjmp/longjmp, or if it was
something else.  I put in some #ifdefs, replacing the 3 setjmp/longjmp calls
with try/catch/throw (C++).  

For all tests, I compiled runtime.c (which has some typecasts and C++
reserved words renamed to get it in C++ conformance) with the g++ compiler,
changed the linker ($CCLD) to g++, and let everything else be compiled by
the default CC (gcc).  The common gcc/g++ optimizing options were -O3

Speed (ms) for fully-optimized NSAMPLE with -:s that gave best nursery size
setjmp/longjump without -fomit-frame-pointer - 380, 380, 386, 390, 386
setjmp/longjump with -fomit-frame-pointer    - always crashes
try/catch/throw with -fomit-frame-pointer    - 416, 433, 450, 420, 413

So we can just take out the -fomit-frame-pointer option on MinGW; it might
be a good idea though to use the above technique if similar problems exists
on other platforms.
P.S. I don't think the mingw subdirectory is needed anymore.  It was made to
build MinGW from within Cygwin; however, the MSYS environment that comes
with MinGW has proper autoconf/automake capabilities now.


reply via email to

[Prev in Thread] Current Thread [Next in Thread]