Crash With Open Shading Language
Closed, ResolvedPublic

Description

The file

(previously posted for T48671) is triggering crashes again. Simply open it, and try to render with either F12 or SHIFT-Z, and it crashes immediately.

Do you want a traceback?

Details

Type
Bug
Lawrence D'Oliveiro (ldo) created this object with edit policy "All Users".
Bastien Montagne (mont29) triaged this task as Confirmed priority.Sep 1 2016, 9:11 AM

Very interesting… crashing here too, with following report:

ASAN:DEADLYSIGNAL
=================================================================
==17845==ERROR: AddressSanitizer: SEGV on unknown address 0x000000000000 (pc 0x7f087e4ae1fd bp 0x000000000011 sp 0x7f0831711710 T31)
    #0 0x7f087e4ae1fc in boost::filesystem::detail::status(boost::filesystem::path const&, boost::system::error_code*) (/usr/lib/x86_64-linux-gnu/libboost_filesystem.so.1.61.0+0x91fc)
    #1 0x7f087ed3b03d in OpenImageIO::v1_6::Filesystem::is_regular(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&) (/opt/lib/oiio/lib/libOpenImageIO.so.1.6+0x41203d)
    #2 0x7f087ed3c9a0 in OpenImageIO::v1_6::Filesystem::searchpath_find(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, std::vector<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::allocator<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > > > const&, bool, bool) (/opt/lib/oiio/lib/libOpenImageIO.so.1.6+0x4139a0)
    #3 0x7f087a1781a6 in OSL::pvt::ShadingSystemImpl::loadshader(OpenImageIO::v1_6::string_view) (/opt/lib/osl/lib/liboslexec.so+0x1391a6)
    #4 0x7f087a132a13 in OSL::pvt::ShadingSystemImpl::Shader(OpenImageIO::v1_6::string_view, OpenImageIO::v1_6::string_view, OpenImageIO::v1_6::string_view) (/opt/lib/osl/lib/liboslexec.so+0xf3a13)
    #5 0x7f087a132f9a in OSL::ShadingSystem::Shader(OpenImageIO::v1_6::string_view, OpenImageIO::v1_6::string_view, OpenImageIO::v1_6::string_view) (/opt/lib/osl/lib/liboslexec.so+0xf3f9a)
    #6 0x6250772 in ccl::OSLCompiler::add(ccl::ShaderNode*, char const*, bool) /home/i74700deb64/blender/__work__/src/intern/cycles/render/osl.cpp:682
    #7 0x61e82ed in ccl::GeometryNode::compile(ccl::OSLCompiler&) /home/i74700deb64/blender/__work__/src/intern/cycles/render/nodes.cpp:2763
    #8 0x6253ece in ccl::OSLCompiler::generate_nodes(std::set<ccl::ShaderNode*, ccl::ShaderNodeIDComparator, std::allocator<ccl::ShaderNode*> > const&) /home/i74700deb64/blender/__work__/src/intern/cycles/render/osl.cpp:1013
    #9 0x625473b in ccl::OSLCompiler::compile_type(ccl::Shader*, ccl::ShaderGraph*, ccl::ShaderType) /home/i74700deb64/blender/__work__/src/intern/cycles/render/osl.cpp:1055
    #10 0x62550b4 in ccl::OSLCompiler::compile(ccl::Scene*, ccl::OSLGlobals*, ccl::Shader*) /home/i74700deb64/blender/__work__/src/intern/cycles/render/osl.cpp:1117
    #11 0x624b67a in ccl::OSLShaderManager::device_update(ccl::Device*, ccl::DeviceScene*, ccl::Scene*, ccl::Progress&) /home/i74700deb64/blender/__work__/src/intern/cycles/render/osl.cpp:103
    #12 0x6264adb in ccl::Scene::device_update(ccl::Device*, ccl::Progress&) /home/i74700deb64/blender/__work__/src/intern/cycles/render/scene.cpp:155
    #13 0x627170b in ccl::Session::update_scene() /home/i74700deb64/blender/__work__/src/intern/cycles/render/session.cpp:824
    #14 0x626eace in ccl::Session::run_cpu() /home/i74700deb64/blender/__work__/src/intern/cycles/render/session.cpp:553
    #15 0x627043c in ccl::Session::run() /home/i74700deb64/blender/__work__/src/intern/cycles/render/session.cpp:692
    #16 0x62799d2 in void std::__invoke_impl<void, void (ccl::Session::* const&)(), ccl::Session*&>(std::__invoke_memfun_deref, void (ccl::Session::* const&)(), ccl::Session*&) /usr/include/c++/6/functional:235
    #17 0x627943a in std::result_of<void (ccl::Session::* const&(ccl::Session*&))()>::type std::__invoke<void (ccl::Session::* const&)(), ccl::Session*&>(void (ccl::Session::* const&)(), ccl::Session*&) /usr/include/c++/6/functional:260
    #18 0x6278f11 in decltype (__invoke((*this)._M_pmf, (forward<ccl::Session*&>)({parm#1}))) std::_Mem_fn_base<void (ccl::Session::*)(), true>::operator()<ccl::Session*&>(ccl::Session*&) const /usr/include/c++/6/functional:613
    #19 0x627821f in void std::_Bind<std::_Mem_fn<void (ccl::Session::*)()> (ccl::Session*)>::__call<void, , 0ul>(std::tuple<>&&, std::_Index_tuple<0ul>) /usr/include/c++/6/functional:943
    #20 0x6276ebd in void std::_Bind<std::_Mem_fn<void (ccl::Session::*)()> (ccl::Session*)>::operator()<, void>() /usr/include/c++/6/functional:1002
    #21 0x62760c5 in std::_Function_handler<void (), std::_Bind<std::_Mem_fn<void (ccl::Session::*)()> (ccl::Session*)> >::_M_invoke(std::_Any_data const&) /usr/include/c++/6/functional:1740
    #22 0x6017587 in std::function<void ()>::operator()() const /usr/include/c++/6/functional:2136
    #23 0x87c542c in ccl::thread::run(void*) /home/i74700deb64/blender/__work__/src/intern/cycles/util/util_thread.cpp:56
    #24 0x7f087f48d463 in start_thread (/lib/x86_64-linux-gnu/libpthread.so.0+0x7463)
    #25 0x7f087598230c in clone (/lib/x86_64-linux-gnu/libc.so.6+0xe730c)

