首页 > 解决方案 > SIGSEGV, Segmentation fault with memcpy_avx_unaligned

问题描述

I am trying to copy 4 bytes form s to handler->data didn't understand the error.

Tried to debug with gdb, but everything looks good.

memcpy(handler->data + handler->len, s->begin, num_bytes);   
(gdb) p handler->data   
$5 = (uint8_t *) 0x0   
(gdb) p s->begin   
$6 = (const uint8_t *) 0x7ffcfda705b2 "D"   
(gdb) s  
__memcpy_avx_unaligned () at ../sysdeps/x86_64/multiarch/memcpy-avx-unaligned.S:41 41     
../sysdeps/x86_64/multiarch/memcpy-avx-unaligned.S: No such file or directory.

标签: segmentation-faultgdbmemcpy

解决方案


我发现了这个问题。我未能初始化这个handler->data


推荐阅读