OSL crash on 32bit #48542

Closed
opened 2016-05-29 14:29:59 +02:00 by Thomas Szepe · 30 comments
Member

System Information
Windows 7 64 bit
Intel Core2 Quad Q9300; 4,0 GB RAM
GeForce GTX 460; driver: 361.75

Blender Version
Broken:

Worked:

Short description of error
If "Open Shading Language" is activated and Blender is in Cycles render mode, Blender will crash on win32 builds after 2.76b.

Exact steps for others to reproduce the error

  • Switch to Cycles Render
  • Change the viewport shading mode to "Rendered"
  • Activate "Open Shading Language" in the render panel
  • Blender will crash.
**System Information** Windows 7 64 bit Intel Core2 Quad Q9300; 4,0 GB RAM GeForce GTX 460; driver: 361.75 **Blender Version** Broken: - 2.77a abf6f08 win32 - build from today 3ed2b11 win32 - buildbot 2.77 cd4d80f win32 Worked: - 2.76b f337fea win32; - 2.77 cd4d80f win64 **Short description of error** If "Open Shading Language" is activated and Blender is in Cycles render mode, Blender will crash on win32 builds after 2.76b. **Exact steps for others to reproduce the error** - Switch to Cycles Render - Change the viewport shading mode to "Rendered" - Activate "Open Shading Language" in the render panel - Blender will crash.
Author
Member

Changed status to: 'Open'

Changed status to: 'Open'
Author
Member

Added subscriber: @hg1

Added subscriber: @hg1

#48778 was marked as duplicate of this issue

#48778 was marked as duplicate of this issue

Added subscriber: @ThomasDinges

Added subscriber: @ThomasDinges

Why are you using a 32bit build on a x64bit OS?

Also make sure your OS us fully up to date (latest Service pack and updates).

Why are you using a 32bit build on a x64bit OS? Also make sure your OS us fully up to date (latest Service pack and updates).
Author
Member

Why are you using a 32bit build on a x64bit OS?

Why not?

  • My PC has only 4GB of Ram.
  • Mostly I use the BGE and the 64 bit version has more bugs.
  • Mixing Python 32 bit third party libraries (someone only exist as 32 bit version) with 64 bit python will not work.
  • Also when I make a Blender test build, I always make a 32 bit version so all people can run it.

I don't know if there any speed improvements for Cycles (using Cuda) or Blender render engine but normally I don't use it, so I don't care.
So there is no benefits by using the 64 bit version for me.

Also make sure your OS us fully up to date (latest Service pack and updates).

My last Windows update is form 06.03.2016
I will check for new updates and will report afterwards.

> Why are you using a 32bit build on a x64bit OS? Why not? - My PC has only 4GB of Ram. - Mostly I use the BGE and the 64 bit version has more bugs. - Mixing Python 32 bit third party libraries (someone only exist as 32 bit version) with 64 bit python will not work. - Also when I make a Blender test build, I always make a 32 bit version so all people can run it. I don't know if there any speed improvements for Cycles (using Cuda) or Blender render engine but normally I don't use it, so I don't care. So there is no benefits by using the 64 bit version for me. > Also make sure your OS us fully up to date (latest Service pack and updates). My last Windows update is form 06.03.2016 I will check for new updates and will report afterwards.

Added subscribers: @MartijnBerger, @mont29

Added subscribers: @MartijnBerger, @mont29

All those reasons are not very good to use 32bit on 64bit platform (« Mostly I use the BGE and the 64 bit version has more bugs » seriously? I’d like to know what’s broken on 64bit that works on 32bit…) - but there is absolutely no reason for 32bit builds to fail in 64bit windows!

We need some windows dev here, @MartijnBerger maybe you can try to reproduce?

All those reasons are not very good to use 32bit on 64bit platform (*« Mostly I use the BGE and the 64 bit version has more bugs »* seriously? I’d like to know what’s broken on 64bit that works on 32bit…) - **but** there is absolutely no reason for 32bit builds to fail in 64bit windows! We need some windows dev here, @MartijnBerger maybe you can try to reproduce?
Bastien Montagne changed title from OSL crash after activation to OSL crash after activation (using 32bit blender on 64bit windows) 2016-05-29 17:03:01 +02:00

