How to debug g ++ segmentation error?

I tried to compile the code using g ++ 4.4.6 on aix 6.1. I do not have gdb. After compilation, a segmentation error is displayed: -

../test/Corner.h: In member function 'void VirtualFlow<T>::vector_flow(typename T::Data**, typename T::Data**) [with T = NProcess<or_func<NetAndVal<ZVal2>, with_derivatives>, ConvexNoOverlapSize<16, 16, Multiply<65536l, AllPass<CornerT<NetAndVal<ZVal2> >, NoFlow<CornerT<NetAndVal<ZVal2> > > > > > >]': ../test/Corner.h:369: internal compiler error: Segmentation fault 

I tried using the -g option to create the .o file and searched for the problem.

 opt/freeware/bin/g++ -g ConnectFlow2.C -o ConnectFlow2.o 

but I could not debug.

Tell us how to debug a segmentation error.

Thanks.

+4
source share
3 answers

I suggest updating your GCC compiler (since your old 4.4 compiler will work). Try to get the source code of GCC 4.6 then create it.

Do not forget to worry about dependencies and carefully read and follow the instructions (in particular, do not create the source directory!).

If you really want to debug your compiler yourself, rebuild it from the source and recompile it with -g

+1
source

Simplify the code to leave the minimum minimum for which ICE still exists and send the bug report to the GCC project. They have a much higher chance of resolving this than you.

+2
source

This is just an assumption, but it would be worth trying to increase the depth of the template with -ftemplate-depth-103 . I don’t know what the default value is and how deep your template structure is.

+1
source

Source: https://habr.com/ru/post/1383047/


All Articles