boost.coroutine2 cannot generate dump
还没有人认领这个 Issue。
评估
- 难度
- 4/5
- 预计耗时
- 3-5 天
- 新手友好度
- 25/100
- Issue 类型
- 缺陷
- 描述清晰度
- 需要澄清
- 活跃度
- 停滞
- 技术栈
- cpp
调研方向
首先,在使用和不使用 boost.coroutine2 的情况下分别复现所提供的 Windows 示例,重点关注 CreateMiniDump、MyUnhandledExceptionFilter 和 CoroutineFunction。比较两种情况下的异常处理行为,并检查失败路径中涉及的 coroutine2 实现。确定原因并提供经过测试的修复方案或记录在案的限制后,即视为完成。
由索引模型根据 Issue 内容生成。
描述
windows, using boost.coroutine2, cannot generate dump (using mini dump) if a crash occurs in the coroutine function. As long as boost.coroutine2 is not used, the dump file can be generated. Is there something I'm missing?
Here is the code example:
#include <boost/coroutine2/all.hpp>
#include <Windows.h>
#include <dbghelp.h>
#include <iostream>
#pragma comment(lib, "Dbghelp.lib")
void CreateMiniDump(EXCEPTION_POINTERS* pep) {
HANDLE hFile = CreateFile(
"crashdump.dmp", // File name
GENERIC_WRITE, // Desired access
0, // Share mode
NULL, // Security attributes
CREATE_ALWAYS, // Creation disposition
FILE_ATTRIBUTE_NORMAL, // Flags and attributes
NULL // Template file
);
if (hFile != INVALID_HANDLE_VALUE) {
MINIDUMP_EXCEPTION_INFORMATION mdei;
mdei.ThreadId = GetCurrentThreadId();
mdei.ExceptionPointers = pep;
mdei.ClientPointers = FALSE;
BOOL rv = MiniDumpWriteDump(
GetCurrentProcess(),
GetCurrentProcessId(),
hFile,
MiniDumpNormal,
&mdei,
NULL,
NULL
);
if (rv == FALSE) {
std::cerr << "MiniDumpWriteDump failed: " << GetLastError() << std::endl;
}
CloseHandle(hFile);
}
}
// Exception filter to handle crashes
LONG WINAPI MyUnhandledExceptionFilter(EXCEPTION_POINTERS* pExceptionPointers) {
CreateMiniDump(pExceptionPointers);
return EXCEPTION_EXECUTE_HANDLER;
}
#pragma optimize("", off)
void CoroutineFunction(boost::coroutines2::coroutine<void>::push_type& yield) {
// Example code that may crash
std::cout << "CoroutineFunction Begin\n";
int* p = nullptr;
*p = 0; // This will cause a crash
std::cout << "CoroutineFunction End\n";
}
#pragma optimize("", on)
int main() {
SetUnhandledExceptionFilter(MyUnhandledExceptionFilter);
//
//int* p = nullptr;
//*p = 1000;
// Use Boost.Coroutine2
try {
boost::coroutines2::coroutine<void>::pull_type source(
[](boost::coroutines2::coroutine<void>::push_type& sink) {
CoroutineFunction(sink);
}
);
}
catch (const std::exception& e) {
std::cout << "Exception: " << e.what() << std::endl;
}
std::cout << "sssssssssssssssssssssssssssss\n";
char ch;
std::cin >> ch;
return 0;
}
- 主要语言
- C++
- 星标
- 139
- 派生
- 44
- PR 合并指标
- 30 天内没有已合并 PR
环境准备
这个项目没有提供开发容器、Dockerfile 或贡献指南,环境需要你自己搭建:先看它的 README,通用步骤见我们的新手贡献指南。
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
boostorg/coroutine2 的其他 Issue
-
难度 2/5 1-3 小时 新手友好度 50/100
boostorg/coroutine2#54 ·
-
难度 4/5 3-5 天 新手友好度 20/100
boostorg/coroutine2#49 ·
-
难度 5/5 一周以上 新手友好度 25/100
boostorg/coroutine2#37 ·
查看 boostorg/coroutine2 的全部 Issue
相似的 Issue
-
3.7.6-dev commit 80481ea - files not centered when resolution differs and zoom = "pixel-to-pixel"未关闭
难度 2/5 1-3 小时 新手友好度 78/100
grizzlypeak3d/DJV#931 ·
-
bug 🔥 pharesee
难度 2/5 1-3 小时 新手友好度 68/100
维护者通常 1 天内回复
-
bug tooling
难度 2/5 1-3 小时 新手友好度 76/100
-
BoundedVector::insert assigns to slots that were never constructed可能已有人在做 @auraseb 今天认领。 未关闭
难度 2/5 1-3 小时 新手友好度 78/100
philips-software/amp-embedded-infra-lib#1379 ·
维护者通常 2 天内回复
-
bot-triaged module: cpp module: deprecation module: optimizer triaged
难度 2/5 1-3 小时 新手友好度 70/100
维护者通常 1 天内回复