AddressSanitizer can not provide additional info.
SUMMARY: AddressSanitizer: SEGV (/usr/lib/x86_64-linux-gnu/libboost_filesystem.so.1.61.0+0x91fc) in boost::filesystem::detail::status(boost::filesystem::path const&, boost::system::error_code*)
Thread T31 created by T22 here:
    #0 0x7f088149d069 in pthread_create (/usr/lib/x86_64-linux-gnu/libasan.so.3+0x31069)
    #1 0x87c5364 in ccl::thread::thread(std::function<void ()>, int) /home/i74700deb64/blender/__work__/src/intern/cycles/util/util_thread.cpp:29
    #2 0x626af5a in ccl::Session::start() /home/i74700deb64/blender/__work__/src/intern/cycles/render/session.cpp:133
    #3 0x600cc49 in ccl::BlenderSession::render() /home/i74700deb64/blender/__work__/src/intern/cycles/blender/blender_session.cpp:534
    #4 0x5ffad91 in render_func /home/i74700deb64/blender/__work__/src/intern/cycles/blender/blender_python.cpp:286
    #5 0x7f08808856b9 in PyEval_EvalFrameEx (/usr/lib/x86_64-linux-gnu/libpython3.5m.so.1.0+0x1a26b9)

Thread T22 created by T0 here:
    #0 0x7f088149d069 in pthread_create (/usr/lib/x86_64-linux-gnu/libasan.so.3+0x31069)
    #1 0x5275d27 in BLI_insert_thread /home/i74700deb64/blender/__work__/src/source/blender/blenlib/intern/threads.c:270
    #2 0x271a74d in WM_jobs_start /home/i74700deb64/blender/__work__/src/source/blender/windowmanager/intern/wm_jobs.c:422
    #3 0x3447266 in screen_render_invoke /home/i74700deb64/blender/__work__/src/source/blender/editors/render/render_internal.c:981
    #4 0x26fc9b6 in wm_operator_invoke /home/i74700deb64/blender/__work__/src/source/blender/windowmanager/intern/wm_event_system.c:1096
    #5 0x27001dd in wm_handler_operator_call /home/i74700deb64/blender/__work__/src/source/blender/windowmanager/intern/wm_event_system.c:1748
    #6 0x270196c in wm_handlers_do_intern /home/i74700deb64/blender/__work__/src/source/blender/windowmanager/intern/wm_event_system.c:2025
    #7 0x270216d in wm_handlers_do /home/i74700deb64/blender/__work__/src/source/blender/windowmanager/intern/wm_event_system.c:2134
    #8 0x27040e8 in wm_event_do_handlers /home/i74700deb64/blender/__work__/src/source/blender/windowmanager/intern/wm_event_system.c:2500
    #9 0x26e690e in WM_main /home/i74700deb64/blender/__work__/src/source/blender/windowmanager/intern/wm.c:489
    #10 0x26dcdf0 in main /home/i74700deb64/blender/__work__/src/source/creator/creator.c:527
    #11 0x7f08758bb72f in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x2072f)

==17845==ABORTING

@Sergey Sharybin (sergey), backtrace looks very similar to the issue we discussed yesterday over IRC (just select only empty Text.osl in script node of

is enough to make it crash too):

