Segmentation fault during shutdown on WSL
还没有人认领这个 Issue。
- 主要语言
- C++
- 星标
- 2.2k
- 派生
- 242
- 平均合并
- 11 分钟
- 30 天内合并 PR
- 1
描述
I have this simple program:
#include <polyscope/polyscope.h>
#include <polyscope/surface_mesh.h>
int main()
{
polyscope::init();
std::vector<std::array<double, 3>> vertices{{0, 0, 0}, {1, 0, 0}, {1, 1, 0}};
std::vector<std::array<int, 3>> faces{{0, 1, 2}};
std::vector<double> scalars{0.0, 1.0, 2.0};
polyscope::registerSurfaceMesh("my mesh", vertices, faces);
polyscope::getSurfaceMesh("my mesh")->addVertexScalarQuantity("my_scalar", scalars)->setEnabled(true);
polyscope::show();
}
I'm running it on WSL, backend:
[polyscope] Backend: openGL3_glfw -- Loaded openGL version: 4.1 (Core Profile) Mesa 23.2.1-1ubuntu3.1~22.04.3
Polyscope is at the latest master version (except the very latest commit which breaks compilation btw).
The program runs fine, but when I close the window, I get
Segmentation fault (core dumped)
I debugged into it and the crash happens at gl_engine.cpp, in the destructor of GLTextureBuffer:
GLTextureBuffer::~GLTextureBuffer() {
glDeleteTextures(1, &handle);
}
The call to glDeleteTextures is still reached, and the crash seems to happen within it. I verified that handle is a reasonable-looking number (34 in my case). If I remove setEnabled(true) and don't manually enable the scalar field either, the crash goes away. Let me know if I can provide any more info to debug this...
贡献指南
这个仓库没有索引到贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
调研方向
使用提供的 C++ 程序在 WSL 上复现关闭时的崩溃,重点关注已启用的标量量。从 gl_engine.cpp 中的 GLTextureBuffer::~GLTextureBuffer() 开始,该处报告 glDeleteTextures 失败;当关闭窗口不再导致段错误时即表示完成,包括使用 setEnabled(true) 的情况。
由索引模型根据 Issue 内容生成。
评估
- 技术栈
- cpp
- 领域
- computer-graphics
- Issue 类型
- 缺陷
- 难度
- 3/5
- 预计耗时
- 1-2 天
- 活跃度
- 停滞
- 描述清晰度
- 基本清楚
- 新手友好度
- 42/100