OSL trace not working in 2.79 RC! #52368

Closed
opened 2017-08-12 09:51:21 +02:00 by Ilja Razinkov · 13 comments

System Information
Windows 10

Blender Version
Broken: 2.79RC 4a1762f

Short description of error
OSL method "trace" not working in 2.79RC (working ok in 2.78), not working at all! +Crashes

Exact steps for others to reproduce the error
Load attached blend and render it. Material on plane below contain osl script, that maps trace calls to pixel color.

shader traceObject(
    output float ishit=0
)
{
    ishit = trace(P, point(0,0,1));
}

In 2.79RC you will get black plane with no signs of successfull trace. In 2.78 you will get torus, projected on plane - trace works as expected.

Also, in 2.79RC i get crashes when rendering this file several times or enabling Rendered preview mode and flying around the plane. They are not 100%, but quite frequent

traceError.blend

Scr20170812_278.png

Scr20170812_279.png

**System Information** Windows 10 **Blender Version** Broken: 2.79RC 4a1762f **Short description of error** OSL method "trace" not working in 2.79RC (working ok in 2.78), not working at all! +Crashes **Exact steps for others to reproduce the error** Load attached blend and render it. Material on plane below contain osl script, that maps trace calls to pixel color. ``` shader traceObject( output float ishit=0 ) { ishit = trace(P, point(0,0,1)); } ``` In 2.79RC you will get black plane with no signs of successfull trace. In 2.78 you will get torus, projected on plane - trace works as expected. Also, in 2.79RC i get crashes when rendering this file several times or enabling Rendered preview mode and flying around the plane. They are not 100%, but quite frequent [traceError.blend](https://archive.blender.org/developer/F707903/traceError.blend) ![Scr20170812_278.png](https://archive.blender.org/developer/F707904/Scr20170812_278.png) ![Scr20170812_279.png](https://archive.blender.org/developer/F707906/Scr20170812_279.png)
Author

Changed status to: 'Open'

Changed status to: 'Open'
Author

Added subscriber: @IPv6

Added subscriber: @IPv6

Added subscribers: @Sergey, @mont29

Added subscribers: @Sergey, @mont29

Here's ASAN debug build backtrace:

=================================================================
==3773==ERROR: AddressSanitizer: new-delete-type-mismatch on 0x604000261c10 in thread T32:
  object passed to delete has wrong type:
  size of the allocated type:   33 bytes;
  size of the deallocated type: 24 bytes.
==3773==AddressSanitizer: while reporting a bug found another one. Ignoring.
==3773==AddressSanitizer: while reporting a bug found another one. Ignoring.
    - 0 0x7fec672bd7c0 in operator delete(void*, unsigned long) (/usr/lib/x86_64-linux-gnu/libasan.so.3+0xc37c0)
    - 1 0x7fec600e5b51 in llvm::BitcodeReader::FreeState() (/opt/lib/osl/lib/liboslexec.so+0x539b51)
    - 2 0x7fec600f5bc3 in llvm::BitcodeReader::~BitcodeReader() (/opt/lib/osl/lib/liboslexec.so+0x549bc3)
    - 3 0x7fec600f5fd8 in llvm::BitcodeReader::~BitcodeReader() (/opt/lib/osl/lib/liboslexec.so+0x549fd8)
    - 4 0x7fec60685369 in llvm::Module::~Module() (/opt/lib/osl/lib/liboslexec.so+0xad9369)
    - 5 0x7fec60540491 in llvm::ExecutionEngine::~ExecutionEngine() (/opt/lib/osl/lib/liboslexec.so+0x994491)
    - 6 0x7fec6011daa2 in llvm::JIT::~JIT() (/opt/lib/osl/lib/liboslexec.so+0x571aa2)
    - 7 0x7fec6011dbf8 in llvm::JIT::~JIT() (/opt/lib/osl/lib/liboslexec.so+0x571bf8)
    - 8 0x7fec5fda188a in OSL::pvt::LLVM_Util::execengine(llvm::ExecutionEngine*) (/opt/lib/osl/lib/liboslexec.so+0x1f588a)
    - 9 0x7fec5fd9d916 in OSL::pvt::BackendLLVM::run() (/opt/lib/osl/lib/liboslexec.so+0x1f1916)
    - 10 0x7fec5fca6eb5 in OSL::pvt::ShadingSystemImpl::optimize_group(OSL::ShaderGroup&) (/opt/lib/osl/lib/liboslexec.so+0xfaeb5)
    - 11 0x7fec5fca86a9 in OSL::pvt::ShadingSystemImpl::optimize_all_groups(int, int, int) (/opt/lib/osl/lib/liboslexec.so+0xfc6a9)
    - 12 0x7fec63aeef95  (/usr/lib/x86_64-linux-gnu/libboost_thread.so.1.62.0+0x11f95)
    - 13 0x7fec651ef493 in start_thread (/lib/x86_64-linux-gnu/libpthread.so.0+0x7493)
    #14 0x7fec5b30fa8e in __clone (/lib/x86_64-linux-gnu/libc.so.6+0xe8a8e)

0x604000261c10 is located 0 bytes inside of 33-byte region [0x604000261c10,0x604000261c31)
allocated by thread T32 here:
    - 0 0x7fec672bcbc0 in operator new(unsigned long) (/usr/lib/x86_64-linux-gnu/libasan.so.3+0xc2bc0)
    - 1 0x7fec606d2d25 in llvm::MemoryBuffer::getMemBuffer(llvm::StringRef, llvm::StringRef, bool) (/opt/lib/osl/lib/liboslexec.so+0xb26d25)

Thread T32 created by T30 here:
    - 0 0x7fec6722af19 in __interceptor_pthread_create (/usr/lib/x86_64-linux-gnu/libasan.so.3+0x30f19)
    - 1 0x7fec63aee2f8 in boost::thread::start_thread_noexcept() (/usr/lib/x86_64-linux-gnu/libboost_thread.so.1.62.0+0x112f8)

Thread T30 created by T21 here:
    - 0 0x7fec6722af19 in __interceptor_pthread_create (/usr/lib/x86_64-linux-gnu/libasan.so.3+0x30f19)
    - 1 0x563397f6f858 in ccl::thread::thread(std::function<void ()>, int) /home/i74700deb64/blender/__work__/src/intern/cycles/util/util_thread.cpp:29
    - 2 0x5633930054c0 in ccl::Session::start() /home/i74700deb64/blender/__work__/src/intern/cycles/render/session.cpp:131
    - 3 0x563392d7ef91 in ccl::BlenderSession::render() /home/i74700deb64/blender/__work__/src/intern/cycles/blender/blender_session.cpp:472
    - 4 0x563392d6de92 in render_func /home/i74700deb64/blender/__work__/src/intern/cycles/blender/blender_python.cpp:286
    - 5 0x7fec665ec9bc in PyEval_EvalFrameEx (/usr/lib/x86_64-linux-gnu/libpython3.5m.so.1.0+0x1849bc)

Thread T21 created by T0 here:
    - 0 0x7fec6722af19 in __interceptor_pthread_create (/usr/lib/x86_64-linux-gnu/libasan.so.3+0x30f19)
    - 1 0x563392133c00 in BLI_insert_thread /home/i74700deb64/blender/__work__/src/source/blender/blenlib/intern/threads.c:269
    - 2 0x56338f4a4a15 in WM_jobs_start /home/i74700deb64/blender/__work__/src/source/blender/windowmanager/intern/wm_jobs.c:422
    - 3 0x5633901ffa03 in screen_render_invoke /home/i74700deb64/blender/__work__/src/source/blender/editors/render/render_internal.c:984
    - 4 0x56338f486015 in wm_operator_invoke /home/i74700deb64/blender/__work__/src/source/blender/windowmanager/intern/wm_event_system.c:1130
    - 5 0x56338f48983c in wm_handler_operator_call /home/i74700deb64/blender/__work__/src/source/blender/windowmanager/intern/wm_event_system.c:1782
    - 6 0x56338f48b07f in wm_handlers_do_intern /home/i74700deb64/blender/__work__/src/source/blender/windowmanager/intern/wm_event_system.c:2062
    - 7 0x56338f48b882 in wm_handlers_do /home/i74700deb64/blender/__work__/src/source/blender/windowmanager/intern/wm_event_system.c:2173
    - 8 0x56338f48d7fd in wm_event_do_handlers /home/i74700deb64/blender/__work__/src/source/blender/windowmanager/intern/wm_event_system.c:2539
    - 9 0x56338f46fc33 in WM_main /home/i74700deb64/blender/__work__/src/source/blender/windowmanager/intern/wm.c:504
    - 10 0x56338f465f3a in main /home/i74700deb64/blender/__work__/src/source/creator/creator.c:527
    - 11 0x7fec5b2472b0 in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x202b0)

