Re: __memmove_avx_unaligned_erms throws segmentation fault in release mode

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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




[Index of Archives]     [Linux C Programming]     [Linux Kernel]     [eCos]     [Fedora Development]     [Fedora Announce]     [Autoconf]     [The DWARVES Debugging Tools]     [Yosemite Campsites]     [Yosemite News]     [Linux GCC]

  Powered by Linux