nmwsharp / nmwsharp/polyscope

Segmentation fault during shutdown on WSL

オープン
#336 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

まだ誰も着手していません。

主要言語
C++
スター
2.2k
フォーク
242
平均マージ
11分
マージ済み PR(30日)
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...

コントリビューションガイド

このリポジトリのコントリビューションガイドは索引されていません

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

調査の方向性

提供された C++ プログラムを使って WSL でのシャットダウン時のクラッシュを再現し、有効化されたスカラー量に焦点を当てます。gl_engine.cpp の GLTextureBuffer::~GLTextureBuffer() から調査を開始します。ここでは glDeleteTextures が失敗すると報告されています。setEnabled(true) を使用した場合も含め、ウィンドウを閉じてもセグメンテーションフォルトが発生しなくなれば完了です。

索引モデルが issue の本文から書いたものです。

評価

技術スタック
cpp
領域
computer-graphics
issue の種類
バグ
難易度
3/5
見積もり時間
1〜2日
活発さ
停滞
明瞭さ
おおむね明確
初心者へのやさしさ
42/100

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。