[BUG] Segmentation Fault when Running Unit Tests using Python Wheel

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

メンテナーはふだん 3 日以内に返信

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

評価

難易度
5/5
見積もり時間
1週間以上
初心者へのやさしさ
25/100
issue の種類
バグ
明瞭さ
説明が足りない
活発さ
停滞
技術スタック
cpp, python

調査の方向性

colour/io/image.py の write_image_OpenImageIO と、colour/io/tests/test_image.py の test_write_image_OpenImageIO から始め、添付された Windows と Ubuntu のログ、および OpenImageIO 3.0.6.1 wheel のコンテキストを確認してください。報告されたプラットフォームで pytest と xdist を使ってテストを再現してください。wheel のテストが断続的にハングしたり、segmentation fault を起こしたり、終了していない worker node を残したりしなくなれば完了です。

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

説明

Describe the bug

This is just to create an issue related to this very long thread on Slack: https://academysoftwarefdn.slack.com/archives/C05782U3806/p1743211403165799

There were multiple problems and @lgritz fixed one here: https://github.com/AcademySoftwareFoundation/OpenImageIO/pull/4685

I still however have issues with the Python wheels were occasionally, unit tests ran with Pytest and xdist are sometimes Segfaulting and/or hanging the test thread:

Windows fatal exception: access violation
Thread 0x00000da8 (most recent call first):
  File "C:\hostedtoolcache\windows\Python\3.11.9\x64\Lib\threading.py", line 331 in wait
  File "C:\hostedtoolcache\windows\Python\3.11.9\x64\Lib\threading.py", line 629 in wait
  File "D:\a\colour\colour\.venv\Lib\site-packages\tqdm\_monitor.py", line 60 in run
  File "C:\hostedtoolcache\windows\Python\3.11.9\x64\Lib\threading.py", line 1045 in _bootstrap_inner
  File "C:\hostedtoolcache\windows\Python\3.11.9\x64\Lib\threading.py", line 1002 in _bootstrap
Thread 0x000012dc (most recent call first):
  File "D:\a\colour\colour\.venv\Lib\site-packages\execnet\gateway_base.py", line 534 in read
  File "D:\a\colour\colour\.venv\Lib\site-packages\execnet\gateway_base.py", line 567 in from_io
  File "D:\a\colour\colour\.venv\Lib\site-packages\execnet\gateway_base.py", line 1160 in _thread_receiver
  File "D:\a\colour\colour\.venv\Lib\site-packages\execnet\gateway_base.py", line 341 in run
  File "D:\a\colour\colour\.venv\Lib\site-packages\execnet\gateway_base.py", line 411 in _perform_spawn
