|
From: | Dr . Jürgen Sauermann |
Subject: | Re: [Bug-apl] OpenBSD + GNU APL 1.8: Segfault immediately on apl startup |
Date: | Sun, 21 Jul 2019 17:40:23 +0200 |
User-agent: | Mozilla/5.0 (X11; Linux i686; rv:60.0) Gecko/20100101 Thunderbird/60.6.1 |
Hi Brian, that explains it. I am getting this: ++ constructing DynamicObject::all_values ++ constructing DynamicObject::all_index_exprs ++ constructing Workspace::the_workspace ++ constructing StateIndicator::top_level_error ++ constructing Quad_CR::fun ++ constructing Quad_EC::fun ++ constructing Quad_ES::fun ++ constructing Parallel::all_CPUs ++ constructing Macro::all_macros What happens here is that some macro (actually Macro::Z__LO_RANK_X5_B) uses ⎕CR before it was initialized. I have hand-crafted the initialization order according to my version of the C++ standard in such a way that ⎕CR, ⎕EC, and ⎕ES (the quad functions that occur in Macros) were explicitly initialized according to the rules in Chapter 3.6.2 "Initialization of non-local variables" of (my version of) the C++ standard. Since I was suspecting an initialization order problem, I browsed the web about this topic and learned that different C++ versions differ in the way they handle the initialization of static class variables. This is what we see here. The three Quad_XXX functions are uninitialized when Macro::all_macros needs them. There are a number of ways to deal with this: 1. It could simply be a compiler fault (which one are you using?). In that case the compiler should be fixed. 2. The compiler is correct and the problem is caused by different C++ versions. In that case you should nail down the C++ version to be used. For example with (try different versions, the older the better): CXXFLAGS= -std =c++11 ./configure3. I find a different way to control the initialization order in a different, C++ version independent, way. That may take a while though. The fact that you get a segfault remains disturbing. I can't quite see how cerr << endl could fail. However, the reason might be the same (CERR not initialized before it is used). I will look into fixing this. Best Regards, Jürgen Sauermann On 7/21/19 4:09 PM, Dr. Brian Callahan
wrote:
Hi Jürgen -- |
[Prev in Thread] | Current Thread | [Next in Thread] |