[BUG] OpenImageIO's default thread pool initialization has a data race.

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

Maintainer thường phản hồi trong vòng 1 ngày

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

Đánh giá

Độ khó
4/5
Thời gian dự kiến
3-5 ngày
Mức phù hợp với người mới
35/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
backend, performance

Hướng nghiên cứu

Bắt đầu với chuỗi lời gọi thread_pool::thread_pool → thread_pool::Impl::Impl → resize → set_thread được mô tả trong issue. Tái hiện quá trình khởi tạo dưới ThreadSanitizer và kiểm tra thời điểm worker lambda truy cập Impl::q so với quá trình xây dựng. Công việc được xem là hoàn tất khi data race được báo cáo đã được loại bỏ và lỗi ThreadSanitizer không còn xảy ra.

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

Mô tả

Describe the bug

A clear and concise description of what the bug is. What happened, and
what did you expect to happen instead.

OpenImageIO's default thread pool initialization seems to have a data race.
In OpenImageIO 2.4.8 (and it seems to still be the same in upstream main)

thread_pool::thread_pool
-> thread_pool::Impl::Impl
-> thread_pool::Impl::resize
-> thread_pool::Impl::set_thread
-> starts a new thread using the lambda f
-> that lambda references thread_pool::Impl::q before thread_pool::Impl's constructor has finished on the main thread

Full TSAN error with proprietary parts of the stack removed beloe

OpenImageIO version and dependencies

2.4.8

Evidence

  • Error messages (paste them here exactly)
  • Screenshots (if helpful)
  • Example input: If the problem only happens with certain image files, please
    attach the smallest image you can make that reproduces the problem.

IF YOU ALREADY HAVE A CODE FIX: There is no need to file a separate issue,
please just go straight to making a pull request.

Ngôn ngữ chính
C++
Star
2.4k
Fork
716
Merge trung bình
2 ngày 8 giờ
Pull request đã merge (30 ngày)
89

Chuẩn bị môi trường

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 AcademySoftwareFoundation/OpenImageIO

Tất cả issue của AcademySoftwareFoundation/OpenImageIO

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.