Page MenuHome

addons cause an EXCEPTION_ACCESS_VIOLATION possibly from mesh edit optimizations.
Closed, ResolvedPublic

Description

System Information
Operating system: Windows-10-10.0.19041-SP0 64 Bits
Graphics card: NVIDIA GeForce GTX 780 Ti/PCIe/SSE2 NVIDIA Corporation 4.5.0 NVIDIA 466.27

Blender Version
Broken: version: 3.0.0 Alpha, branch: master, commit date: 2021-06-17 22:22, hash: rB94c4a9995e43
Worked: 2 weeks ago.

Short description of error
Sorry if i can't explain this correctly it's way over my head, some addons that have operations that has something to do with bmesh or BVHtrees are causing an EXCEPTION_ACCESS_VIOLATION.

Exact steps for others to reproduce the error
Just enable an addon and use an operation.

PolyQuilt or Fast-Loop are free for testing just enabling the addon go in to edit mode then press the addon in toolbar should cause an EXCEPTION_ACCESS_VIOLATION for both.

I will also leave a zip file with some crash logs.

Event Timeline

Lamia created this task.Jun 18 2021, 10:06 AM
Fen (chemicalcrux) changed the task status from Needs Triage to Confirmed.EditedJun 18 2021, 3:03 PM

I ran PolyQuilt with AddressSanitizer enabled and got this crash:

==16360==ERROR: AddressSanitizer: access-violation on unknown address 0x000000000000 (pc 0x7ff6f6450f16 bp 0x12d383a9a1d0 sp 0x00aed69fbef0 T0)
==16360==The signal is caused by a READ memory access.
==16360==Hint: address points to the zero page.
    #0 0x7ff6f6450f15 in BM_mesh_calc_tessellation_ex D:\blender-git\blender\source\blender\bmesh\intern\bmesh_mesh_tessellate.c:274
    #1 0x7ff6f6450fcb in BM_mesh_calc_tessellation D:\blender-git\blender\source\blender\bmesh\intern\bmesh_mesh_tessellate.c:283
    #2 0x7ff70065fa4c in C_BVHTree_FromBMesh D:\blender-git\blender\source\blender\python\mathutils\mathutils_bvhtree.c:972

So, it's reading a null pointer. Line 274 is:

bm_mesh_calc_tessellation__single_threaded(bm, looptris, params->face_normals);

The only thing that reads here is params->face_normals, so params is probably null. The function it's in, where params is the third argument, is invoked on line 283:

BM_mesh_calc_tessellation_ex(bm, looptris, false);

...and there's our null pointer! I suspect it should be passing a struct with a boolean member, rather than just a boolean :)

It looks like there was a commit four days ago that added some new tessellation features. @Campbell Barton (campbellbarton) could you have a look at that, since your name's on the commit?

Here's a quick replication case: creating a BVHTree from a BMesh will cause the crash. Just run the script in the text editor.