Page MenuHome

Crash while working on drivers
Closed, ResolvedPublic

Description

System Information
Operating system: Ubuntu 18.04
Graphics card: 2x GTX 1060

Blender Version
Broken: 2.80

Short description of error
Unfortunately, this is a non-repeatable crash. I ran into it a couple of times as I was adding/editing drivers to a face rig I'm working on. The rig itself and the drivers are not complicated. It appears to happen after adding several drivers. The best I can do is attach the file I'm working on and the core dump log.

Exact steps for others to reproduce the error
Based on the default startup or an attached .blend file (as simple as possible).
cat /tmp/facial_rig.crash.txt

Blender 2.80 (sub 40), Commit date: 2019-01-05 17:08, Hash 674d364af0b1

Can't edit driven number value, see graph editor for the driver setup. # Info
bpy.data.shape_keys["Expressions"].key_blocks["Expressions_eyeSquintR_min"].value = 0 # Property
bpy.context.object.active_shape_key_index = 33 # Property
bpy.data.shape_keys["Expressions"].key_blocks["Expressions_eyesHoriz_max"].value = 0 # Property
bpy.context.object.active_shape_key_index = 32 # Property
bpy.data.shape_keys["Expressions"].(null) = "-var" # Property
bpy.data.shape_keys["Expressions"].(null) = 'LOCAL_SPACE' # Property
bpy.data.shape_keys["Expressions"].(null) = bpy.data.objects["MBLab_skeleton_face_rig"] # Property
bpy.data.shape_keys["Expressions"].(null) = "Expressions_eyesLookAt" # Property
bpy.ops.graph.fmodifier_add(type='GENERATOR') # Operator
bpy.ops.transform.translate(value=(-0.00967666, -2.81112e-10, 0.00209225), constraint_matrix=(1, 0, -0, 0, 0, 1, 0, -1, 0), constraint_orientation='NORMAL', mirror=False, proportional='DISABLED', proportional_edit_falloff='SMOOTH', proportional_size=1) # Operator
bpy.ops.pose.loc_clear() # Operator
bpy.context.object.active_shape_key_index = 33 # Property
bpy.data.shape_keys["Expressions"].(null) = "var" # Property
bpy.data.shape_keys["Expressions"].(null) = 'LOC_Y' # Property
bpy.data.shape_keys["Expressions"].(null) = "-var" # Property
bpy.ops.transform.translate(value=(-0.0573381, 0, 0), constraint_axis=(True, False, False), constraint_matrix=(1, 0, -0, 0, 0, 1, 0, -1, 0), constraint_orientation='NORMAL', mirror=False, proportional='DISABLED', proportional_edit_falloff='SMOOTH', proportional_size=1) # Operator
bpy.data.window_managers["WinMan"].(null)[0] = -0.057338 # Property
bpy.ops.transform.translate(value=(-0.057338, 0, 0), constraint_axis=(True, False, False), constraint_matrix=(1, 0, -0, 0, 0, 1, 0, -1, 0), constraint_orientation='NORMAL', mirror=False, proportional='DISABLED', proportional_edit_falloff='SMOOTH', proportional_size=1) # Operator
bpy.context.space_data.context = 'BONE_CONSTRAINT' # Property
bpy.ops.pose.constraint_add(type='LIMIT_LOCATION') # Operator
bpy.context.object.pose.bones["Expressions_eyesLookAt"].constraints["Limit Location"].max_x = -0.057338 # Property
bpy.context.object.pose.bones["Expressions_eyesLookAt"].constraints["Limit Location"].min_x = 0.057338 # Property
bpy.ops.transform.translate(value=(0, 0.047923, 0), constraint_axis=(False, True, False), constraint_matrix=(1, 0, -0, 0, 0, 1, 0, -1, 0), constraint_orientation='NORMAL', mirror=False, proportional='DISABLED', proportional_edit_falloff='SMOOTH', proportional_size=1) # Operator
bpy.data.window_managers["WinMan"].(null)[1] = 0.047923 # Property
bpy.ops.transform.translate(value=(0, 0.047923, 0), constraint_axis=(False, True, False), constraint_matrix=(1, 0, -0, 0, 0, 1, 0, -1, 0), constraint_orientation='NORMAL', mirror=False, proportional='DISABLED', proportional_edit_falloff='SMOOTH', proportional_size=1) # Operator
bpy.context.object.pose.bones["Expressions_eyesLookAt"].constraints["Limit Location"].min_y = 0.047923 # Property
bpy.context.object.pose.bones["Expressions_eyesLookAt"].constraints["Limit Location"].max_y = -0.047923 # Property
bpy.context.object.pose.bones["Expressions_eyesLookAt"].constraints["Limit Location"].use_min_y = True # Property
bpy.context.object.pose.bones["Expressions_eyesLookAt"].constraints["Limit Location"].use_max_y = True # Property
bpy.context.object.pose.bones["Expressions_eyesLookAt"].constraints["Limit Location"].use_max_x = True # Property
bpy.context.object.pose.bones["Expressions_eyesLookAt"].constraints["Limit Location"].use_min_x = True # Property
bpy.context.object.pose.bones["Expressions_eyesLookAt"].constraints["Limit Location"].owner_space = 'LOCAL' # Property
bpy.context.object.pose.bones["Expressions_eyesLookAt"].constraints["Limit Location"].mute = True # Property
bpy.context.object.pose.bones["Expressions_eyesLookAt"].location[1] = 0.425595 # Property
bpy.context.object.pose.bones["Expressions_eyesLookAt"].constraints["Limit Location"].min_y = 0.425595 # Property
bpy.context.object.pose.bones["Expressions_eyesLookAt"].constraints["Limit Location"].max_y = 0.425595 # Property
bpy.context.object.pose.bones["Expressions_eyesLookAt"].constraints["Limit Location"].min_y = -0.425595 # Property
bpy.context.object.pose.bones["Expressions_eyesLookAt"].location[0] = -0.509208 # Property
bpy.context.object.pose.bones["Expressions_eyesLookAt"].constraints["Limit Location"].min_x = -0.509208 # Property
bpy.context.object.pose.bones["Expressions_eyesLookAt"].constraints["Limit Location"].max_x = 0.509208 # Property
bpy.context.object.pose.bones["Expressions_eyesLookAt"].constraints["Limit Location"].mute = False # Property
bpy.ops.pose.loc_clear() # Operator
Saved "facial_rig.blend" # Info
bpy.context.space_data.context = 'DATA' # Property
bpy.context.object.active_shape_key_index = 42 # Property
bpy.data.shape_keys["Expressions"].(null) = 'ROT_X' # Property
bpy.data.shape_keys["Expressions"].(null) = "var" # Property
bpy.data.shape_keys["Expressions"].(null) = 'LOCAL_SPACE' # Property
bpy.data.shape_keys["Expressions"].(null) = bpy.data.objects["MBLab_skeleton_face_rig"] # Property
bpy.data.shape_keys["Expressions"].(null) = "Expressions_mouthChew_max_min" # Property
bpy.ops.transform.rotate(value=-0.0826937, axis=(-0, 1, 1.34359e-07), constraint_matrix=(-0.00149694, -0.999996, 0.00258612, 0.999996, -0.00150362, -0.00258206, 0.00258593, 0.00258224, 0.999993), constraint_orientation='NORMAL', mirror=False, proportional='DISABLED', proportional_edit_falloff='SMOOTH', proportional_size=1) # Operator
bpy.ops.graph.fmodifier_add(type='GENERATOR') # Operator
bpy.ops.pose.loc_clear() # Operator
bpy.context.object.active_shape_key_index = 43 # Property
bpy.data.shape_keys["Expressions"].(null) = "-var" # Property
bpy.ops.transform.rotate(value=-0.454171, axis=(-0, 1, 1.34359e-07), constraint_matrix=(-0.00149694, -0.999995, 0.00258612, 0.996798, -0.00128538, 0.079955, -0.0799513, 0.00269753, 0.996795), constraint_orientation='NORMAL', mirror=False, proportional='DISABLED', proportional_edit_falloff='SMOOTH', proportional_size=1) # Operator
bpy.context.object.pose.bones["Expressions_mouthChew_max_min"].rotation_quaternion[1] = 0.265412 # Property
bpy.context.space_data.context = 'BONE_CONSTRAINT' # Property
bpy.ops.pose.constraint_add(type='LIMIT_ROTATION') # Operator
bpy.context.object.pose.bones["Expressions_mouthChew_max_min"].constraints["Limit Rotation"].max_x = 0.00463231 # Property
bpy.ops.transform.rotate(value=1.09597, axis=(-0, 1, 1.34359e-07), constraint_matrix=(-0.00149707, -0.999996, 0.00258612, 0.869663, -2.53171e-05, 0.493646, -0.493644, 0.00298807, 0.869659), constraint_orientation='NORMAL', mirror=False, proportional='DISABLED', proportional_edit_falloff='SMOOTH', proportional_size=1) # Operator
bpy.context.object.pose.bones["Expressions_mouthChew_max_min"].rotation_quaternion[1] = -0.294416 # Property
bpy.context.object.pose.bones["Expressions_mouthChew_max_min"].constraints["Limit Rotation"].min_x = -0.00513853 # Property
bpy.context.object.pose.bones["Expressions_mouthChew_max_min"].constraints["Limit Rotation"].owner_space = 'LOCAL' # Property
bpy.context.object.pose.bones["Expressions_mouthChew_max_min"].constraints["Limit Rotation"].min_x = -0.523599 # Property
bpy.context.object.pose.bones["Expressions_mouthChew_max_min"].constraints["Limit Rotation"].max_x = 0.523599 # Property
bpy.context.object.pose.bones["Expressions_mouthChew_max_min"].constraints["Limit Rotation"].use_transform_limit = True # Property
bpy.context.object.pose.bones["Expressions_mouthChew_max_min"].constraints["Limit Rotation"].use_limit_x = True # Property
bpy.ops.pose.loc_clear() # Operator
bpy.ops.pose.rot_clear() # Operator
bpy.context.space_data.context = 'DATA' # Property
bpy.data.shape_keys["Expressions"].(null) = "Expressions_mouthClosed_max_min" # Property

