Crash creating and using OSLCompiler instances in mutliple threads
Los mantenedores suelen responder en 2 días
Nadie ha tomado este issue todavía.
Evaluación
- Dificultad
- 5/5
- Tiempo estimado
- Más de una semana
- Aptitud para principiantes
- 35/100
- Tipo de issue
- Error
- Claridad
- Bastante claro
- Estado de actividad
- Estancado
- Stack tecnológico
- cpp
- Área
- compilers, computer-graphics
Línea de trabajo
No se nombra ningún archivo ni prueba. Comienza con SymbolTable::delete_syms() y el TypeSpec::struct_list() compartido descrito en el informe, y luego rastrea su uso por parte de OSLCompiler y ShadingSystem. Se considerará completado cuando exista un diseño acordado de propiedad o sincronización para instancias concurrentes y haya evidencia de que se evita el fallo.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
Problem
In the Cycles renderer we are getting crashes doing different renders in different threads, each creating their own OSLCompiler instances. From #654 it appears that this is supposed to work.
I think I understand the cause and am willing to contribute a fix, but looking for advice on the best way to solve this.
What happens is that OSLCompiler ends up calling this in its destructor:
void
SymbolTable::delete_syms()
{
for (auto& sym : m_allsyms)
delete sym;
m_allsyms.clear();
TypeSpec::struct_list().clear();
}
This TypeSpec::struct_list() is a global variable used by OSLCompiler, and also ShadingSystem. So fully clearing it here is not safe.
I can think of a few solutions:
- Never clear this list and accept the memory usage.
ShadingSystemdoes not clear it as far as I can tell, so you already have this when not compiling shaders. - Add reference counting to only clear this list when there are zero classes using it. This also involves adding mutex protection in a bunch of places.
- Add a struct list per
OSLCompilerandShadingSystem, instead of making it global.
Solution (3) seems like the best to me, does that seem reasonable? Or is there some performance reason that this should be reused.
Versions
- OSL branch/version: master branch, 6b6637e
- OS: Ubuntu Linux
- C++ compiler: Clang
- Lenguaje dominante
- C++
- Estrellas
- 2.3k
- Forks
- 414
- Merge medio
- 4 d 16 h
- PR fusionados (30 d)
- 20
Preparar el entorno
- Sin Dockerfile ni archivo de Docker Compose
- Tiene una plantilla de pull request
- Leer la guía de contribución
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de AcademySoftwareFoundation/OpenShadingLanguage
-
build / testing / port / CI
Dificultad 2/5 1-3 horas Aptitud para principiantes 68/100
AcademySoftwareFoundation/OpenShadingLanguage#2148 · 5 comentarios ·
Los mantenedores suelen responder en 2 días
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 68/100
AcademySoftwareFoundation/OpenShadingLanguage#2109 · 1 reacción ·
Los mantenedores suelen responder en 2 días
-
build / testing / port / CI
Dificultad 5/5 Más de una semana Aptitud para principiantes 25/100
AcademySoftwareFoundation/OpenShadingLanguage#2182 · 4 comentarios ·
Los mantenedores suelen responder en 2 días
-
Tracesets handling proposalAbierto
Dificultad 5/5 Más de una semana Aptitud para principiantes 25/100
AcademySoftwareFoundation/OpenShadingLanguage#2146 ·
Los mantenedores suelen responder en 2 días
-
Dificultad 4/5 3-5 días Aptitud para principiantes 45/100
AcademySoftwareFoundation/OpenShadingLanguage#2135 ·
Los mantenedores suelen responder en 2 días
Todos los issues de AcademySoftwareFoundation/OpenShadingLanguage
Issues similares
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
KhronosGroup/Vulkan-Tutorial#534 ·
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 65/100
Los mantenedores suelen responder en 2 días
-
bug IO
Dificultad 2/5 1-3 horas Aptitud para principiantes 65/100
MrNeRF/LichtFeld-Studio#3824 ·
Los mantenedores suelen responder en 1 día
-
pnnx: manual tanh GELU fusion loses the approximation modePosiblemente ocupada @ktz03 la tomó hoy. Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
Tencent/ncnn#7175 · 1 reacción ·
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 77/100
throneproj/Throne#2043 ·
Los mantenedores suelen responder en 2 días