Page MenuHome

OSL crash on 32bit
Closed, ResolvedPublic

Description

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

  1. Switch to Cycles Render
  2. Change the viewport shading mode to "Rendered"
  3. Activate "Open Shading Language" in the render panel
  4. Blender will crash.

Details

Type
Bug

Event Timeline

Thomas Szepe (hg1) raised the priority of this task from to Needs Triage by Developer.
Thomas Szepe (hg1) updated the task description. (Show Details)
Thomas Szepe (hg1) set Type to Bug.

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?

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.

Bastien Montagne (mont29) lowered the priority of this task from Needs Triage by Developer to Normal.May 29 2016, 5:02 PM

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, @Martijn Berger (juicyfruit) maybe you can try to reproduce?

Bastien Montagne (mont29) renamed this task from OSL crash after activation to OSL crash after activation (using 32bit blender on 64bit windows).May 29 2016, 5:03 PM

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 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.

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.

Thomas Dinges (dingto) triaged this task as Confirmed, Low priority.May 29 2016, 10:55 PM

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...

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?

LazyDodo (LazyDodo) added a comment.EditedMay 30 2016, 3:50 PM

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 can confirm the crash on windows 7 32 bit.

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!

Thomas Dinges (dingto) raised the priority of this task from Confirmed, Low to Confirmed, Medium.Jun 2 2016, 9:59 PM

@Thomas Dinges (dingto), it is really rare case when 32bit application will crash on 64bit OS and will not crash on 32bit. It totally worth investigaiton.

@LazyDodo (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.

@Thomas Dinges (dingto), are you in contact with Larry about this?

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

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.

@Thomas Dinges (dingto), 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 (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.

@Thomas Dinges (dingto), 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 (hg1) renamed this task from OSL crash after activation (using 32bit blender on 64bit windows) to OSL crash after activation on 32bit windows.Jul 2 2016, 6:29 PM

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

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

Thomas Dinges (dingto) renamed this task from OSL crash after activation on 32bit windows to OSL crash on 32bit.Jul 2 2016, 6:56 PM
Sergey Sharybin (sergey) closed this task as Resolved.Jul 12 2016, 1:48 PM
Sergey Sharybin (sergey) claimed this task.

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!