I wouldn't consider this a valid bug though.

64 bit Blender failing on 64 bit OS, ok.
32 bit Blender failing on 32 bit OS, ok.

But in this combination, I wouldn't spend much energy on trying to find whats wrong.

I wouldn't consider this a valid bug though. 64 bit Blender failing on 64 bit OS, ok. 32 bit Blender failing on 32 bit OS, ok. But in this combination, I wouldn't spend much energy on trying to find whats wrong.
Author
Member

I have updated windows and the graphic card driver. As expected still crashing.

seriously? I’d like to know what’s broken on 64bit that works on 32bit.

For me that are enough reasons. A specially that the 32 bit python libraries are not working with python 64 bit. Also I don't see an reason to use a 64 bit version. Or can you tell me one good reason why I should use it.
Most of the bugs are related with the Bullet and constraints. Most of them are fixed now by Sybren A. Stüvel, Porteries Tristan and me. Actually I know that there is a Bullet heap fault which sometimes let the BGE crash.

But in this combination, I wouldn't spend much energy on trying to find whats wrong.

seriously? You want to leave this bug?
Also do you have tested 32 bit Blender with 32 bit OS?

I have updated windows and the graphic card driver. As expected still crashing. > seriously? I’d like to know what’s broken on 64bit that works on 32bit. For me that are enough reasons. A specially that the 32 bit python libraries are not working with python 64 bit. Also I don't see an reason to use a 64 bit version. Or can you tell me one good reason why I should use it. Most of the bugs are related with the Bullet and constraints. Most of them are fixed now by Sybren A. Stüvel, Porteries Tristan and me. Actually I know that there is a Bullet heap fault which sometimes let the BGE crash. > But in this combination, I wouldn't spend much energy on trying to find whats wrong. seriously? You want to leave this bug? Also do you have tested 32 bit Blender with 32 bit OS?

I don't have Windows and I don't have a 32bit OS. If someone can reproduce the issue with the two combinations I mentioned above, then I will leave this open. Otherwise I will close it. It's just not a practical combination. You can also not run a 32bit Blender on a 64bit OS and use CUDA, that will not work either.

I don't have Windows and I don't have a 32bit OS. If someone can reproduce the issue with the two combinations I mentioned above, then I will leave this open. Otherwise I will close it. It's just not a practical combination. You can also not run a 32bit Blender on a 64bit OS and use CUDA, that will not work either.
Author
Member

I don't have Windows and I don't have a 32bit OS. If someone can reproduce the issue with the two combinations I mentioned above, then I will leave this open. Otherwise I will close it.

Lol you want to close an obviously bug the will crash Blender. When I have time I will test it on one of the lab PC's with 32 bit Windows 7.

It's just not a practical combination.

No, running a 32 bit software on 64 bit OS is normal combination should also work.

You can also not run a 32bit Blender on a 64bit OS and use CUDA, that will not work either.

No, that is definitely not correct. CUDA works with this combination.

> I don't have Windows and I don't have a 32bit OS. If someone can reproduce the issue with the two combinations I mentioned above, then I will leave this open. Otherwise I will close it. Lol you want to close an obviously bug the will crash Blender. When I have time I will test it on one of the lab PC's with 32 bit Windows 7. > It's just not a practical combination. No, running a 32 bit software on 64 bit OS is normal combination should also work. > You can also not run a 32bit Blender on a 64bit OS and use CUDA, that will not work either. No, that is definitely not correct. CUDA works with this combination.

I can confirm the crash on Ubuntu x64, with Blender 2.77a (32bit binary). 64bit binary is fine.

OSL is a third party library, we updated it for 2.77, maybe that's the reason for the crash. We are one of the few (if not the only) program that still supports OSL on 32bit. VRAY, Appleseed...other renderers with OSL support are 64bit only. I wouldn't be surprised if there are simply issues in the library on 32bit, because no one uses that ancient stuff anymore...

