Hacktoberfest 2026: le issue che i maintainer hanno segnato per ottobre, aperte e adatte ai principianti. Sfoglia le issue Hacktoberfest

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

Aperta
#1,712 14 commenti 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
5/5
Tempo stimato
Più di una settimana
Idoneità per principianti
25/100
Tipo di issue
Bug
Chiarezza
Da chiarire
Stato di attività
Ferma
Stack tecnologico
cpp

Direzione di ricerca

Inizia da LLVM_Util::getPointerToFunction(), indicato alla riga 1712, e segui la chiamata da BackendLLVM::run() a exec->finalizeObject(). Usa la scena di 3ds Max descritta e modifiche interattive simultanee ai parametri del rendering e dell’editor dei materiali con le versioni elencate di OSL, LLVM, OIIO, Windows e Visual Studio. Il lavoro è completato quando il crash intermittente viene riprodotto e risolto, oppure impedito in altro modo, con questo carico di lavoro.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

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
Lingua principale
C++
Stelle
2.3k
Fork
414
Merge medio
4g 2h
PR unite (30g)
19

Preparare l'ambiente

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di AcademySoftwareFoundation/OpenShadingLanguage

Tutte le issue di AcademySoftwareFoundation/OpenShadingLanguage

Issue simili

Altre issue su C++

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.