c++ - 带有 AddressSanitizer 的 std::system_error 说:“也许你正在使用 ulimit -v”
问题描述
我有一个多线程程序,它抛出一个std::system_error
并且我不知道这个错误的来源,所以我尝试在启用地址清理器的调试模式下运行它。Asan 首先告诉它未能在特定地址上分配一定数量的字节,然后它报告:failed to write xxxx bytes: Perhaps you are using ulimit -v
我不明白使用 ulimit -v 是什么意思。我检查了 ulimit -a 的输出,我的虚拟内存设置为无限制。
我不知道如何跟踪这个问题以及我应该从 Asan 的报告中理解什么。下面是我的堆栈跟踪,我正在使用 bazel 进行编译和调试。
terminate called after throwing an instance of 'std::system_error'
what(): Resource temporarily unavailable
*** Aborted at 1620157055 (unix time) try "date -d @1620157055" if you are using GNU date ***
external/com_google_glog/src/signalhandler.cc:229:16: runtime error: applying non-zero offset 18446744073709551615 to null pointer
PC: @ 0x0 (unknown)
*** SIGABRT (@0x3f4001b07bd) received by PID 1771453 (TID 0x7fb788c2a700) from PID 1771453; stack trace: ***
@ 0x7fb7a24243c0 (unknown)
==1771453==ERROR: AddressSanitizer failed to allocate 0xfe000 (1040384) bytes at address fef8bbb0000 (errno: 12)
==1771453==ReserveShadowMemoryRange failed while trying to map 0xfe000 bytes. Perhaps you're using ulimit -v
==1771453==ERROR: AddressSanitizer failed to allocate 0x11000 (69632) bytes at address ff76912c000 (errno: 12)
==1771453==ReserveShadowMemoryRange failed while trying to map 0x11000 bytes. Perhaps you're using ulimit -v
@ 0x7fb7a189118b gsignal
@ 0x7fb7a1870859 abort
@ 0x7fb7a261f951 (unknown)
==1771453==ERROR: AddressSanitizer failed to deallocate 0x8000 (32768) bytes at address 0x7fb78cb5b000
==1771453==AddressSanitizer CHECK failed: ../../../../src/libsanitizer/sanitizer_common/sanitizer_posix.cc:60 "(("unable to unmap" && 0)) != (0)" (0x0, 0x0)
==1771453==ERROR: AddressSanitizer failed to allocate 0x1000 (4096) bytes of ReadFileToBuffer (error code: 12)
ERROR: Failed to mmap
解决方案
推荐阅读
- javascript - javascript添加中的奇怪行为
- macos - 将 mac 绑定到 AD 时未找到节点名称 (2000) 错误
- postgresql - 用作 DatawareHouse 的 Postgresql 调优
- python - 如何在 Ubuntu 上配置 python 3.7?
- r - 按另一个数据帧的行值子集数据帧
- android - 适用于 Galaxy S8+(型号 G955U)的应用程序未显示在 Google Play 商店中,可能是什么问题?
- c# - Base64.getEncoder().encode 并在 C# 中生成 PDF
- php - 从 Wordpress 中仅排除标签 x 上的第一篇文章
- c# - 如何在 Xamarin Forms 中的其他项目之上(之上)显示 ListView?
- r - R - 同时用动态滞后数据修改几个相互关联的列