SUMMARY: AddressSanitizer: new-delete-type-mismatch (/usr/lib/x86_64-linux-gnu/libasan.so.3+0xc37c0) in operator delete(void*, unsigned long)
==3773==HINT: if you don't care about these errors you may set ASAN_OPTIONS=new_delete_type_mismatch=0
==3773==ABORTING
Here's ASAN debug build backtrace: ``` ================================================================= ==3773==ERROR: AddressSanitizer: new-delete-type-mismatch on 0x604000261c10 in thread T32: object passed to delete has wrong type: size of the allocated type: 33 bytes; size of the deallocated type: 24 bytes. ==3773==AddressSanitizer: while reporting a bug found another one. Ignoring. ==3773==AddressSanitizer: while reporting a bug found another one. Ignoring. - 0 0x7fec672bd7c0 in operator delete(void*, unsigned long) (/usr/lib/x86_64-linux-gnu/libasan.so.3+0xc37c0) - 1 0x7fec600e5b51 in llvm::BitcodeReader::FreeState() (/opt/lib/osl/lib/liboslexec.so+0x539b51) - 2 0x7fec600f5bc3 in llvm::BitcodeReader::~BitcodeReader() (/opt/lib/osl/lib/liboslexec.so+0x549bc3) - 3 0x7fec600f5fd8 in llvm::BitcodeReader::~BitcodeReader() (/opt/lib/osl/lib/liboslexec.so+0x549fd8) - 4 0x7fec60685369 in llvm::Module::~Module() (/opt/lib/osl/lib/liboslexec.so+0xad9369) - 5 0x7fec60540491 in llvm::ExecutionEngine::~ExecutionEngine() (/opt/lib/osl/lib/liboslexec.so+0x994491) - 6 0x7fec6011daa2 in llvm::JIT::~JIT() (/opt/lib/osl/lib/liboslexec.so+0x571aa2) - 7 0x7fec6011dbf8 in llvm::JIT::~JIT() (/opt/lib/osl/lib/liboslexec.so+0x571bf8) - 8 0x7fec5fda188a in OSL::pvt::LLVM_Util::execengine(llvm::ExecutionEngine*) (/opt/lib/osl/lib/liboslexec.so+0x1f588a) - 9 0x7fec5fd9d916 in OSL::pvt::BackendLLVM::run() (/opt/lib/osl/lib/liboslexec.so+0x1f1916) - 10 0x7fec5fca6eb5 in OSL::pvt::ShadingSystemImpl::optimize_group(OSL::ShaderGroup&) (/opt/lib/osl/lib/liboslexec.so+0xfaeb5) - 11 0x7fec5fca86a9 in OSL::pvt::ShadingSystemImpl::optimize_all_groups(int, int, int) (/opt/lib/osl/lib/liboslexec.so+0xfc6a9) - 12 0x7fec63aeef95 (/usr/lib/x86_64-linux-gnu/libboost_thread.so.1.62.0+0x11f95) - 13 0x7fec651ef493 in start_thread (/lib/x86_64-linux-gnu/libpthread.so.0+0x7493) #14 0x7fec5b30fa8e in __clone (/lib/x86_64-linux-gnu/libc.so.6+0xe8a8e) 0x604000261c10 is located 0 bytes inside of 33-byte region [0x604000261c10,0x604000261c31) allocated by thread T32 here: - 0 0x7fec672bcbc0 in operator new(unsigned long) (/usr/lib/x86_64-linux-gnu/libasan.so.3+0xc2bc0) - 1 0x7fec606d2d25 in llvm::MemoryBuffer::getMemBuffer(llvm::StringRef, llvm::StringRef, bool) (/opt/lib/osl/lib/liboslexec.so+0xb26d25) Thread T32 created by T30 here: - 0 0x7fec6722af19 in __interceptor_pthread_create (/usr/lib/x86_64-linux-gnu/libasan.so.3+0x30f19) - 1 0x7fec63aee2f8 in boost::thread::start_thread_noexcept() (/usr/lib/x86_64-linux-gnu/libboost_thread.so.1.62.0+0x112f8) Thread T30 created by T21 here: - 0 0x7fec6722af19 in __interceptor_pthread_create (/usr/lib/x86_64-linux-gnu/libasan.so.3+0x30f19) - 1 0x563397f6f858 in ccl::thread::thread(std::function<void ()>, int) /home/i74700deb64/blender/__work__/src/intern/cycles/util/util_thread.cpp:29 - 2 0x5633930054c0 in ccl::Session::start() /home/i74700deb64/blender/__work__/src/intern/cycles/render/session.cpp:131 - 3 0x563392d7ef91 in ccl::BlenderSession::render() /home/i74700deb64/blender/__work__/src/intern/cycles/blender/blender_session.cpp:472 - 4 0x563392d6de92 in render_func /home/i74700deb64/blender/__work__/src/intern/cycles/blender/blender_python.cpp:286 - 5 0x7fec665ec9bc in PyEval_EvalFrameEx (/usr/lib/x86_64-linux-gnu/libpython3.5m.so.1.0+0x1849bc) Thread T21 created by T0 here: - 0 0x7fec6722af19 in __interceptor_pthread_create (/usr/lib/x86_64-linux-gnu/libasan.so.3+0x30f19) - 1 0x563392133c00 in BLI_insert_thread /home/i74700deb64/blender/__work__/src/source/blender/blenlib/intern/threads.c:269 - 2 0x56338f4a4a15 in WM_jobs_start /home/i74700deb64/blender/__work__/src/source/blender/windowmanager/intern/wm_jobs.c:422 - 3 0x5633901ffa03 in screen_render_invoke /home/i74700deb64/blender/__work__/src/source/blender/editors/render/render_internal.c:984 - 4 0x56338f486015 in wm_operator_invoke /home/i74700deb64/blender/__work__/src/source/blender/windowmanager/intern/wm_event_system.c:1130 - 5 0x56338f48983c in wm_handler_operator_call /home/i74700deb64/blender/__work__/src/source/blender/windowmanager/intern/wm_event_system.c:1782 - 6 0x56338f48b07f in wm_handlers_do_intern /home/i74700deb64/blender/__work__/src/source/blender/windowmanager/intern/wm_event_system.c:2062 - 7 0x56338f48b882 in wm_handlers_do /home/i74700deb64/blender/__work__/src/source/blender/windowmanager/intern/wm_event_system.c:2173 - 8 0x56338f48d7fd in wm_event_do_handlers /home/i74700deb64/blender/__work__/src/source/blender/windowmanager/intern/wm_event_system.c:2539 - 9 0x56338f46fc33 in WM_main /home/i74700deb64/blender/__work__/src/source/blender/windowmanager/intern/wm.c:504 - 10 0x56338f465f3a in main /home/i74700deb64/blender/__work__/src/source/creator/creator.c:527 - 11 0x7fec5b2472b0 in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x202b0) SUMMARY: AddressSanitizer: new-delete-type-mismatch (/usr/lib/x86_64-linux-gnu/libasan.so.3+0xc37c0) in operator delete(void*, unsigned long) ==3773==HINT: if you don't care about these errors you may set ASAN_OPTIONS=new_delete_type_mismatch=0 ==3773==ABORTING ```

Added subscriber: @brecht

Added subscriber: @brecht

Note the Blender version in the report is not the 2.79 RC build, it's a master build where confusingly the splash screen still shows "Release Candidate". So the crash might also be due to recent changes.

Note the Blender version in the report is not the 2.79 RC build, it's a master build where confusingly the splash screen still shows "Release Candidate". So the crash might also be due to recent changes.

This issue was referenced by blender/cycles@ce7f9aee2e

This issue was referenced by blender/cycles@ce7f9aee2e707f5eeb6cdf2e1218708132608009

This issue was referenced by d7639d57dc

This issue was referenced by d7639d57dc55ee18f7bbed8071efc8f47de1fd04

Changed status from 'Open' to: 'Resolved'

Changed status from 'Open' to: 'Resolved'

It indeed was not a bug in the actual 2.79 RC, so no need to backport this one. Also added test for this report.

It indeed was not a bug in the actual 2.79 RC, so no need to backport this one. Also added test for this report.
Author

Thanks for such urgent fixing! It`s really a joy to use Blender :)

