Segmentation fault during shutdown on WSL

Đang mở
#336 0 bình luận 0 reaction 0 người được giao Xem trên GitHub

Chưa có ai nhận issue này.

Đánh giá

Độ khó
3/5
Thời gian dự kiến
1-2 ngày
Mức phù hợp với người mới
42/100
Loại issue
Lỗi
Độ rõ ràng
Khá rõ ràng
Mức độ hoạt động
Đình trệ
Công nghệ
cpp
Lĩnh vực
computer-graphics

Hướng nghiên cứu

Tái hiện lỗi crash khi tắt trên WSL bằng chương trình C++ được cung cấp, tập trung vào đại lượng vô hướng đã được bật. Bắt đầu tại gl_engine.cpp, trong GLTextureBuffer::~GLTextureBuffer(), nơi được báo cáo là glDeleteTextures bị lỗi; công việc được xem là hoàn tất khi việc đóng cửa sổ không còn gây ra lỗi phân đoạn, kể cả khi sử dụng setEnabled(true).

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

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

Ngôn ngữ chính
C++
Star
2.2k
Fork
242
Merge trung bình
11 phút
Pull request đã merge (30 ngày)
1

Hướng dẫn đóng góp

Chưa lập chỉ mục được hướng dẫn đóng góp cho kho mã nguồn này

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của nmwsharp/polyscope

Tất cả issue của nmwsharp/polyscope

Issue tương tự

Thêm issue về C++

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.