MSVC 2011 - 2012 bug: Blender Startup Failure when called from a process without SDOUT (Python crashes) #40907

Closed
opened 2014-07-01 17:42:26 +02:00 by Ignacio · 39 comments

Blender Version
Broken: Blender on Windows built with MSVC 11.0 or later (includes 2.71 release)
Worked: 2.70a and earlier

When Blender is called from a subprocess with no STDOUT available, the Py_Initialize procedure will cause a fatal error, due to a bug in more recent MSVC versions. (This issue will be fixed in MSVC 14)

The respective Issue on the Python Tracker:
http://bugs.python.org/issue17797

This breaks the Auto-Import functionality for blend files in Unity (unity3d.com), where a .blend dropped in an asset directory will be automatically converted to FBX by calling the Blender executable (and the FBX exporter python module).

I can confirm that a possible workaround outlined at http://bugs.python.org/issue17797#msg201964 fixes the issue. This would imply modifying pythonrun.c and replacing the Python34.dll with a modified version.

**Blender Version** Broken: Blender on Windows built with MSVC 11.0 or later (includes 2.71 release) Worked: 2.70a and earlier When Blender is called from a subprocess with no STDOUT available, the Py_Initialize procedure will cause a fatal error, due to a bug in more recent MSVC versions. (This issue will be fixed in MSVC 14) The respective Issue on the Python Tracker: http://bugs.python.org/issue17797 This breaks the Auto-Import functionality for blend files in Unity (unity3d.com), where a .blend dropped in an asset directory will be automatically converted to FBX by calling the Blender executable (and the FBX exporter python module). I can confirm that a possible workaround outlined at http://bugs.python.org/issue17797#msg201964 fixes the issue. This would imply modifying pythonrun.c and replacing the Python34.dll with a modified version.
Author

Changed status to: 'Open'

Changed status to: 'Open'
Author

Added subscriber: @Ignaramus

Added subscriber: @Ignaramus

blender/blender#41053 was marked as duplicate of this issue

blender/blender#41053 was marked as duplicate of this issue

blender/blender#41129 was marked as duplicate of this issue

blender/blender#41129 was marked as duplicate of this issue

blender/blender#40928 was marked as duplicate of this issue

blender/blender#40928 was marked as duplicate of this issue

blender/blender#41089 was marked as duplicate of this issue

blender/blender#41089 was marked as duplicate of this issue

blender/blender#41101 was marked as duplicate of this issue

blender/blender#41101 was marked as duplicate of this issue
Author

Modified pythonrun.c with fixes according to http://bugs.python.org/issue17797#msg201964

Modified pythonrun.c with fixes according to http://bugs.python.org/issue17797#msg201964
Author

Fixed DLL for 32-Bit Windows

Fixed DLL for 32-Bit Windows
Author

Fixed DLL for 64-Bit Windows

Fixed DLL for 64-Bit Windows

Added subscribers: @ideasman42, @MartijnBerger, @mont29

Added subscribers: @ideasman42, @MartijnBerger, @mont29

Thanks for tracking that issue down!

Adding our py & win maintainers here too.

I doubt we’ll ever agree to distribute a patched version of python with our Blender but at least users that really need that feature from Unity now have a workaround… I’d bet this report will stay open for quite a bit of time (thanks M$).

PS: There may be another way around that issue, though, less intrusive - python can call processes with its own stdin/out/err, so a simple modification of Unity script to feature such fake streams might solve it, without having to replace whole py dll?

Thanks for tracking that issue down! Adding our py & win maintainers here too. I doubt we’ll ever agree to distribute a patched version of python with our Blender but at least users that really need that feature from Unity now have a workaround… I’d bet this report will stay open for quite a bit of time (thanks M$). PS: There may be another way around that issue, though, less intrusive - python can call processes with its own stdin/out/err, so a simple modification of Unity script to feature such fake streams might solve it, without having to replace whole py dll?
Author

The Blender process itself crashes on Python Initialization, so there is no hope to have the script run in the first place, Unity itself does not use Python. They should be able to work around this, depending on how they handle subprocesses, but not a simply as that.

The Blender process itself crashes on Python Initialization, so there is no hope to have the script run in the first place, Unity itself does not use Python. They should be able to work around this, depending on how they handle subprocesses, but not a simply as that.

Ah ok… well, yes, not so simple in this case, indeed :/

Ah ok… well, yes, not so simple in this case, indeed :/

Added subscriber: @vitorbalbio-3

Added subscriber: @vitorbalbio-3
Bastien Montagne changed title from Blender Startup Failure on Windows when called from a process without SDOUT (Broken Unity Blender Auto-Import) to MSVC 2011 - 2012 bug: Blender Startup Failure when called from a process without SDOUT (Python crashes) 2014-07-02 16:05:56 +02:00

Set prio to 'Low', because we can’t do anything really here. I think it’s worth keeping it open though, so other users hitting the issue can find it (and the workaround)…

Set prio to 'Low', because we can’t do anything really here. I think it’s worth keeping it open though, so other users hitting the issue can find it (and the workaround)…

Added subscriber: @compositor1

Added subscriber: @compositor1

◀ Merged tasks: blender/blender#40928.

◀ Merged tasks: blender/blender#40928.

Added subscriber: @jrestemeier

Added subscriber: @jrestemeier

Added subscriber: @dudeprgm

Added subscriber: @dudeprgm

Added subscriber: @ygtsvtr

Added subscriber: @ygtsvtr

Added subscriber: @firedrake150

Added subscriber: @firedrake150

◀ Merged tasks: blender/blender#41053.

◀ Merged tasks: blender/blender#41053.

Added subscriber: @agentc0re

Added subscriber: @agentc0re

◀ Merged tasks: blender/blender#41089.

◀ Merged tasks: blender/blender#41089.

Added subscriber: @JJDeveloper

Added subscriber: @JJDeveloper

◀ Merged tasks: blender/blender#41101.

◀ Merged tasks: blender/blender#41101.

Added subscriber: @SememeS

Added subscriber: @SememeS

Added subscriber: @Rigo.CL

Added subscriber: @Rigo.CL

Added subscriber: @Riw

Added subscriber: @Riw

◀ Merged tasks: blender/blender#41129.

◀ Merged tasks: blender/blender#41129.

Added subscriber: @piiichan

Added subscriber: @piiichan

Removed subscriber: @agentc0re

Removed subscriber: @agentc0re

Added subscriber: @SimeonConzendorf

Added subscriber: @SimeonConzendorf

This issue was referenced by None@61419

This issue was referenced by None@61419
Member

Changed status from 'Open' to: 'Resolved'

Changed status from 'Open' to: 'Resolved'
Member

Closed by commit rBL61419.

Closed by commit rBL61419.

This issue was referenced by None@61420

This issue was referenced by None@61420

Added subscriber: @helt_vilt

Added subscriber: @helt_vilt
Sign in to join this conversation.
No Milestone
No project
No Assignees
14 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-addons#40907
No description provided.