I can confirm the crash on Ubuntu x64, with Blender 2.77a (32bit binary). 64bit binary is fine. OSL is a third party library, we updated it for 2.77, maybe that's the reason for the crash. We are one of the few (if not the only) program that still supports OSL on 32bit. VRAY, Appleseed...other renderers with OSL support are 64bit only. I wouldn't be surprised if there are simply issues in the library on 32bit, because no one uses that ancient stuff anymore...
Member

Added subscriber: @LazyDodo

Added subscriber: @LazyDodo
Member

Looks like OSL is getting unhappy , I don't have debugging symbols for the libs in svn so can't debug this further (and don't have the time to build my own libs right now)

First-chance exception at 0x1CB9003A in blender.exe: 0xC0000005: Access violation writing location 0x00000002.

Line causing the exception:
https://git.blender.org/gitweb/gitweb.cgi/blender.git/blob/HEAD:/intern/cycles/kernel/osl/osl_shader.cpp#l394

Callstack:

 	190e003a()	Unknown
 	[Frames below may be incorrect and/or missing]	
 	[External Code]	
 	blender.exe!ccl::OSLShader::eval_background(ccl::KernelGlobals * kg, ccl::ShaderData * sd, ccl::PathState * state, int path_flag, ccl::ShaderContext ctx) Line 396	C++
 	blender.exe!ccl::shader_eval_background(ccl::KernelGlobals * kg, ccl::ShaderData * sd, ccl::PathState * state, int path_flag, ccl::ShaderContext ctx) Line 861	C++
 	blender.exe!ccl::indirect_background(ccl::KernelGlobals * kg, ccl::PathState * state, ccl::Ray * ray) Line 293	C++
 	blender.exe!ccl::kernel_path_integrate(ccl::KernelGlobals * kg, unsigned int * rng, int sample, ccl::Ray ray, float * buffer) Line 775	C++
 	blender.exe!ccl::kernel_path_trace(ccl::KernelGlobals * kg, float * buffer, unsigned int * rng_state, int sample, int x, int y, int offset, int stride) Line 933	C++
 	blender.exe!ccl::kernel_cpu_sse3_path_trace(ccl::KernelGlobals * kg, float * buffer, unsigned int * rng_state, int sample, int x, int y, int offset, int stride) Line 57	C++
 	blender.exe!ccl::CPUDevice::thread_path_trace(ccl::DeviceTask & task) Line 275	C++
 	blender.exe!ccl::CPUDevice::thread_run(ccl::DeviceTask * task) Line 193	C++
 	[External Code]	
 	blender.exe!ccl::TaskScheduler::thread_run(int __formal) Line 258	C++
 	[External Code]	
 	blender.exe!ccl::thread::run(void * arg) Line 69	C++
 	pthreadVC2.dll!10001e05()	Unknown
 	[External Code]	

Given it's trying to write to address 0x00000002 it kinda looks like a null-deref in osl?

Looks like OSL is getting unhappy , I don't have debugging symbols for the libs in svn so can't debug this further (and don't have the time to build my own libs right now) ``` First-chance exception at 0x1CB9003A in blender.exe: 0xC0000005: Access violation writing location 0x00000002. ``` Line causing the exception: https://git.blender.org/gitweb/gitweb.cgi/blender.git/blob/HEAD:/intern/cycles/kernel/osl/osl_shader.cpp#l394 Callstack: ``` 190e003a() Unknown [Frames below may be incorrect and/or missing] [External Code] blender.exe!ccl::OSLShader::eval_background(ccl::KernelGlobals * kg, ccl::ShaderData * sd, ccl::PathState * state, int path_flag, ccl::ShaderContext ctx) Line 396 C++ blender.exe!ccl::shader_eval_background(ccl::KernelGlobals * kg, ccl::ShaderData * sd, ccl::PathState * state, int path_flag, ccl::ShaderContext ctx) Line 861 C++ blender.exe!ccl::indirect_background(ccl::KernelGlobals * kg, ccl::PathState * state, ccl::Ray * ray) Line 293 C++ blender.exe!ccl::kernel_path_integrate(ccl::KernelGlobals * kg, unsigned int * rng, int sample, ccl::Ray ray, float * buffer) Line 775 C++ blender.exe!ccl::kernel_path_trace(ccl::KernelGlobals * kg, float * buffer, unsigned int * rng_state, int sample, int x, int y, int offset, int stride) Line 933 C++ blender.exe!ccl::kernel_cpu_sse3_path_trace(ccl::KernelGlobals * kg, float * buffer, unsigned int * rng_state, int sample, int x, int y, int offset, int stride) Line 57 C++ blender.exe!ccl::CPUDevice::thread_path_trace(ccl::DeviceTask & task) Line 275 C++ blender.exe!ccl::CPUDevice::thread_run(ccl::DeviceTask * task) Line 193 C++ [External Code] blender.exe!ccl::TaskScheduler::thread_run(int __formal) Line 258 C++ [External Code] blender.exe!ccl::thread::run(void * arg) Line 69 C++ pthreadVC2.dll!10001e05() Unknown [External Code] ``` Given it's trying to write to address 0x00000002 it kinda looks like a null-deref in osl?
Member

I just tested 2.77a and lastest nightly on a 32 bit host, they crash as well , also this is not limited to viewport renders, just enabling osl and doing a render will take down the process as well.

I just tested 2.77a and lastest nightly on a 32 bit host, they crash as well , also this is not limited to viewport renders, just enabling osl and doing a render will take down the process as well.
Author
Member

I can confirm the crash on windows 7 32 bit.

I can confirm the crash on windows 7 32 bit.
Member

I grabbed the latest OSL from git which didn't crash anymore, bisected it until i found the commit that fixed it

7aa83e4dbc

We can easily patch this in our libs in svn for windows, however that doesn't quite help linux users

Wait for a new upstream release?

I grabbed the latest OSL from git which didn't crash anymore, bisected it until i found the commit that fixed it https://github.com/imageworks/OpenShadingLanguage/commit/7aa83e4dbc529f0012dbbe8e9b321198fa0195a6 We can easily patch this in our libs in svn for windows, however that doesn't quite help linux users Wait for a new upstream release?

I think we can ask Larry to backport this to the OSL 1.7.x branch and just update libs then. Thanks for checking!

I think we can ask Larry to backport this to the OSL 1.7.x branch and just update libs then. Thanks for checking!

Added subscriber: @Sergey

Added subscriber: @Sergey

@ThomasDinges, it is really rare case when 32bit application will crash on 64bit OS and will not crash on 32bit. It totally worth investigaiton.

@LazyDodo, this is a good find, but commit message does not mention anything about what and it was changed and whether it fixes anything. and why would that code run fine on 64bit and fail on 32bit? And why wouldn't that issue re-appear in the future?

What i mean is, it totally worth checking with OSL guys if it's a legit fix or just co-incidence which happened to fix our issue.

@ThomasDinges, are you in contact with Larry about this?

@ThomasDinges, it is really rare case when 32bit application will crash on 64bit OS and will not crash on 32bit. It totally worth investigaiton. @LazyDodo, this is a good find, but commit message does not mention anything about what and it was changed and whether it fixes anything. and why would that code run fine on 64bit and fail on 32bit? And why wouldn't that issue re-appear in the future? What i mean is, it totally worth checking with OSL guys if it's a legit fix or just co-incidence which happened to fix our issue. @ThomasDinges, are you in contact with Larry about this?

I am not in contact with Larry about this, will leave this to someone else. :)

I am not in contact with Larry about this, will leave this to someone else. :)

