segmentation-fault - 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.
解决方案
我发现了这个问题。我未能初始化这个handler->data。
推荐阅读
- javascript - 前一个表达式的后缀结果
- python - 如何将平面列表输出转换为嵌套列表?
- javascript - 在 vuejs 中显示验证错误时出错?
- zapier - 如何在 Zapier 中编写嵌套的 IF 语句?
- python - 使用数据生成器训练 Keras 多输入模型会产生输入形状错误:(层模型需要 5 个输入,但它接收到 40 个输入张量。)
- algorithm - 最佳行/列配对算法
- laravel - Laravel 有一个通过
- javascript - 使用 iframe 时 Javascript 字符串替换不起作用
- android - 设置初始位置中的 ACTION_OPEN_DOCUMENT_TREE 错误
- asp.net-core-webapi - 使用 ServiceStack 对 API 进行 Azure B2C 身份验证