ASAN:DEADLYSIGNAL
=================================================================
==17938==ERROR: AddressSanitizer: SEGV on unknown address 0x000000000000 (pc 0x7f26d65441fd bp 0x000000000014 sp 0x7fff3f850030 T0)
    #0 0x7f26d65441fc in boost::filesystem::detail::status(boost::filesystem::path const&, boost::system::error_code*) (/usr/lib/x86_64-linux-gnu/libboost_filesystem.so.1.61.0+0x91fc)
    #1 0x7f26d6dd0f3d in OpenImageIO::v1_6::Filesystem::exists(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&) (/opt/lib/oiio/lib/libOpenImageIO.so.1.6+0x411f3d)
    #2 0x7f26d3325508 in OSL::pvt::OSLCompilerImpl::compile(OpenImageIO::v1_6::string_view, std::vector<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::allocator<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > > > const&, OpenImageIO::v1_6::string_view) (/opt/lib/osl/lib/liboslcomp.so+0x64508)
    #3 0x7f26d3326114 in OSL::OSLCompiler::compile(OpenImageIO::v1_6::string_view, std::vector<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::allocator<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > > > const&, OpenImageIO::v1_6::string_view) (/opt/lib/osl/lib/liboslcomp.so+0x65114)
    #4 0x624cffb in ccl::OSLShaderManager::osl_compile(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&) /home/i74700deb64/blender/__work__/src/intern/cycles/render/osl.cpp:296
    #5 0x5ffd778 in osl_compile_func /home/i74700deb64/blender/__work__/src/intern/cycles/blender/blender_python.cpp:583
    #6 0x7f26d8802208 in PyCFunction_Call (/usr/lib/x86_64-linux-gnu/libpython3.5m.so.1.0+0x89208)
    #7 0x7f26d891b513 in PyEval_EvalFrameEx (/usr/lib/x86_64-linux-gnu/libpython3.5m.so.1.0+0x1a2513)
    #8 0x7f26d891b487 in PyEval_EvalFrameEx (/usr/lib/x86_64-linux-gnu/libpython3.5m.so.1.0+0x1a2487)
    #9 0x7f26d891b487 in PyEval_EvalFrameEx (/usr/lib/x86_64-linux-gnu/libpython3.5m.so.1.0+0x1a2487)
    #10 0x7f26d89db873  (/usr/lib/x86_64-linux-gnu/libpython3.5m.so.1.0+0x262873)
    #11 0x7f26d89db952 in PyEval_EvalCodeEx (/usr/lib/x86_64-linux-gnu/libpython3.5m.so.1.0+0x262952)
    #12 0x7f26d885dcc7  (/usr/lib/x86_64-linux-gnu/libpython3.5m.so.1.0+0xe4cc7)
    #13 0x7f26d894b476 in PyObject_Call (/usr/lib/x86_64-linux-gnu/libpython3.5m.so.1.0+0x1d2476)
    #14 0x389b7d2 in bpy_class_call /home/i74700deb64/blender/__work__/src/source/blender/python/intern/bpy_rna.c:7603
    #15 0x4f1e27e in engine_update_script_node /home/i74700deb64/blender/__work__/src/source/blender/makesrna/intern/rna_render.c:254
    #16 0x4e21b09 in rna_ShaderNodeScript_update /home/i74700deb64/blender/__work__/src/source/blender/makesrna/intern/rna_nodetree.c:2991
    #17 0x4c1156b in rna_property_update /home/i74700deb64/blender/__work__/src/source/blender/makesrna/intern/rna_access.c:1738
    #18 0x4c11865 in RNA_property_update /home/i74700deb64/blender/__work__/src/source/blender/makesrna/intern/rna_access.c:1771
    #19 0x2f39974 in ui_apply_but_funcs_after /home/i74700deb64/blender/__work__/src/source/blender/editors/interface/interface_handlers.c:781
    #20 0x2f7f809 in ui_handler_region_menu /home/i74700deb64/blender/__work__/src/source/blender/editors/interface/interface_handlers.c:10072
    #21 0x26f8800 in wm_handler_ui_call /home/i74700deb64/blender/__work__/src/source/blender/windowmanager/intern/wm_event_system.c:451
    #22 0x2701b83 in wm_handlers_do_intern /home/i74700deb64/blender/__work__/src/source/blender/windowmanager/intern/wm_event_system.c:2050
    #23 0x270216d in wm_handlers_do /home/i74700deb64/blender/__work__/src/source/blender/windowmanager/intern/wm_event_system.c:2134
    #24 0x27039ab in wm_event_do_handlers /home/i74700deb64/blender/__work__/src/source/blender/windowmanager/intern/wm_event_system.c:2407
    #25 0x26e690e in WM_main /home/i74700deb64/blender/__work__/src/source/blender/windowmanager/intern/wm.c:489
    #26 0x26dcdf0 in main /home/i74700deb64/blender/__work__/src/source/creator/creator.c:527
    #27 0x7f26cd95172f in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x2072f)
    #28 0x26dc188 in _start (/home/i74700deb64/blender/__work__/build_cmake_dbg/bin/blender+0x26dc188)

