Page MenuHome

freestyle crashes blender
Closed, ResolvedPublic


System Information
OS: windows 8 64bit
GPU: nvidia gtx 860m

Blender Version
Broken: official 2.74
Worked: (optional)

Short description of error
when rendering a animation with freestyle and "line set" options enabled blender crashes

Exact steps for others to reproduce the error
Based on a (as simple as possible) attached .blend file with minimum amount of steps the blend file

  1. make sure freestyle is enabled
  2. render the animation a couple of times (till blender crashes)
# Blender 2.74 (sub 4), Commit date: 2015-04-10 18:20, Hash 465a5d2

# backtrace
27: PyInit_mathutils_noise_types - 0xC22CE050
26: fftw_assertion_failed - 0xC1CD27F0
25: fftw_assertion_failed - 0xC1CD27F0
24: UnhandledExceptionFilter - 0x62A01AD0
23: memset - 0x65694D00
22: _C_specific_handler - 0x656823C0
21: _chkstk - 0x65693A30
20: RtlRaiseException - 0x656574A0
19: KiUserExceptionDispatcher - 0x65692C20
18: PyMapping_Length - 0x77C12B80
17: PyMapping_Length - 0x77C12B80
16: fftw_assertion_failed - 0xC1CD27F0
15: PyInit_mathutils_noise_types - 0xC22CE050
14: PyInit_mathutils_noise_types - 0xC22CE050
13: PyInit_mathutils_noise_types - 0xC22CE050
12: fftw_assertion_failed - 0xC1CD27F0
11: fftw_assertion_failed - 0xC1CD27F0
10: fftw_assertion_failed - 0xC1CD27F0
9: fftw_assertion_failed - 0xC1CD27F0
8: fftw_assertion_failed - 0xC1CD27F0
7: fftw_assertion_failed - 0xC1CD27F0
6: fftw_assertion_failed - 0xC1CD27F0
5: fftw_assertion_failed - 0xC1CD27F0
4: sched_get_priority_max - 0x5F8412FD
3: sched_get_priority_max - 0x5F8412FD
2: sched_get_priority_max - 0x5F8412FD
1: BaseThreadInitThunk - 0x64B813B0
0: RtlUserThreadStart - 0x6566E920

there are also a couple of error messages when rendering when all "selection by" are disabled:
note that when these are disabled blender does not crash so i guess the crash is somehow caused by these options

Traceback (most recent call last):
  File "D:\SVN\Laser\blend\test01.blend\LineSet", line 1, in <module>
  File "D:\SVN\BlenderAddons\build\Blender_trunk_vs2013\bin\Release\2.74\scripts\freestyle\modules\",
 line 992, in process
    upred = AndUP1D(*selection_criteria)
  File "D:\SVN\BlenderAddons\build\Blender_trunk_vs2013\bin\Release\2.74\scripts\freestyle\modules\freestyle\predicates.
py", line 239, in __init__
    raise ValueError("Expected one or more UnaryPredicate1D, got ", len(predicates))
ValueError: ('Expected one or more UnaryPredicate1D, got ', 0)

location: <unknown location>:-1

location: <unknown location>:-1


Event Timeline

dan grauer (kromar) set Type to Bug.
dan grauer (kromar) created this task.
dan grauer (kromar) raised the priority of this task from to Needs Triage by Developer.

Main issue (crash with weird BT) is not specific to Freestyle, we have other similar reports, will merge this one in it.

I don't think merging is the correct thing to do, the backtrace does not work on release builds, and will display the exact same thing almost everywhere, regardless of the crash.

Tamito Kajiyama (kjym3) reopened this task as Open.

Many thanks @Antony Riakiotakis (psy-fi) for the notes on incorrect backtrace on release builds. I guess I was one of many who got confused by a backtrace that apparently makes no sense. I could reproduce the reported bug by a RelWithDebInfo build within VS 2013 (the bug was not reproducible in a Debug build). Here is a backtrace from the debugger.

 	python34.dll!0000000063f1c583()	Unknown
 	python34.dll!0000000063edfd93()	Unknown