backtrace

./blender(BLI_system_backtrace+0x33) [0x5640d59d1c53]
./blender(+0xbf1960) [0x5640d4f24960]
/lib/x86_64-linux-gnu/libc.so.6(+0x3ef20) [0x7f569b407f20]
./blender(BKE_animsys_eval_driver+0x41) [0x5640d56535d1]
./blender(+0x16beb10) [0x5640d59f1b10]
./blender(BLI_task_pool_work_and_wait+0x18d) [0x5640d59d2b3d]
./blender(_ZN3DEG23deg_evaluate_on_refreshEPNS_9DepsgraphE+0x18b) [0x5640d59f1d8b]
./blender(BKE_scene_graph_update_tagged+0x97) [0x5640d5789837]
./blender(wm_event_do_depsgraph+0xd0) [0x5640d4f28b30]
./blender(wm_event_do_refresh_wm_and_depsgraph+0x85) [0x5640d4f28bd5]
./blender(wm_event_do_notifiers+0x45b) [0x5640d4f2f1fb]
./blender(WM_main+0x28) [0x5640d4f25438]
./blender(main+0x351) [0x5640d4f07c61]
/lib/x86_64-linux-gnu/libc.so.6(__libc_start_main+0xe7) [0x7f569b3eab97]
./blender(_start+0x2a) [0x5640d4f2105a]

