Dear Richy, Happy new year! On Wed, 5 Jan 2005, Richard B. Kreckel wrote:
Chris, I'm afraid you introduced a new static initialization order problem when you sent us your integral.cpp file. You cannot initialize static ex integral::relative_integration_error like you do in integral.cpp:206.
Hmmm... Wait a minute... If I understand correctly, this means that initialization of integral::relative_integration_error occurs before the initialization of the library_init of the same file integral.o as well as before the initialization of all other library_init objects in all GiNaCs other object files. Isn't this a bit strange??? I mean, can't the runtime environment (or whatever it is called) just initialize static objects in the same order as they are defined in the preprocessed C++-code??? If the order of static initialization were the same as the order of definition were the same, there would not be a problem, right?
Would you please be so kind and sent a patch to this list for my review?
I would suggest the change in the attached patch, since the functions that are used in this patch do not seem to involve any static variables. Unfortunately I do not know how to test this, because at my place no crash occured in the first place. Do you think this is sufficient to avoid a crash in all cases? Best wishes, Chris