Current thread 0x00000838 (most recent call first):
  File "D:\a\colour\colour\colour\io\image.py", line 702 in write_image_OpenImageIO
  File "D:\a\colour\colour\colour\io\tests\test_image.py", line 375 in test_write_image_OpenImageIO
  File "D:\a\colour\colour\.venv\Lib\site-packages\_pytest\python.py", line 159 in pytest_pyfunc_call
  File "D:\a\colour\colour\.venv\Lib\site-packages\pluggy\_callers.py", line 103 in _multicall
  File "D:\a\colour\colour\.venv\Lib\site-packages\pluggy\_manager.py", line 120 in _hookexec
  File "D:\a\colour\colour\.venv\Lib\site-packages\pluggy\_hooks.py", line 513 in __call__
  File "D:\a\colour\colour\.venv\Lib\site-packages\_pytest\python.py", line 1627 in runtest
  File "D:\a\colour\colour\.venv\Lib\site-packages\_pytest\runner.py", line 174 in pytest_runtest_call
  File "D:\a\colour\colour\.venv\Lib\site-packages\pluggy\_callers.py", line 103 in _multicall
  File "D:\a\colour\colour\.venv\Lib\site-packages\pluggy\_manager.py", line 120 in _hookexec
  File "D:\a\colour\colour\.venv\Lib\site-packages\pluggy\_hooks.py", line 513 in __call__
  File "D:\a\colour\colour\.venv\Lib\site-packages\_pytest\runner.py", line 242 in <lambda>
  File "D:\a\colour\colour\.venv\Lib\site-packages\_pytest\runner.py", line 341 in from_call
  File "D:\a\colour\colour\.venv\Lib\site-packages\_pytest\runner.py", line 241 in call_and_report
  File "D:\a\colour\colour\.venv\Lib\site-packages\_pytest\runner.py", line 132 in runtestprotocol
  File "D:\a\colour\colour\.venv\Lib\site-packages\_pytest\runner.py", line 113 in pytest_runtest_protocol
  File "D:\a\colour\colour\.venv\Lib\site-packages\pluggy\_callers.py", line 103 in _multicall
  File "D:\a\colour\colour\.venv\Lib\site-packages\pluggy\_manager.py", line 120 in _hookexec
  File "D:\a\colour\colour\.venv\Lib\site-packages\pluggy\_hooks.py", line 513 in __call__
  File "D:\a\colour\colour\.venv\Lib\site-packages\xdist\remote.py", line 195 in run_one_test
  File "D:\a\colour\colour\.venv\Lib\site-packages\xdist\remote.py", line 174 in pytest_runtestloop
  File "D:\a\colour\colour\.venv\Lib\site-packages\pluggy\_callers.py", line 103 in _multicall
  File "D:\a\colour\colour\.venv\Lib\site-packages\pluggy\_manager.py", line 120 in _hookexec
  File "D:\a\colour\colour\.venv\Lib\site-packages\pluggy\_hooks.py", line 513 in __call__
  File "D:\a\colour\colour\.venv\Lib\site-packages\_pytest\main.py", line 337 in _main
  File "D:\a\colour\colour\.venv\Lib\site-packages\_pytest\main.py", line 283 in wrap_session
  File "D:\a\colour\colour\.venv\Lib\site-packages\_pytest\main.py", line 330 in pytest_cmdline_main
  File "D:\a\colour\colour\.venv\Lib\site-packages\pluggy\_callers.py", line 103 in _multicall
  File "D:\a\colour\colour\.venv\Lib\site-packages\pluggy\_manager.py", line 120 in _hookexec
  File "D:\a\colour\colour\.venv\Lib\site-packages\pluggy\_hooks.py", line 513 in __call__
  File "D:\a\colour\colour\.venv\Lib\site-packages\xdist\remote.py", line 393 in <module>
  File "D:\a\colour\colour\.venv\Lib\site-packages\execnet\gateway_base.py", line 1291 in executetask
  File "D:\a\colour\colour\.venv\Lib\site-packages\execnet\gateway_base.py", line 341 in run
  File "D:\a\colour\colour\.venv\Lib\site-packages\execnet\gateway_base.py", line 411 in _perform_spawn
  File "D:\a\colour\colour\.venv\Lib\site-packages\execnet\gateway_base.py", line 389 in integrate_as_primary_thread
  File "D:\a\colour\colour\.venv\Lib\site-packages\execnet\gateway_base.py", line 1273 in serve
  File "D:\a\colour\colour\.venv\Lib\site-packages\execnet\gateway_base.py", line 1806 in serve
  File "<string>", line 8 in <module>
  File "<string>", line 1 in <module>
.............................................[gw0] node down: Not properly terminated

OpenImageIO version and dependencies

Python Wheel 3.0.6.1: https://pypi.org/project/OpenImageIO/3.0.6.1/

To Reproduce

This one is hard to reproduce as it is not occurring all the time and only on Windows. However, now that I'm writing this, we had some unit tests that have been occasionally hanging on Ubuntu also which is where we were testing our code OIIO before using the Wheels. So maybe this has been going for a while and the error only surfaced on Windows.

Those logs have both issues on Windows and Ubuntu:

4_windows-latest - Python 3.12.txt
7_ubuntu-latest - Python 3.10.txt

主要言語
C++
スター
2.4k
フォーク
727
平均マージ
4日 8時間
マージ済み PR(30日)
67

環境構築

はじめの一歩

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

AcademySoftwareFoundation/OpenImageIO のほかの issue

AcademySoftwareFoundation/OpenImageIO の issue をすべて見る

似ている issue

C++ の issue をもっと見る

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

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