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

RE: "scheme_setjmp" under Windows DLL?



> It is incredible. It is true, not it's working.
> I don't know assembler language but could you give me a little explanation?
	As it is said in the error message, this could result from a mixing in 
function calling conventions but, in a more general way, this results from one 
messing with the stack, for instance by declaring a local array (not allocated 
in the heap) and setting items at incorrect indexes.
	Internal control of stack integrity is enforced only in debug releases, 
through assertions, so that you may not see such messages in release builds, 
which does not mean that you just have to make release builds to have the 
message disappear :  you really should take this into account.  So, if you made 
a typo and actually meant to write "now it's working", I guess it isn't so : 
 indeed, no error is detected in release build but that is just because 
assertions are not checked, and your program is still doing something wrong 
with the stack.  You may not take this into consideration, as the error occurs 
just before the end of your program, but this would not be a very clean way to 
handle this problem...
	By the way, you can't draw much conclusions from the place at which the 
assertion is triggered, as errors with heap/stack usually produce effects that 
are detected later on, maybe even at program termination, when the control flow 
returns from the main function to the runtime library !
	So if you are sure that you are not mixing calling conventions, either there 
is something wrong with setjump/longjump (could data stored by setjump be 
messed up ?), or some local variables are _very_ wrongly used (I write very 
because longjump is supposed to restore the stack in the very exact state it 
was saved by setjump).  If you have access to the entire source code, you may 
use very good tools to track such errors as Parasoft Insure++, or Rational 
Purify.
	Hope this helped,
		Yannis


======================================================================
                        http://www.esterel.org
CMA-EMP / INRIA                                 Le Saint Jean, bat G
2004, route des Lucioles                        48 ch. des Autrichiens
BP 93                                           06600 ANTIBES
06902 Sophia Antipolis Cedex                    FRANCE
FRANCE                                          (+33) (6) 60 38 79 52
(+33) (4) 92 38 71 71
======================================================================