Details

Type
Bug

Event Timeline

Here are more concrete steps I was able to use to reproduce the crash:

  1. Add driver to one of the facial expressions in the file
  2. Edit the driver by right clicking and then selecting "edit driver'
  3. Change the expression from var -> -var
  4. Copy the driver
  5. Paste it on a different facial expression
  6. Edit the driver by right clicking and then selecting "edit driver"
  7. change the expression from -var to var
  8. Go to the bone controlling the driver and move it
  9. Crash occurs

Saw the following output on the console:
Error in Driver: The following Python expression failed:

'var'

Traceback (most recent call last):

File "<bpy driver>", line 1, in <module>

NameError: name 'var' is not defined
find_node_operation: Failed for (BONE_DONE, '')
add_relation(Copy Rotation) - Could not find op_from (OperationKey(type: BONE, component name: 'spine01.001', operation code: BONE_DONE))
add_relation(Copy Rotation) - Failed, but op_to (OperationKey(type: BONE, component name: 'abd_muscle_01_R', operation code: BONE_CONSTRAINTS)) was ok

Error in Driver: The following Python expression failed:

'var'

did an initial triage through gdb with debug build:

(gdb) bt
#0 0x0000555557e27278 in BKE_animsys_eval_driver (depsgraph=0x7fffb37ef108, id=0x7fffbdac9e48, driver_index=49, driver_orig=0x7fffa53f9548)

at /home/ashehata/Software/blender_git/blender/source/blender/blenkernel/intern/anim_sys.c:3470

#1 0x000055555840ad83 in std::invoke_impl<void, void (*&)(Depsgraph*, ID*, int, ChannelDriver*), Depsgraph*, ID*&, int&, ChannelDriver*&>(std::invoke_other, void (*&)(Depsgraph*, ID*, int, ChannelDriver*), Depsgraph*&&, ID*&, int&, ChannelDriver*&) (__f=

