Hacktoberfest 2026:維護者為十月標記出來的 issue,仍然開放、適合新手。 瀏覽 Hacktoberfest issue

Segmentation fault during shutdown on WSL

未關閉
#336 0 則留言 0 個 reaction 已指派 0 人 在 GitHub 檢視

還沒有人認領這個 Issue。

評估

難度
3/5
預估耗時
1-2 天
新手友好度
42/100
Issue 類型
缺陷
描述清晰度
基本清楚
活躍度
停滯
技術堆疊
cpp

研究方向

使用提供的 C++ 程式在 WSL 上重現關閉時的當機,重點關注已啟用的純量量。從 gl_engine.cpp 中的 GLTextureBuffer::~GLTextureBuffer() 開始,該處回報 glDeleteTextures 失敗;當關閉視窗不再導致區段錯誤時即表示完成,包括使用 setEnabled(true) 的情況。

由索引模型根據 Issue 內容生成。

描述

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...

主要語言
C++
星號
2.2k
分支
242
平均合併
11 分鐘
30 天內合併 PR
1

貢獻指南

這個儲存庫沒有索引到貢獻指南

從這裡開始

  1. 先讀完整個 Issue,再讀專案的貢獻指南。
  2. 在 Issue 下留言說明你要接手 —— 這能避免兩個人做同樣的事。
  3. Fork 儲存庫,在一個分支上完成修改。
  4. 送出 Pull Request,並在描述裡引用這個 Issue 編號。

nmwsharp/polyscope 的其他 Issue

查看 nmwsharp/polyscope 的全部 Issue

相似的 Issue

更多 C++ Issue

把新 issue 寄到你的電子郵件信箱

精選適合新手參與的 GitHub issue 摘要。