AddressSanitizer can not provide additional info.
SUMMARY: AddressSanitizer: SEGV (/usr/lib/x86_64-linux-gnu/libboost_filesystem.so.1.61.0+0x91fc) in boost::filesystem::detail::status(boost::filesystem::path const&, boost::system::error_code*)
==17938==ABORTING
Sergey Sharybin (sergey) lowered the priority of this task from Confirmed to Incomplete.Sep 1 2016, 10:22 AM

@Lawrence D'Oliveiro (ldo), please always follow bug report guidelines and provide information about OS and exact Blender version you are using. And also mention whether it's self-compiled blender or the one from builder.blender.org.

@Bastien Montagne (mont29), there are couple of worrying things in your backtrace:

  1. It used system boost version 1.61, while official builds are using 1.60.
  2. Seems it uses C++11 ABI (see all those std::__cxx11). Could either be because of defaults in the new compiler or a new ABI used in your OS. In Blender we explicitly disabling C++11 standard when WITH_CXX11 is set to OFF (which is default). Am not sure what's gonna to happen when trying to link such Blender to a C++11 boost, but don't think something good will happen.

This boost thing is something to be checked on, probably by compiling your own into /opt/lib/boost.

P.S. As you might have guessed, i can't reproduce the error with linux builds from our buildbot.

My build is from commit 475b43a, and I built against boost version 1.58. Is it worth enclosing the build options I enable, my CMakeCache.txt, or anything like that?

@Lawrence D'Oliveiro (ldo), it worth checking whether you've got crash with builds from builder.blender.org.

I tried downloading blender-2.77-475b43a-linux-glibc219-x86_64.tar.bz2, and it does the OSL render without crashing.

I note also my Debian Unstable has glibc 2.23.

What version of OSL do you use? I use upstream.

We use OSL version 1.7.3.

glibc version shouldn't matter that much, any version equal or above the one which was used during official release build will be just good.

Debian Unstable is default to gcc-6, which also means it defaults to C++11 (unless -std=gnu99 is explicitly passed).

So really starting to wondering whether such ABI version between blender and libraries triggers the issue.

Will talk to @Bastien Montagne (mont29) over IRC about this.

@Lawrence D'Oliveiro (ldo) first thing to try: re-run install_deps with --force-all option. Debian testing/ustable recently changed default compiler to gcc6, looks like it does not like to use both gcc5 and gcc6 libs together sometimes. At least for me it (partially) fixes the issue (as in, still getting weird error report from ASAN in debug build, but release build works perfectly with your file and mine).

Looking at install_deps, I see mention of the following:

  • ocio — Debian package.
  • oiio — Just built and installed 1.6.16 as of today.
  • llvm — Using the v3.5 Debian package.
  • osl — Just built and installed 1.7.4 as of today.
  • osd — while my CMakeCache.txt has WITH_CYCLES_OPENSUBDIV:BOOL=ON, it also has WITH_OPENSUBDIV:BOOL=OFF. So I think that means I’m not using OpenSubDiv...
  • openvdb — my CMakeCache.txt has WITH_OPENVDB:BOOL=OFF.
  • python, numpy — Debian packages.
  • boost — Using the v1.61 Debian package.
  • openexr — just rebuilt and reinstalled ilmbase-2.2.0 and openexr-2.2.0 as of today. Can’t find anything newer.
  • ffmpeg — currently disabled in my builds.
  • opencollada — disabled for this test build.
  • alembic — CMakeCache.txt has WITH_ALEMBIC:BOOL=OFF.

Did I miss anything?

Anyway, it is still crashing. Here

is a crash report. I can’t see anything in that backtrace other than Debian packages or things that I have recently rebuilt.

You obviously haven’t re-run install_deps as requested, or did not update your blender CMake config as suggested by the script. Your traceback shows usage of llvm3.5, which is not supported currently by Blender.

Since debian testing recently removed llvm3.4 packages, install_deps has to build it again (and rebuild OSL which depends on it). You then need to cleanup your CMake config to match the values suggested by install_deps at end of its execution.

Bastien Montagne (mont29) claimed this task.

More than a week without reply. Due to the policy of the tracker archiving for until required info/data are provided.

Lawrence D'Oliveiro (ldo) changed the task status from Invalid to Resolved.Aug 27 2017, 8:15 AM

Building with LLVM 3.5 works again. I think it’s about time you updated your Blender builds to use a non-obsolete version.