Log In
New Account
Home My Page Projects Blender 2.x BF release
Summary Activity Tracker SCM Files

Blender 2.6 Bug Tracker: Browse

[#19534] Crash adding/scaling plane in existing double array (temp fixed!)

Date:
2009-10-02 22:03
Priority:
2
State:
Closed
Submitted by:
Mario Kotlar (eagleshadow)
Assigned to:
Ben Batt (artificer)
Category:
Mesh Modeling
Status:
Fixed / Closed
Relates to:
Duplicates:
Patches:
 
Summary:
Crash adding/scaling plane in existing double array (temp fixed!)
Detailed description
Steps to recreate the error:

1. open the attached file
2. press tab to enter edit mode
3. press space and go "add -> mesh -> plane"
<sometimes it crashes at this point>
4. if blender didn't crash try scaling (press s and move mouse) the newly created plane and it will crash in like half a second.


when error occurs a line appears in blender's console:
Memoryblock CDDM_calc_normals temp_nors: end corrupt

I first found that error occurs on 2.49a, then I installed 2.49b (currently latest) and the error is still there in 2.49b.


<System info>
Manufacturer: Dell
Model: Vostro 1700
Processor: Intel(R) Core(TM)2 Duo CPU T7700 @ 2.40GHz (2 CPUs), ~2.4GHz
Memory: 3582MB RAM
Video Card: NVIDIA GeForce 8600M GT
Monitor: dual screen mode 1920x1200
Operating System:Windows Vistaâ„¢ Business sp2

Followup

Message
  • Date: 2010-03-21 06:17
  • Sender: Tom Musgrove
  • This is a generic request to test your bug report and see if it is still an issue in 2.5alpha2 if so please let me know by making a comment in this report ie 'also in 2.5alpha2' and I will add it to the 2.5 bug list.
  • Date: 2010-03-21 19:09
  • Sender: Tom Musgrove
  • Hi Tom, i read your reply to my bug report. I just confirmed that this bug stil happens in 2.5 alpha 2.

    Steps to recreate (updated):
    1. open the attached file (without loading old UI, in my case)
    2. press tab to enter edit mode and snap cursor to selection
    3. go "add -> mesh -> plane"
    <sometimes it crashes at this point>
    4. if blender didn't crash try scaling (press s and move mouse) the newly created plane and it will crash in like half a second.
  • Date: 2010-03-22 12:06
  • Sender: Matt Ebb
  • Confirmed, here's a backtrace:

    Memoryblock CDDM_calc_normals temp_nors: end corrupt

    Program received signal EXC_BAD_ACCESS, Could not access memory.
    Reason: KERN_INVALID_ADDRESS at address: 0x00000004365a4f98
    0x000000010066b8ee in normal_quad_v3 (n=0x11a0b1e30, v1=0x1174e9070, v2=0x1174e9130, v3=0x4365a4f98, v4=0x1174e8fb0) at /Developer/bf-blender/blender/source/blender/blenlib/intern/math_geom.c:70
    70 n1[0]= v1[0]-v3[0];
    (gdb) bt
    #0 0x000000010066b8ee in normal_quad_v3 (n=0x11a0b1e30, v1=0x1174e9070, v2=0x1174e9130, v3=0x4365a4f98, v4=0x1174e8fb0) at /Developer/bf-blender/blender/source/blender/blenlib/intern/math_geom.c:70
    #1 0x0000000100466d2e in CDDM_calc_normals (dm=0x11cbbee30) at /Developer/bf-blender/blender/source/blender/blenkernel/intern/cdderivedmesh.c:1747
    #2 0x00000001005073dc in arrayModifier_applyModifier (md=0x11c1ca6a0, ob=0x11cba8430, derivedData=0x11cbcec30, useRenderParams=0, isFinalCalc=1) at /Developer/bf-blender/blender/source/blender/blenkernel/intern/modifier.c:1714
    #3 0x0000000100507416 in arrayModifier_applyModifierEM (md=0x11c1ca6a0, ob=0x11cba8430, editData=0x11c1b5970, derivedData=0x11cbcec30) at /Developer/bf-blender/blender/source/blender/blenkernel/intern/modifier.c:1723
    #4 0x00000001004a3a54 in editmesh_calc_modifiers (scene=0x11ccba230, ob=0x11cba8430, em=0x11c1b5970, cage_r=0x11c1b5a10, final_r=0x11c1b5a18, dataMask=153) at /Developer/bf-blender/blender/source/blender/blenkernel/intern/DerivedMesh.c:2033
    #5 0x00000001004a4048 in editmesh_build_data (scene=0x11ccba230, obedit=0x11cba8430, em=0x11c1b5970, dataMask=25) at /Developer/bf-blender/blender/source/blender/blenkernel/intern/DerivedMesh.c:2160
    #6 0x00000001004a40c7 in makeDerivedMesh (scene=0x11ccba230, ob=0x11cba8430, em=0x11c1b5970, dataMask=25) at /Developer/bf-blender/blender/source/blender/blenkernel/intern/DerivedMesh.c:2171
    #7 0x0000000100536d3c in object_handle_update (scene=0x11ccba230, ob=0x11cba8430) at /Developer/bf-blender/blender/source/blender/blenkernel/intern/object.c:2530
    #8 0x000000010056984c in scene_update_tagged (scene=0x11ccba230) at /Developer/bf-blender/blender/source/blender/blenkernel/intern/scene.c:947
    #9 0x000000010000db43 in wm_event_do_notifiers (C=0x10380bec0) at /Developer/bf-blender/blender/source/blender/windowmanager/intern/wm_event_system.c:292
    #10 0x000000010000a45d in WM_main (C=0x10380bec0) at /Developer/bf-blender/blender/source/blender/windowmanager/intern/wm.c:335
    #11 0x0000000100009c37 in main (argc=1, argv=0x7fff5fbff408) at /Developer/bf-blender/blender/source/creator/creator.c:1073
  • Date: 2010-06-03 17:29
  • Sender: Diego Borghetti
  • Hi,

    We have something really weird here, every time a test I get a segfault in different place and some even when we call malloc, here is my last backtrace:

    #5 0x0000000000fb9d86 in rem_memblock (vmemh=0x393f5b8) at mallocn.c:714
    #6 MEM_freeN (vmemh=0x393f5b8) at mallocn.c:631
    #7 0x0000000000b75c25 in CustomData_free (data=0x38fc678, totelem=1243)
    at customdata.c:933
    #8 0x0000000000b80f3a in DM_release (dm=0x38fc628) at DerivedMesh.c:202
    #9 0x0000000000b599f9 in cdDM_release (dm=0x25e6) at cdderivedmesh.c:1382
    #10 0x0000000000b83d36 in editmesh_calc_modifiers (
    scene=<value optimized out>, obedit=<value optimized out>,
    em=<value optimized out>, dataMask=<value optimized out>)
    at DerivedMesh.c:2084
    #11 editmesh_build_data (scene=<value optimized out>,
    obedit=<value optimized out>, em=<value optimized out>,
    dataMask=<value optimized out>) at DerivedMesh.c:2216
    #12 0x0000000000bcb4bd in object_handle_update (scene=0x395c478, ob=0x395e2d8)
    at object.c:2510
    #13 0x0000000000bf3198 in scene_update_tagged (scene=0x395c478) at scene.c:944
    #14 0x0000000000702699 in wm_event_do_notifiers (C=0x1bc2b58)
    at wm_event_system.c:292
    #15 0x00000000006fca40 in WM_main (C=0x1bc2b58) at wm.c:339
    #16 0x00000000006fb481 in main (argc=1, argv=0x7fffffffe288) at creator.c:1143
    (gdb) quit

    Brecht, can you take a look at this ?

    Let me know if we need move this to another dev (maybe artificier or genscher, both also
    work on this).

    (Also I can't reproduce this from an empty file, new model with the same number of modifiers and options.)

    - Diego
  • Date: 2010-09-23 23:30
  • Sender: Nathan Letwory
  • Note: either load with UI, or set 3d cursor to the top of the object before continuing (select the inward vert of the top triangle, for when it would be the entire arrayed mesh).

    After some investigation it seems that the first array modifier here is the problem when First Last is enabled for Merge.

    Before adding the plane as per reproduce instructions, disable First Last for the first array modifier.

    Add the plane and then enabled First Last. At that moment you'll see a crash. It is exactly in this (x,y) location of the plane that will trigger the crash.

    Looking in CDDM_calc_normals, apparently there is one face with a vert idx that is larger than the numVerts expected. This will result in the add_v3_v3(temp_nors[mf->v4], f_no) when mf->v4 to write past the MEM_calloc()'ed buffer into MemTail, thus corrupting the tag for it and producing the error message.

    I hope this info will help in further narrowing down the problem.
  • Date: 2010-09-23 23:57
  • Sender: Nathan Letwory
  • A greatly simplified setup attached 19534_simplest_mesh_2.blend.

    Essentially it's already setup like the original instructions, but with very much simplified mesh (triangle + quad) with some modifiers.

    Open up, read the Info text block and enabled First Last. You'll see in console output (terminal, not built-in) message about memory corruption.
  • Date: 2010-11-11 16:34
  • Sender: Ton Roosendaal
  • Come on guys, it wasn't that hard? :)

    The mesh faces had vertex indices beyond the last vertex, which caused bad memory writes.
    Array code is doing quite some index magic, I can't find where the real bad part is, but it has to do with merging (obviously). It would be best if Ben Batt would check it carefully.

    I've patched it by adding a check for bad indices and decrement it, which survives magically well. My preference is to have Ben carefully going over his array code to find the real issue though.
 

Attached Files:

Name Date Download
most tutorial.blend 2009-10-02 22:03 Download
19534_simplest_mesh_2.blend 2010-09-23 23:57 Download

Changes:

Field Old Value Date By
ResolutionApproved2010-11-11 16:34ton
close_date2010-11-11 16:342010-11-11 16:34ton
summaryCrash adding/scaling plane in existing double array2010-11-11 16:34ton
assigned_toblendix2010-11-11 16:34ton
status_idOpen2010-11-11 16:34ton
File Added12838: 19534_simplest_mesh_2.blend2010-09-23 23:57jesterking
assigned_tonone2010-06-03 17:29bdiego
priority32010-06-03 17:29bdiego
summaryadding/scaling plane in existing double array2010-03-22 12:07broken
File Added8772: most tutorial.blend2009-10-02 22:03eagleshadow