Thanks for such urgent fixing! It`s really a joy to use Blender :)

This issue was referenced by blender/cycles@5f09155916

This issue was referenced by blender/cycles@5f09155916008ba4fa2bda7ebc7831594415700f

This issue was referenced by 18a353dd24

This issue was referenced by 18a353dd242225a9a7a6e101b9c128f94d03d770
Sign in to join this conversation.
No Label
Interest
Alembic
Interest
Animation & Rigging
Interest
Asset System
Interest
Audio
Interest
Automated Testing
Interest
Blender Asset Bundle
Interest
BlendFile
Interest
Collada
Interest
Compatibility
Interest
Compositing
Interest
Core
Interest
Cycles
Interest
Dependency Graph
Interest
Development Management
Interest
EEVEE
Interest
EEVEE & Viewport
Interest
Freestyle
Interest
Geometry Nodes
Interest
Grease Pencil
Interest
ID Management
Interest
Images & Movies
Interest
Import Export
Interest
Line Art
Interest
Masking
Interest
Metal
Interest
Modeling
Interest
Modifiers
Interest
Motion Tracking
Interest
Nodes & Physics
Interest
OpenGL
Interest
Overlay
Interest
Overrides
Interest
Performance
Interest
Physics
Interest
Pipeline, Assets & IO
Interest
Platforms, Builds & Tests
Interest
Python API
Interest
Render & Cycles
Interest
Render Pipeline
Interest
Sculpt, Paint & Texture
Interest
Text Editor
Interest
Translations
Interest
Triaging
Interest
Undo
Interest
USD
Interest
User Interface
Interest
UV Editing
Interest
VFX & Video
Interest
Video Sequencer
Interest
Virtual Reality
Interest
Vulkan
Interest
Wayland
Interest
Workbench
Interest: X11
Legacy
Asset Browser Project
Legacy
Blender 2.8 Project
Legacy
Milestone 1: Basic, Local Asset Browser
Legacy
OpenGL Error
Meta
Good First Issue
Meta
Papercut
Meta
Retrospective
Meta
Security
Module
Animation & Rigging
Module
Core
Module
Development Management
Module
EEVEE & Viewport
Module
Grease Pencil
Module
Modeling
Module
Nodes & Physics
Module
Pipeline, Assets & IO
Module
Platforms, Builds & Tests
Module
Python API
Module
Render & Cycles
Module
Sculpt, Paint & Texture
Module
Triaging
Module
User Interface
Module
VFX & Video
Platform
FreeBSD
Platform
Linux
Platform
macOS
Platform
Windows
Priority
High
Priority
Low
Priority
Normal
Priority
Unbreak Now!
Status
Archived
Status
Confirmed
Status
Duplicate
Status
Needs Info from Developers
Status
Needs Information from User
Status
Needs Triage
Status
Resolved
Type
Bug
Type
Design
Type
Known Issue
Type
Patch
Type
Report
Type
To Do
No Milestone
No project
No Assignees
4 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: blender/blender#52368
No description provided.