On Sat, 2021-07-10 at 17:14 +0000, Mahmood Naderan via Gcc-help wrote: > OK. I tried to do some more tricks and got new signs of crash. > I edited the Makefile in the folder that trace_driven.cc is compiled > and instead of using -O3, I used -O1 and now I get > > > free(): double free detected in tcache 2 It indicates a bug in your code (in 99.99% chance). Even if you paid money for a commercial compiler, its supporting team wouldn't help you to debug your code. > std::vector<std::vector<inst_trace_t> *> threadblock_traces; > for (unsigned i = start_warp; i < end_warp; ++i) { > trace_shd_warp_t *m_trace_warp = static_cast<trace_shd_warp_t > *>(m_warp[i]); > m_trace_warp->clear(); > threadblock_traces.push_back(&(m_trace_warp->warp_traces)); > } > trace_kernel_info_t &trace_kernel = > static_cast<trace_kernel_info_t &>(kernel); > printf("hello %d\n",threadblock_traces.size()); > trace_kernel.get_next_threadblock_traces(threadblock_traces); There is no way to determine if this snippnet is correct, as its behavior depends on what "m_trace_wrap" is, what "clear" does, etc. And you are still using %d for size_t, which is an undefined behavior. It seems you don't know what undefined behavior is, so it's very likely there are more cases of undefined behavior in your code. -- Xi Ruoyao <xry111@xxxxxxxxxxxxxxxx> School of Aerospace Science and Technology, Xidian University