>	blender-app.exe!BPY_text_free_code(Text * text) Line 183	C
 	blender-app.exe!BKE_text_free(Text * text) Line 172	C
 	blender-app.exe!BKE_libblock_free_ex(Main * bmain, void * idv, bool do_id_user) Line 982	C
 	blender-app.exe!FRS_do_stroke_rendering(Render * re, SceneRenderLayer * srl, int render) Line 643	C++
 	blender-app.exe!add_freestyle(Render * re, int render) Line 2088	C
 	blender-app.exe!do_render_3d(Render * re) Line 1451	C
 	blender-app.exe!do_render_fields_blur_3d(Render * re) Line 1736	C
 	blender-app.exe!do_render_composite_fields_blur_3d(Render * re) Line 2396	C
 	blender-app.exe!do_render_all_options(Render * re) Line 2643	C
 	blender-app.exe!RE_BlenderAnim(Render * re, Main * bmain, Scene * scene, Object * camera_override, unsigned int lay_override, int sfra, int efra, int tfra) Line 3569	C
 	blender-app.exe!render_startjob(void * rjv, short * stop, short * do_update, float * progress) Line 599	C
 	blender-app.exe!do_job_thread(void * job_v) Line 329	C
 	pthreadVC2.dll!000007feee0e627b()	Unknown
 	pthreadVC2.dll!000007feee0e8eb7()	Unknown
 	pthreadVC2.dll!000007feee0e9102()	Unknown
 	[External Code]

I still need to further investigate the cause of bug. There is something wrong in the layer of the Python API, but debug symbols are not available in the backtrace above, which makes it difficult to identify the reason of the crash.

Anyway I will reopen the issue as confirmed.

Tamito Kajiyama (kjym3) triaged this task as Confirmed, Medium priority.Apr 17 2015, 2:59 AM

Looks like this is caused by freeing compiled Python objects in a thread.

Suggest not to use Text data at all. Just allocate a buffer and call BPY_string_exec instead.

Wow thanks Campbell for the advice. I will try the suggested fix asap.

dan grauer (kromar) added a comment.EditedApr 28 2015, 10:45 PM

was this fix done in a branch? i still get the crash with the latest build but now the crashlog contains no more information except this

# Blender 2.74 (sub 5), Commit date: 2015-04-28 19:36, Hash cbb6013

# backtrace
Crash backtrace not supported on release builds

im building now a debug version and hopefully get more information about the crash, but im not a coder so i might need some help to do so.

EDIT: looks like its comming from a contrib addon ""

but i got a crashlog from a debug build so maybe that points to other problem

# Blender 2.74 (sub 5), Commit date: 2015-04-28 20:08, Hash f9d23b8

# backtrace
19: BLI_system_backtrace - 0xAF4ABA30
18: blender_crash_handler_backtrace - 0xAE286960
17: blender_crash_handler - 0xAE2869B0
16: windows_exception_handler - 0xAE286C30
15: UnhandledExceptionFilter - 0x6C311AD0
14: memset - 0x6F0A5140
13: _C_specific_handler - 0x6F092800
12: _chkstk - 0x6F0A3E70
11: RtlRaiseException - 0x6F063920
10: KiUserExceptionDispatcher - 0x6F0A3060
9: mesh_build_data - 0xAEFA1FA0
8: makeDerivedMesh - 0xAEF99400
7: BKE_object_handle_update_ex - 0xAEF3AB70
6: scene_update_object_func - 0xAEE51AA0
5: task_scheduler_thread_run - 0xAF5074A0
4: sched_get_priority_max - 0x63CD12FD
3: sched_get_priority_max - 0x63CD12FD
2: sched_get_priority_max - 0x63CD12FD
1: BaseThreadInitThunk - 0x6CA913B0
0: RtlUserThreadStart - 0x6F025410

@dan grauer (kromar), it is likely to be a race condition between threads, so ideally we need to have backtrace of all threads. Any chance you can get those from IDE?

Also, did i understand correct that disabling autosave addon solves the crashes?

@Sergey Sharybin (sergey), can you tell me what i need to do to get the backtrace from IDE?
and yes if i disable the austosave then i can not get it to crash (at least in the ~30-40 times i tried)

@dan grauer (kromar), not from a top of my head. Would probably be simplier to me to compile debug build and try to reproduce it first.

Also, it seems to be separate issue, so do you mind firing a new bug report and assigning to me?