>Try to find the bug of your code with warnings, sanitizers, or >-D_GLIBCXX_DEBUG. I used this: CXXFLAGS = -Wall -O2 -g3 -fPIC -std=c++11 -frecord-gcc-switches -D_GLIBCXX_DEBUG But it seems that this is not a correct place or the syntax is wrong because I see [ 10a] -D _GLIBCXX_DEBUG In the output of readelf command. Regards, Mahmood On Friday, July 9, 2021, 9:57:26 AM GMT+2, Xi Ruoyao <xry111@xxxxxxxxxxxxxxxx> wrote: On Thu, 2021-07-08 at 16:42 +0000, Mahmood N via Gcc-help wrote: > Hi > > I see that my program works fine in the debug mode, but not in the > release mode. With GDB I was able to find the function that got error. > The code looks like > > > > std::vector<std::vector<inst_trace_t> *> threadblock_traces; > ... > printf("hello %d\n",threadblock_traces.size()); At least you can't use "%d" to print the result of std::vector<T>::size() (which is not an `int`). > trace_kernel.get_next_threadblock_traces(threadblock_traces); > Try to find the bug of your code with warnings, sanitizers, or -D_GLIBCXX_DEBUG. -- Xi Ruoyao <xry111@xxxxxxxxxxxxxxxx> School of Aerospace Science and Technology, Xidian University