Added subscriber: @brecht

Added subscriber: @brecht

The fix for this was committed in the OSL RB-1.7 branch:
f93f04c823

The remaining work here then is to rebuild the 32 bit OSL libraries on Windows and Linux, and update install_deps.sh.

The fix for this was committed in the OSL RB-1.7 branch: https://github.com/imageworks/OpenShadingLanguage/commit/f93f04c823ab24513757abf90a5e44143d3dd435 The remaining work here then is to rebuild the 32 bit OSL libraries on Windows and Linux, and update `install_deps.sh`.
Member

In #48542#377285, @Sergey wrote:
@ThomasDinges, it is really rare case when 32bit application will crash on 64bit OS and will not crash on 32bit. It totally worth investigaiton.

Actually this bit is wrong, this bug affects all 32 bit builds, not just the ones running on x64.

@LazyDodo, this is a good find, but commit message does not mention anything about what and it was changed and whether it fixes anything. and why would that code run fine on 64bit and fail on 32bit? And why wouldn't that issue re-appear in the future?

Messing up the calling convention will do that , not an issue on code build for x64 cause x64 ignores fastcall (at-least on msvc can't say for sure how gcc handles this) and uses 'standard' calling convention.

What i mean is, it totally worth checking with OSL guys if it's a legit fix or just co-incidence which happened to fix our issue.

It seemed deliberate but you're right the commit is a bit sparse on why they made this change or what bug they were solving.

@ThomasDinges, are you in contact with Larry about this?

Brecht seems to have had contact with them?

There was talk of a 2.77b build during last meeting, this is probably one that we should include if we were to do 2.77b

> In #48542#377285, @Sergey wrote: > @ThomasDinges, it is really rare case when 32bit application will crash on 64bit OS and will not crash on 32bit. It totally worth investigaiton. Actually this bit is wrong, this bug affects all 32 bit builds, not just the ones running on x64. > @LazyDodo, this is a good find, but commit message does not mention anything about what and it was changed and whether it fixes anything. and why would that code run fine on 64bit and fail on 32bit? And why wouldn't that issue re-appear in the future? Messing up the calling convention will do that , not an issue on code build for x64 cause x64 ignores fastcall (at-least on msvc can't say for sure how gcc handles this) and uses 'standard' calling convention. > What i mean is, it totally worth checking with OSL guys if it's a legit fix or just co-incidence which happened to fix our issue. It seemed deliberate but you're right the commit is a bit sparse on why they made this change or what bug they were solving. > @ThomasDinges, are you in contact with Larry about this? Brecht seems to have had contact with them? There was talk of a 2.77b build during last meeting, this is probably one that we should include if we were to do 2.77b
Thomas Szepe changed title from OSL crash after activation (using 32bit blender on 64bit windows) to OSL crash after activation on 32bit windows 2016-07-02 18:29:32 +02:00

I updated install_depsh.sh, to use the new OSL 1.7.3. System libraries for Windows and Mac still need to be updated.

I updated install_depsh.sh, to use the new OSL 1.7.3. System libraries for Windows and Mac still need to be updated.
Member

New title is wrong, this affects ALL 32 bit builds, inc linux.

New title is wrong, this affects *ALL* 32 bit builds, inc linux.
Thomas Dinges changed title from OSL crash after activation on 32bit windows to OSL crash on 32bit 2016-07-02 18:56:38 +02:00

Added subscriber: @lpjunior999

Added subscriber: @lpjunior999

Changed status from 'Open' to: 'Resolved'

Changed status from 'Open' to: 'Resolved'
Sergey Sharybin self-assigned this 2016-07-12 13:48:12 +02:00

I've updated crucial platforms for this issue and poked buildbot to deliver new builds.

There are still some missing updates, but those platforms are 64bit only, so does not affect this issue.

Thanks for the report and investigation, closing it now!

I've updated crucial platforms for this issue and poked buildbot to deliver new builds. There are still some missing updates, but those platforms are 64bit only, so does not affect this issue. Thanks for the report and investigation, closing it now!
Sign in to join this conversation.
No Label
Interest
Alembic
Interest
Animation & Rigging
Interest
Asset Browser
Interest
Asset Browser Project Overview
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
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
7 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#48542
No description provided.