Le 19/10/2015 20:32, Georg Baum a écrit :
Guillaume Munch wrote:
The choice is simple, because just adding a new variable member to math
insets as per the attached (trivial) .diff leads to new segfaults with
math macros. The .diff must be applied to current master (before or
after my upcoming TexRow patches). Compiler is g++ 4.9.2 in C++11 mode
(I did not try with C++98). Then open the attached segv-math-demo.lyx,
select all and hold Ctrl+C until it crashes (not more than a few seconds).
This makes me a bit nervous (not because of your changes of course).
The crash does not occur if we only apply the diff on InsetMath.h, i.e.
if we change the structure of the class but leave the new member
uninitialized. (An ironic twist on the g++-5 crash-on-copy bug which
occurs when some variables are not initialized that I saw passing on the
list, if you want.)
Incidentally this bug was fixed last week:
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=67557. Therefore we should try
this with a fixed gcc. I would very much appreciate it if you have the time
to do so, if not I am going to do that but this may take a week or two.
So it seems in that mathed/ is in a brittle state. This is a deeper
reason for just using pointers for now. This seems serious. Or did
I miss something obvious to C++ experts?
I don't think so. If we are lucky then it is not mathed that is in a brittle
state, but gcc in C++11 mode, and in that case we should warn users not to
use C++11 mode with current gcc.
I hope I did not put you on a wrong track with my reference to the gcc-5
bug, which was more of a joke (because the the conditions to trigger it
were *the contrary*). It displays more resemblance with the kind of bugs
with math macros fixed by Enrico recently. To be sure, I tried in c++98
mode and it crashes as well. I think it is useless to try with gcc-5
now. Or do you still want me to?
Let's be nervous from now on when making changes to mathed/.
I archive this in a bug report?
Guillaume