Blender crashes with Rendered 3d view use of freestyle #46604

Closed
opened 2015-10-26 06:47:56 +01:00 by Jaggz H · 7 comments

System Information
Debian (jessie) x64.

Blender Version
2.76

Worked: n/a

A particular Freestyle use causes segfault

Exact steps for others to reproduce the error
Load attached .blend. Switch upper right view to Rendered view. Crashes on my system and Olson's.

test.blend

**System Information** Debian (jessie) x64. **Blender Version** 2.76 Worked: n/a A particular Freestyle use causes segfault **Exact steps for others to reproduce the error** Load attached .blend. Switch upper right view to Rendered view. Crashes on my system and Olson's. [test.blend](https://archive.blender.org/developer/F247454/test.blend)
Author

Changed status to: 'Open'

Changed status to: 'Open'
Author

Added subscriber: @jaggz

Added subscriber: @jaggz

Added subscribers: @kjym3, @ideasman42

Added subscribers: @kjym3, @ideasman42
Tamito Kajiyama was assigned by Campbell Barton 2015-10-26 07:20:49 +01:00

Confirmed the crash,

This looks like a missing NULL check, and this patch stops the crash: P276

However after its applied, a Python exception is raised:

      read blend: /d/test(6).blend
      expected cost = 3.924107 (4)
      Traceback (most recent call last):
        File "/d/test(6).blend/japanese_bigbrush-bdh.py", line 32, in <module>
      RuntimeError: Operators.bidirectional_chain() failed
      
      location: <unknown location>:-1
      
      location: <unknown location>:-1
      
      Error executing Python script from PythonInterpreter::interpretText
      Name: japanese_bigbrush-bdh.py
      Errors: 
      Error: Traceback (most recent call last):
        File "/d/test(6).blend/japanese_bigbrush-bdh.py", line 32, in <module>
      RuntimeError: Operators.bidirectional_chain() failed

@kjym3, would you be able to look into this for 2.76a bugfix release?

Confirmed the crash, This looks like a missing NULL check, and this patch stops the crash: [P276](https://archive.blender.org/developer/P276.txt) However after its applied, a Python exception is raised: ``` read blend: /d/test(6).blend expected cost = 3.924107 (4) Traceback (most recent call last): File "/d/test(6).blend/japanese_bigbrush-bdh.py", line 32, in <module> RuntimeError: Operators.bidirectional_chain() failed location: <unknown location>:-1 location: <unknown location>:-1 Error executing Python script from PythonInterpreter::interpretText Name: japanese_bigbrush-bdh.py Errors: Error: Traceback (most recent call last): File "/d/test(6).blend/japanese_bigbrush-bdh.py", line 32, in <module> RuntimeError: Operators.bidirectional_chain() failed ``` @kjym3, would you be able to look into this for 2.76a bugfix release?

This issue was referenced by 52d074ba39

This issue was referenced by 52d074ba39ec4ec5c8bdd54fbd143745f4bb5f7c

Changed status from 'Open' to: 'Resolved'

Changed status from 'Open' to: 'Resolved'

Thank you Campbell for the proposed fix.

Short summary of the problem and expected behavior after the fix: There is a coding error at line 32 of the user program japanese_bigbrush-bdh.py (in the Text Editor in the provided .blend file). After the fix the rendering should raise a Python exception at run time.

Long explanation behind the short summary:

The freestyle.chainingiterator.ChainPredicateIterator class is usually instantiated with two predicate objects supplied as the first two arguments. The problem was that it was possible to instantiate the class without predicates, and there were missing NULL checks as identified by Campbell.

There were two possible solutions. One solution was to permit the instantiation of the ChainPredicateIterator class as it was and let it run without run-time errors. The other (i.e., present) solution is not to permit the class instantiation without predicates in the first place. Allowing the instantiation without predicates while raising errors at run time does not make sense to me, so it was not considered as a solution here.

Then the question was which of the two possibilities would be preferable as a proposed solution. The most straightforward choice to me was the latter solution, because the ChainPredicateIterator is specifically intended to work with predicates. As a matter of fact, the idea of permitting the class instantiation without predicates came from the original authors of Freestyle much before its integration into Blender. The only reasonable expected behavior of the ChainPredicateIterator without predicates is to do nothing. That is, it provides users with a way to define a no-op chaining iterator. But the Freestyle Python API reference manual indicates that the class constructor takes four optional parameters even when no predicate objects are supplied as arguments. What is the point of having optional parameters when the class instance is supposed to be a no-op operator? That does not make much sense to me.

So, my decision (on the API design actually) is not to allow the ChainPredicateIterator class to be instantiated without predicates. This implies that the user-defined Freestyle Python module in the provided .blend file now contains an API violation that needs to be fixed on the user side.

The proposed solution contains a backward-incompatible API change, but it should rather be considered as a fix of an API bug.

Thank you Campbell for the proposed fix. Short summary of the problem and expected behavior after the fix: There is a coding error at line 32 of the user program japanese_bigbrush-bdh.py (in the Text Editor in the provided .blend file). After the fix the rendering should raise a Python exception at run time. Long explanation behind the short summary: The freestyle.chainingiterator.ChainPredicateIterator class is usually instantiated with two predicate objects supplied as the first two arguments. The problem was that it was possible to instantiate the class without predicates, and there were missing NULL checks as identified by Campbell. There were two possible solutions. One solution was to permit the instantiation of the ChainPredicateIterator class as it was and let it run without run-time errors. The other (i.e., present) solution is not to permit the class instantiation without predicates in the first place. Allowing the instantiation without predicates while raising errors at run time does not make sense to me, so it was not considered as a solution here. Then the question was which of the two possibilities would be preferable as a proposed solution. The most straightforward choice to me was the latter solution, because the ChainPredicateIterator is specifically intended to work with predicates. As a matter of fact, the idea of permitting the class instantiation without predicates came from the original authors of Freestyle much before its integration into Blender. The only reasonable expected behavior of the ChainPredicateIterator without predicates is to do nothing. That is, it provides users with a way to define a no-op chaining iterator. But [the Freestyle Python API reference manual ](http://www.blender.org/api/blender_python_api_2_73_release/freestyle.chainingiterators.html#freestyle.chainingiterators.ChainPredicateIterator) indicates that the class constructor takes four optional parameters even when no predicate objects are supplied as arguments. What is the point of having optional parameters when the class instance is supposed to be a no-op operator? That does not make much sense to me. So, my decision (on the API design actually) is not to allow the ChainPredicateIterator class to be instantiated without predicates. This implies that the user-defined Freestyle Python module in the provided .blend file now contains an API violation that needs to be fixed on the user side. The proposed solution contains a backward-incompatible API change, but it should rather be considered as a fix of an API bug.
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
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#46604
No description provided.