Hacktoberfest 2026:メンテナが10月に向けて印を付けた、オープンで初心者向けの issue。 Hacktoberfest の issue を見る

Intermittent crash in LLVM_Util::getPointerToFunction(llvm::Function* func)

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

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

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

評価

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

調査の方向性

1712 行目で報告されている LLVM_Util::getPointerToFunction() から開始し、BackendLLVM::run() から exec->finalizeObject() への呼び出しを追跡します。説明されている 3ds Max シーンを使用し、一覧にある OSL、LLVM、OIIO、Windows、Visual Studio のバージョンで、レンダーおよびマテリアル エディタのパラメーターを同時にインタラクティブ操作します。このワークロードで断続的なクラッシュを再現して解決するか、何らかの形で防止できれば完了です。

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

説明

Problem

In 3ds max, we have lots of users crashing with a callstack that seems to be caused by this problem.
We have a scene that "reproduces" the problem, but the reproduction is intermittent and seems to a race condition of sorts.
Basically, you load a particular file, you start an interactive render and the material editor at the same time, then start changing parameters in the material many many many many many times. Eventually, we get this crash. Or not. Depending on phase of the moon, the wind direction, humidity, etc.

Crash is reported on this line:

image

...i.e. in the case this function is reached before the shader has been optimized. Somehow, it seems like the call to exec->finalizeObject(); crashes.

The call stack is something like this:

oslexec.dll!OSL_v1_12::pvt::LLVM_Util::getPointerToFunction(llvm::Function * func) Line 1712 C++
oslexec.dll!OSL_v1_12::pvt::BackendLLVM::run() Line 1674 C++
oslexec.dll!OSL_v1_12::pvt::ShadingSystemImpl::optimize_group(OSL_v1_12::ShaderGroup & group, OSL_v1_12::ShadingContext * ctx, bool do_jit) Line 3595 C++
oslexec.dll!OSL_v1_12::ShadingContext::execute_init(OSL_v1_12::ShaderGroup & sgroup, int shadeindex, OSL_v1_12::ShaderGlobals & ssg, void * userdata_base_ptr, void * output_base_ptr, bool run) Line 91 C++
oslexec.dll!OSL_v1_12::ShadingContext::execute(OSL_v1_12::ShaderGroup & sgroup, int shadeindex, OSL_v1_12::ShaderGlobals & ssg, void * userdata_base_ptr, void * output_base_ptr, bool run) Line 217 C++
oslexec.dll!OSL_v1_12::pvt::ShadingSystemImpl::execute(OSL_v1_12::ShadingContext & ctx, OSL_v1_12::ShaderGroup & group, int index, OSL_v1_12::ShaderGlobals & ssg, void * userdata_base_ptr, void * output_base_ptr, bool run) Line 3264 C++
[Inline Frame] OSLMap.dlt!OSL_v1_12::ShadingSystem::execute(OSL_v1_12::ShadingContext &) Line 688 C++
[Inline Frame] OSLMap.dlt!OSL_v1_12::ShadingSystem::execute(OSL_v1_12::ShadingContext *) Line 695 C++
OSLMap.dlt!OSLTex::EvalColor(ShadeContext & sc, int output, bool bump) Line 3227 C++
OSLMap.dlt!OSLTex::EvalColor(ShadeContext & sc) Line 2936 C++
3dsmax.exe!RenderTexmapRange::l5::<lambda_1>::operator()(const tbb::blocked_range & rng) Line 1951 C++
[Inline Frame] 3dsmax.exe!tbb::interface9::internal::start_for<tbb::blocked_range,RenderTexmapRange'::5'::<lambda_1>,tbb::auto_partitioner const>::run_body(tbb::blocked_range &) Line 115 C++
3dsmax.exe!tbb::interface9::internal::dynamic_grainsize_mode<tbb::interface9::internal::adaptive_modetbb::interface9::internal::auto_partition_type>::work_balance<tbb::interface9::internal::start_for<tbb::blocked_range,RenderTexmapRange'::5'::<lambda_1>,tbb::auto_partitioner const>,tbb::blocked_range>(tbb::interface9::internal::start_for<tbb::blocked_range,RenderTexmapRange'::5'::<lambda_1>,tbb::auto_partitioner const> & start, tbb::blocked_range & range) Line 439 C++
3dsmax.exe!tbb::interface9::internal::start_for<tbb::blocked_range,RenderTexmapRange'::5'::<lambda_1>,tbb::auto_partitioner const>::execute() Line 143 C++
[External Code]
[Inline Frame] 3dsmax.exe!tbb::task::spawn_root_and_wait(tbb::task &) Line 809 C++
[Inline Frame] 3dsmax.exe!tbb::interface9::internal::start_for<tbb::blocked_range,RenderTexmapRange'::5'::<lambda_1>,tbb::auto_partitioner const>::run(const tbb::blocked_range &) Line 95 C++
[Inline Frame] 3dsmax.exe!tbb::parallel_for(const tbb::blocked_range &) Line 201 C++
3dsmax.exe!RenderTexmapRange(HWND
* hwnd, Texmap * tx, Bitmap * bm, FBox2 * range, float scale3d, int filter, int display, int t, const wchar_t * name, float z, int mono, bool disableBitmapProxies, bool bake) Line 1925 C++
3dsmax.exe!RenderTexmap(HWND__ * hwnd, Texmap * tex, Bitmap * bm, float scale3d, int filter, int display, int t, const wchar_t * name, float z, int mono, bool disableBitmapProxies, bool bake) Line 1877 C++
3dsmax.exe!InterfaceImp::Execute(int cmd, unsigned __int64 arg1, unsigned __int64 arg2, unsigned __int64 arg3, unsigned __int64 arg4, unsigned __int64 arg5, unsigned __int64 arg6) Line 6844 C++
core.dll!Texmap::GetVPDisplayDIB(int t, TexHandleMaker & thmaker, Interval & valid, int mono, int forceW, int forceH) Line 3851 C++

Expected behavior:

It not to crash?

Actual behavior:

It crash. Sometimes.

Steps to Reproduce
  1. [First Step]
  2. [Second Step]
  3. [and so on...]
Versions
  • OSL branch/version: Internal Autodesk fork of OSL 1.12.13
  • OS: Windows
  • C++ compiler: Visual Studio 2019 / 2022
  • LLVM version: llvm-14.0.6-3dsmax-001-osl_subset-vc142.7z
  • OIIO version: OpenImageIO-2.4.5.0-3dsmax-002-vc142.zip
主要言語
C++
スター
2.3k
フォーク
414
平均マージ
2日 14時間
マージ済み PR(30日)
13

環境構築

はじめの一歩

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

AcademySoftwareFoundation/OpenShadingLanguage のほかの issue

AcademySoftwareFoundation/OpenShadingLanguage の issue をすべて見る

似ている issue

C++ の issue をもっと見る

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

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