@0x7fffa8fae800: 0x555557e271e7 <BKE_animsys_eval_driver>, __args#0=@0x7fffc8bfcd10: 0x7fffb37ef108, __args#1=@0x7fffa8fae818: 0x7fffbdac9e48, __args#2=@0x7fffa8fae810: 49, __args#3=@0x7fffa8fae808: 0x7fffa53f9548) at /usr/include/c++/7/bits/invoke.h:60

#2 0x00005555584098d0 in std::invoke<void (*&)(Depsgraph*, ID*, int, ChannelDriver*), Depsgraph*, ID*&, int&, ChannelDriver*&>(void (*&)(Depsgraph*, ID*, int, ChannelDriver*), Depsgraph*&&, ID*&, int&, ChannelDriver*&) (fn=

@0x7fffa8fae800: 0x555557e271e7 <BKE_animsys_eval_driver>, __args#0=@0x7fffc8bfcd10: 0x7fffb37ef108, __args#1=@0x7fffa8fae818: 0x7fffbdac9e48, __args#2=@0x7fffa8fae810: 49, __args#3=@0x7fffa8fae808: 0x7fffa53f9548) at /usr/include/c++/7/bits/invoke.h:95

#3 0x0000555558408149 in std::_Bind<void (*(std::_Placeholder<1>, ID*, int, ChannelDriver*))(Depsgraph*, ID*, int, ChannelDriver*)>::call<void, Depsgraph*&&, 0ul, 1ul, 2ul, 3ul>(std::tuple<Depsgraph*&&>&&, std::_Index_tuple<0ul, 1ul, 2ul, 3ul>) (this=0x7fffa8fae800, args=...) at /usr/include/c++/7/functional:467
#4 0x000055555840610a in std::_Bind<void (*(std::_Placeholder<1>, ID*, int, ChannelDriver*))(Depsgraph*, ID*, int, ChannelDriver*)>::operator()<Depsgraph*, void>(Depsgraph*&&) (this=0x7fffa8fae800, args#0=@0x7fffc8bfcd10: 0x7fffb37ef108) at /usr/include/c++/7/functional:551
#5 0x0000555558403058 in std::_Function_handler<void (Depsgraph*), std::_Bind<void (*(std::_Placeholder<1>, ID*, int, ChannelDriver*))(Depsgraph*, ID*, int, ChannelDriver*)> >::_M_invoke(std::_Any_data const&, Depsgraph*&&) (
functor=..., args#0=@0x7fffc8bfcd10: 0x7fffb37ef108) at /usr/include/c++/7/bits/std_function.h:316
#6 0x000055555841cd2b in std::function<void (Depsgraph*)>::operator()(Depsgraph*) const (this=0x7fffbda5a128,
args#0=0x7fffb37ef108) at /usr/include/c++/7/bits/std_function.h:706
#7 0x000055555841c30c in DEG::deg_task_run_func(TaskPool*, void*, int) (pool=0x7fffa4ff7008, taskdata=0x7fffbda5a0c8, thread_id=3)

at /home/ashehata/Software/blender_git/blender/source/blender/depsgraph/intern/eval/deg_eval.cc:95

#8 0x00005555583d97d4 in task_scheduler_thread_run (thread_p=0x7fffca8f1898) at /home/ashehata/Software/blender_git/blender/source/blender/blenlib/intern/task.c:442
#9 0x00007ffff54866db in start_thread (arg=0x7fffc8bfd700) at pthread_create.c:463
#10 0x00007ffff364788f in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:95
(gdb) p id
$1 = (ID *) 0x7fffbdac9e48
(gdb) p id
$2 = (ID *) 0x7fffbdac9e48
(gdb) p id->name
$3 = "KEExpressions", '\000' <repeats 52 times>
(gdb) p fcu
$4 = (FCurve *) 0x0
(gdb) p adt->driver_array
$5 = (FCurve **) 0x7fffc3ff31c8
(gdb) p adt->driver_array[49]
$6 = (FCurve *) 0x0

Crash occurs when trying to access a NULL pointer:
3470 »···DEG_debug_print_eval_subdata_index(
3471 »··· depsgraph, func, id->name, id, "fcu", fcu->rna_path, fcu, fcu->array_index);

Looks like the last element in adt->driver_array[] which has some valid data is adt->driver_array[48].

Could the driver index passed in be incremented one too far? Or race condition?

I have the core file if you want to inspect it.

I'm unable to reproduce with the latest build.

Brecht Van Lommel (brecht) claimed this task.

We'll assume it's fixed then? If you can find a way to reproduce it still we can reopen.