Page MenuHome

Crash with to_mesh() on tapered bezier curve
Confirmed, NormalPublic

Description

System Information
Operating system: Windows 10 Pro, Build 1909
Graphics card: NVIDIA GeForce GTX 1050 Ti

Blender Version
Broken: 2.93.0, 3ea1779365b5 master, 2021-03-23
Broken since at least 2.90.0

Calling to_mesh() more than once on a tapered bezier curve will crash blender, but not if it is launched with blender_debug_log.cmd.

To Reproduce
Follow these steps:

  • Open blender normally
  • Create two bezier curve objects
  • Set the bevel depth of the first curve to a positive value
  • Set the taper object of the first curve to the second curve
  • Open the scripting view
  • Run bpy.data.objects["BezierCurve"].to_mesh()
  • Run the same command again and blender will crash

Or use the example .blend file:

  • Open blender normally
  • Open the example file
  • Hit enter to run the command in the console
  • Hit it up then enter to run the command again, blender will crash

Event Timeline

Pratik Borhade (PratikPB2123) changed the task status from Needs Triage to Confirmed.EditedWed, Mar 24, 6:51 AM

Thanks for the report , can confirm the crash .
Tested on :

version : 2.93.0 alpha , hash : 26b45448abf , commit date : 2021-03-24
Operating system : Windows-10-10.0.18362-SP0 64 Bits
Graphics card : AMD Radeon(TM) 535 ATI Technologies .
Philipp Oeser (lichtwerk) changed the task status from Confirmed to Needs Information from User.Wed, Mar 24, 1:44 PM

Cant confirm on linux btw. (both Debug and Release builds).

Would be interesting to know if it also crashes when you free the mesh afterwards using to_mesh_clear() [I think you are supposed to]?
https://docs.blender.org/api/master/bpy.types.Depsgraph.html#dependency-graph-object-to-mesh

@Pratik Borhade (PratikPB2123) : please remember to tag a module when confirming a report, see https://wiki.blender.org/wiki/Process/A_Bugs_Life

But for now, lets see if this still crashes using to_mesh_clear()

please remember to tag a module when confirming a report...

sure @Philipp Oeser (lichtwerk) , I always try to add the tag , but not sure about the tag I should add for this crash ( crash was related freeing memory ) .

So is it still happening when calling to_mesh_clear() in between?
If so, tag would be Python API

Added a call bpy.data.objects["BezierCurve"].to_mesh_clear() in between two to_mesh() call ( Still blender crashes ) .

Philipp Oeser (lichtwerk) changed the task status from Needs Information from User to Needs Triage.Fri, Mar 26, 1:54 PM
Pratik Borhade (PratikPB2123) changed the task status from Needs Triage to Confirmed.Fri, Mar 26, 2:15 PM

can confirm , crash occurs frequently . Still suggest some windows user to test it .

I tested here in 2.93 alpha and the crash don't happend anymore. Anyone can confirm this?
Cheers..

still getting the crash. tested again with version : 2.93.0 alpha , hash : 9975af5ffa7 , commit date : 2021-03-29
Hi @Pedro A. (povmaniaco) , are you on Windows ??

@Philipp Oeser (lichtwerk) can repro, feels like some kind of heap corruption or use after free business, try reproducing with an ASAN build, should pop right up

# Blender 2.93.0, Unknown revision

# backtrace
Exception Record:

ExceptionCode         : EXCEPTION_ACCESS_VIOLATION
Exception Address     : 0x00007FF6F2603DB7
Exception Module      : blender.exe
Exception Flags       : 0x00000000
Exception Parameters  : 0x2
	Parameters[0] : 0x0000000000000000
	Parameters[1] : 0x00000207FCDA8F80


