c - 是什么原因导致 libzmq.dll 崩溃?

标签 c debugging zeromq

我有一个在 .NET Framework 4.0 x64 上运行的 x64 C# 应用程序,该应用程序对 clrzmq 使用 ZeroMQ -x64 2.2.2(来自 NuGet)。

当我调试它(​​即 F5)时它工作正常,但它每秒只发送大约 30 条消息。如果我不附加调试器(即 CTRL-F5),它每秒会管理超过 1000 条消息...但它会在大约 30 秒后崩溃。

我无法诊断问题,因为崩溃的点不在我的代码中。

我已经粘贴了我能找到的所有可能有用的信息,但我很难知道如何解释堆栈跟踪。

事件日志:

Faulting application name: MyApplication.exe, version: 1.0.0.0, time stamp: 0x4f5a05b3
Faulting module name: MSVCR100.dll, version: 10.0.40219.325, time stamp: 0x4df2bcac
Exception code: 0x40000015
Fault offset: 0x00000000000761c9
Faulting process id: 0x273c
Faulting application start time: 0x01ccfdf8acdc087e
Faulting application path: [path redacted]\MyApplication.exe
Faulting module path: C:\Windows\system32\MSVCR100.dll
Report Id: f3518caf-69eb-11e1-9ed1-50e549e1c0d9

堆栈跟踪:

msvcr100.dll!__crt_debugger_hook()  
msvcr100.dll!_call_reportfault()  + 0x124 bytes 
msvcr100.dll!abort()  + 0x35 bytes  
libzmq.dll!zmq::signaler_t::make_fdpair(unsigned __int64 * r_=0x000000002c557ee0, unsigned __int64 * w_=0x000007feedcb7ad2)  Line 263   C++
libzmq.dll!zmq::signaler_t::signaler_t()  Line 80   C++
libzmq.dll!zmq::mailbox_t::mailbox_t()  Line 26 + 0x17 bytes    C++
libzmq.dll!zmq::socket_base_t::socket_base_t(zmq::ctx_t * parent_=0x0000000027e3e470, unsigned int tid_=4294967294)  Line 124 + 0x6b bytes  C++
libzmq.dll!zmq::push_t::push_t(zmq::ctx_t * parent_=0x0000000076e3e3db, unsigned int tid_=0)  Line 30 + 0xe bytes   C++
libzmq.dll!zmq::socket_base_t::create(int type_=43532552, zmq::ctx_t * parent_=0x0000000002984130, unsigned int tid_=43532512)  Line 100 + 0x29 bytes   C++
libzmq.dll!zmq::ctx_t::create_socket(int type_=489832384)  Line 184 + 0xe bytes C++
clr.dll!DoNDirectCall__PatchGetThreadCall()  + 0x7b bytes   
000007ff00168461()  
000007ff0016833f()  
000007ff00166b22()  
000007ff00166997()  
mscorlib.ni.dll!000007fef4669e70()  
[Frames below may be incorrect and/or missing, no symbols loaded for mscorlib.ni.dll]   
00000000030bd4c0()  
0000000027e3e9c8()  
mscorlib.ni.dll!000007fef4094568()  
clr.dll!JIT_IsInstanceOfAny()  + 0x20 bytes 
mscorlib.ni.dll!000007fef465e56b()  
00000000030bd560()  
00000000006f8d10()

最佳答案

这是https://github.com/zeromq/libzmq/pull/491

基本上,在繁忙的 Windows 系统上,频繁创建和销毁许多 ZMQ 套接字,创建套接字意味着创建一对内部套接字,并且如果使用上面显示的相同堆栈,这可能会失败。更糟糕的是,在非调试构建上,异常会导致套接字创建代码放弃所采用的关键部分,从而导致后续的套接字创建尝试永远挂起。

上面的链接有一个修复,我们在我输入此内容时正在测试该修复。

关于c - 是什么原因导致 libzmq.dll 崩溃?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/9635068/

相关文章:

Java - 数组输出 null

android - 在设备上调试 Ionic 3 代码

python - Zeromq 请求/响应示例显示 Python 中队列的使用?

python - pyzmq:套接字因 "ZMQError: Operation cannot be accomplished in current state"中断

c - 免费功能的使用

c - 在 C 中提取和操作字符串?

c - GDB 跳过共享库断点

java - import org.zeromq 无法解析,我该怎么办?

valgrind 对未初始化值的提示可能是误报吗?

c - 警告 : format ‘%f’ expects type ‘float *’ , 但参数 4 的类型为 ‘int *’