Stack trace:
blender.exe         :0x00007FF6F2603D70  MEM_lockfree_allocN_len K:\BlenderGit\blender\intern\guardedalloc\intern\mallocn_lockfree_impl.c:96
blender.exe         :0x00007FF6F26041E0  MEM_lockfree_freeN K:\BlenderGit\blender\intern\guardedalloc\intern\mallocn_lockfree_impl.c:109
blender.exe         :0x00007FF6E7973FE0  BKE_object_free_derived_caches K:\BlenderGit\blender\source\blender\blenkernel\intern\object.c:1716
blender.exe         :0x00007FF6E7A04250  BKE_displist_make_curveTypes K:\BlenderGit\blender\source\blender\blenkernel\intern\displist.c:1743
blender.exe         :0x00007FF6E7A08920  displist_calc_taper K:\BlenderGit\blender\source\blender\blenkernel\intern\displist.c:649
blender.exe         :0x00007FF6E7A09250  do_makeDispListCurveTypes K:\BlenderGit\blender\source\blender\blenkernel\intern\displist.c:1652
blender.exe         :0x00007FF6E7A04400  BKE_displist_make_curveTypes_forRender K:\BlenderGit\blender\source\blender\blenkernel\intern\displist.c:1771
blender.exe         :0x00007FF6E7B7C830  curve_to_mesh_eval_ensure K:\BlenderGit\blender\source\blender\blenkernel\intern\mesh_convert.c:1106
blender.exe         :0x00007FF6E7B7D290  mesh_new_from_curve_type_object K:\BlenderGit\blender\source\blender\blenkernel\intern\mesh_convert.c:1127
blender.exe         :0x00007FF6E7B77D20  BKE_mesh_new_from_object K:\BlenderGit\blender\source\blender\blenkernel\intern\mesh_convert.c:1239
blender.exe         :0x00007FF6E797D6C0  BKE_object_to_mesh K:\BlenderGit\blender\source\blender\blenkernel\intern\object.c:5604
blender.exe         :0x00007FF6E8AA3030  rna_Object_to_mesh K:\BlenderGit\blender\source\blender\makesrna\intern\rna_object_api.c:400
blender.exe         :0x00007FF6E8A98F30  Object_to_mesh_call K:\BlenderGit\build_windows_Full_x64_vc16_Release\source\blender\makesrna\intern\rna_object_gen.c:3480
blender.exe         :0x00007FF6E87E6F60  RNA_function_call K:\BlenderGit\blender\source\blender\makesrna\intern\rna_access.c:7552
blender.exe         :0x00007FF6E8D04700  pyrna_func_call K:\BlenderGit\blender\source\blender\python\intern\bpy_rna.c:6362
python39_d.dll      :0x00007FF845136170  _PyObject_MakeTpCall e:\db19\build\s\vs1564d\build\python\src\external_python\objects\call.c:191
python39_d.dll      :0x00007FF8453ECB10  _PyObject_VectorcallTstate e:\db19\build\s\vs1564d\build\python\src\external_python\include\cpython\abstract.h:116
python39_d.dll      :0x00007FF8453ED100  call_function e:\db19\build\s\vs1564d\build\python\src\external_python\python\ceval.c:5075
python39_d.dll      :0x00007FF8453E1FB0  _PyEval_EvalFrameDefault e:\db19\build\s\vs1564d\build\python\src\external_python\python\ceval.c:3489
python39_d.dll      :0x00007FF8453E1260  _PyEval_EvalCode e:\db19\build\s\vs1564d\build\python\src\external_python\python\ceval.c:4327
python39_d.dll      :0x00007FF8453E1E80  _PyEval_EvalCodeWithName e:\db19\build\s\vs1564d\build\python\src\external_python\python\ceval.c:4366
python39_d.dll      :0x00007FF8453E0580  PyEval_EvalCodeEx e:\db19\build\s\vs1564d\build\python\src\external_python\python\ceval.c:4382
python39_d.dll      :0x00007FF8453E0540  PyEval_EvalCode e:\db19\build\s\vs1564d\build\python\src\external_python\python\ceval.c:832
python39_d.dll      :0x00007FF8453DB930  builtin_exec_impl e:\db19\build\s\vs1564d\build\python\src\external_python\python\bltinmodule.c:1035
python39_d.dll      :0x00007FF8453D32C0  builtin_exec e:\db19\build\s\vs1564d\build\python\src\external_python\python\clinic\bltinmodule.c.h:396
python39_d.dll      :0x00007FF8451D4A20  cfunction_vectorcall_FASTCALL e:\db19\build\s\vs1564d\build\python\src\external_python\objects\methodobject.c:426
python39_d.dll      :0x00007FF8453ECB10  _PyObject_VectorcallTstate e:\db19\build\s\vs1564d\build\python\src\external_python\include\cpython\abstract.h:119
python39_d.dll      :0x00007FF8453ED100  call_function e:\db19\build\s\vs1564d\build\python\src\external_python\python\ceval.c:5075
python39_d.dll      :0x00007FF8453E1FB0  _PyEval_EvalFrameDefault e:\db19\build\s\vs1564d\build\python\src\external_python\python\ceval.c:3519
python39_d.dll      :0x00007FF845137720  function_code_fastcall e:\db19\build\s\vs1564d\build\python\src\external_python\objects\call.c:330
python39_d.dll      :0x00007FF845134190  _PyFunction_Vectorcall e:\db19\build\s\vs1564d\build\python\src\external_python\objects\call.c:367
python39_d.dll      :0x00007FF8453ECB10  _PyObject_VectorcallTstate e:\db19\build\s\vs1564d\build\python\src\external_python\include\cpython\abstract.h:119
python39_d.dll      :0x00007FF8453ED100  call_function e:\db19\build\s\vs1564d\build\python\src\external_python\python\ceval.c:5075
python39_d.dll      :0x00007FF8453E1FB0  _PyEval_EvalFrameDefault e:\db19\build\s\vs1564d\build\python\src\external_python\python\ceval.c:3505
python39_d.dll      :0x00007FF8453E1260  _PyEval_EvalCode e:\db19\build\s\vs1564d\build\python\src\external_python\python\ceval.c:4327
python39_d.dll      :0x00007FF845134190  _PyFunction_Vectorcall e:\db19\build\s\vs1564d\build\python\src\external_python\objects\call.c:404
python39_d.dll      :0x00007FF8453ECB10  _PyObject_VectorcallTstate e:\db19\build\s\vs1564d\build\python\src\external_python\include\cpython\abstract.h:119
python39_d.dll      :0x00007FF8453ED100  call_function e:\db19\build\s\vs1564d\build\python\src\external_python\python\ceval.c:5075
python39_d.dll      :0x00007FF8453E1FB0  _PyEval_EvalFrameDefault e:\db19\build\s\vs1564d\build\python\src\external_python\python\ceval.c:3505
python39_d.dll      :0x00007FF845137720  function_code_fastcall e:\db19\build\s\vs1564d\build\python\src\external_python\objects\call.c:330
python39_d.dll      :0x00007FF845134190  _PyFunction_Vectorcall e:\db19\build\s\vs1564d\build\python\src\external_python\objects\call.c:367
python39_d.dll      :0x00007FF8453ECB10  _PyObject_VectorcallTstate e:\db19\build\s\vs1564d\build\python\src\external_python\include\cpython\abstract.h:119
python39_d.dll      :0x00007FF8453ED100  call_function e:\db19\build\s\vs1564d\build\python\src\external_python\python\ceval.c:5075
python39_d.dll      :0x00007FF8453E1FB0  _PyEval_EvalFrameDefault e:\db19\build\s\vs1564d\build\python\src\external_python\python\ceval.c:3505
python39_d.dll      :0x00007FF845137720  function_code_fastcall e:\db19\build\s\vs1564d\build\python\src\external_python\objects\call.c:330
python39_d.dll      :0x00007FF845134190  _PyFunction_Vectorcall e:\db19\build\s\vs1564d\build\python\src\external_python\objects\call.c:367
python39_d.dll      :0x00007FF8453ECB10  _PyObject_VectorcallTstate e:\db19\build\s\vs1564d\build\python\src\external_python\include\cpython\abstract.h:119
python39_d.dll      :0x00007FF8453ED100  call_function e:\db19\build\s\vs1564d\build\python\src\external_python\python\ceval.c:5075
python39_d.dll      :0x00007FF8453E1FB0  _PyEval_EvalFrameDefault e:\db19\build\s\vs1564d\build\python\src\external_python\python\ceval.c:3519
python39_d.dll      :0x00007FF845137720  function_code_fastcall e:\db19\build\s\vs1564d\build\python\src\external_python\objects\call.c:330
python39_d.dll      :0x00007FF845134190  _PyFunction_Vectorcall e:\db19\build\s\vs1564d\build\python\src\external_python\objects\call.c:367
python39_d.dll      :0x00007FF845133C50  PyVectorcall_Call e:\db19\build\s\vs1564d\build\python\src\external_python\objects\call.c:231
python39_d.dll      :0x00007FF845134B40  _PyObject_Call e:\db19\build\s\vs1564d\build\python\src\external_python\objects\call.c:266
python39_d.dll      :0x00007FF845133300  PyObject_Call e:\db19\build\s\vs1564d\build\python\src\external_python\objects\call.c:294
blender.exe         :0x00007FF6E8D064A0  bpy_class_call K:\BlenderGit\blender\source\blender\python\intern\bpy_rna.c:8567
blender.exe         :0x00007FF6E8838600  rna_operator_execute_cb K:\BlenderGit\blender\source\blender\makesrna\intern\rna_wm.c:1313
blender.exe         :0x00007FF6E7D5AFA0  wm_operator_invoke K:\BlenderGit\blender\source\blender\windowmanager\intern\wm_event_system.c:1362
blender.exe         :0x00007FF6E7D566B0  wm_handler_operator_call K:\BlenderGit\blender\source\blender\windowmanager\intern\wm_event_system.c:2178
blender.exe         :0x00007FF6E7D595D0  wm_handlers_do_keymap_with_keymap_handler K:\BlenderGit\blender\source\blender\windowmanager\intern\wm_event_system.c:2503
blender.exe         :0x00007FF6E7D58820  wm_handlers_do_intern K:\BlenderGit\blender\source\blender\windowmanager\intern\wm_event_system.c:2799
blender.exe         :0x00007FF6E7D57430  wm_handlers_do K:\BlenderGit\blender\source\blender\windowmanager\intern\wm_event_system.c:2931
blender.exe         :0x00007FF6E7D518C0  wm_event_do_handlers K:\BlenderGit\blender\source\blender\windowmanager\intern\wm_event_system.c:3421
blender.exe         :0x00007FF6E7D26F90  WM_main K:\BlenderGit\blender\source\blender\windowmanager\intern\wm.c:649
blender.exe         :0x00007FF6E724F540  main K:\BlenderGit\blender\source\creator\creator.c:524
blender.exe         :0x00007FF6F289CD90  invoke_main d:\agent\_work\1\s\src\vctools\crt\vcstartup\src\startup\exe_common.inl:79
blender.exe         :0x00007FF6F289CB40  __scrt_common_main_seh d:\agent\_work\1\s\src\vctools\crt\vcstartup\src\startup\exe_common.inl:288
blender.exe         :0x00007FF6F289CB20  __scrt_common_main d:\agent\_work\1\s\src\vctools\crt\vcstartup\src\startup\exe_common.inl:331
blender.exe         :0x00007FF6F289CE50  mainCRTStartup d:\agent\_work\1\s\src\vctools\crt\vcstartup\src\startup\exe_main.cpp:17
KERNEL32.DLL        :0x00007FF894647020  BaseThreadInitThunk
ntdll.dll           :0x00007FF896402630  RtlUserThreadStart

still getting the crash. tested again with version : 2.93.0 alpha , hash : 9975af5ffa7 , commit date : 2021-03-29
Hi @Pedro A. (povmaniaco) , are you on Windows ??

Yes, I'm on Windows. Finally I can reproduce also in 2.93 alpha