Crash when switching views
Closed, ResolvedPublic

Description

Relates to: T31465

Sometimes when switching editors, blender crashes. I haven't been able to reproduce this consistently, but happens quite often on my machine always when switching between Python console/Text Editor/3D view

Seems similar to http://projects.blender.org/tracker/?group_id=9&atid=498&func=detail&aid=31465

I have employed the same fix as in r46657 (patch attached), but I still do get crashes from different parts of code.

This is happening on SVN revision r50484

Crash 1:
Program received signal SIGSEGV, Segmentation fault.
0x00000000016020f8 in ED_render_scene_update (bmain=0x7fffe4385748, scene=0x7fffe43f75a8, updated=0) at source/blender/editors/render/render_update.c:102
102 engine = rv3d->render_engine;
(gdb) bt
#0 0x00000000016020f8 in ED_render_scene_update (bmain=0x7fffe4385748, scene=0x7fffe43f75a8, updated=0) at source/blender/editors/render/render_update.c:102
#1 0x0000000001c2a1f9 in dag_editors_scene_update (bmain=0x7fffe4385748, scene=0x7fffe43f75a8, updated=0) at source/blender/blenkernel/intern/depsgraph.c:1768
#2 0x0000000001c2ca86 in DAG_ids_check_recalc (bmain=0x7fffe4385748, scene=0x7fffe43f75a8, time=0) at source/blender/blenkernel/intern/depsgraph.c:2784
#3 0x0000000001c66f4c in BKE_scene_update_tagged (bmain=0x7fffe4385748, scene=0x7fffe43f75a8) at source/blender/blenkernel/intern/scene.c:1043
#4 0x0000000001405524 in wm_event_do_notifiers (C=0x37e49d8) at source/blender/windowmanager/intern/wm_event_system.c:314
#5 0x00000000013f7521 in WM_main (C=0x37e49d8) at source/blender/windowmanager/intern/wm.c:369
#6 0x00000000013efda5 in main ()

Crash 2:
Program received signal SIGSEGV, Segmentation fault.
0x00000000014b2e9e in view3d_main_area_draw (C=0x37e49d8, ar=0x7fffe4ef5928) at source/blender/editors/space_view3d/view3d_draw.c:3164
3164 int draw_border = (rv3d->persp == RV3D_CAMOB && (scene->r.mode & R_BORDER));
(gdb) bt
(gdb) bt
#0 0x00000000014b2e9e in view3d_main_area_draw (C=0x37e49d8, ar=0x7fffe4ef5928) at source/blender/editors/space_view3d/view3d_draw.c:3164
#1 0x00000000018b8b9d in ED_region_do_draw (C=0x37e49d8, ar=0x7fffe4ef5928) at source/blender/editors/screen/area.c:485
#2 0x00000000013f871a in wm_method_draw_overlap_all (C=0x37e49d8, win=0x7fffe556e278, exchange=0) at source/blender/windowmanager/intern/wm_draw.c:271
#3 0x00000000013f9baa in wm_draw_update (C=0x37e49d8) at source/blender/windowmanager/intern/wm_draw.c:776
#4 0x00000000013f752d in WM_main (C=0x37e49d8) at source/blender/windowmanager/intern/wm.c:372
#5 0x00000000013efda5 in main ()
(gdb) print *C->wm.area
$14 = {next = 0x0, prev = 0x0, v1 = 0x7fffe4f06478, v2 = 0x7fffe4f064e8, v3 = 0x7fffe4f96e18, v4 = 0x7fffe4f96e88, full = 0x0, totrct = {xmin = 0,
xmax = 1280, ymin = 0, ymax = 1004}, spacetype = 1 '\001', butspacetype = 1 '\001', winx = 1281, winy = 1005, headertype = 1, pad = 0, do_refresh = 0,
cursor = 0, flag = 9, type = 0x3b14328, spacedata = {first = 0x7fffe4ef5aa8, last = 0x7fffe4e22bc8}, regionbase = {first = 0x7fffe4ef57a8,
last = 0x7fffe4ef5928}, handlers = {first = 0x0, last = 0x0}, actionzones = {first = 0x7fffe4e23888, last = 0x7fffe4f06728}}
(gdb) print *C->wm.region
$15 = {next = 0x0, prev = 0x7fffe4ef57a8, v2d = {tot = {xmin = 0, xmax = 1087, ymin = 0, ymax = 840}, cur = {xmin = 201.915833, xmax = 885.084167,
ymin = 178.921631, ymax = 701.030762}, vert = {xmin = 0, xmax = 0, ymin = 0, ymax = 0}, hor = {xmin = 0, xmax = 0, ymin = 0, ymax = 0}, mask = {
xmin = 0, xmax = 1280, ymin = 0, ymax = 978}, min = {0, 0}, max = {0, 0}, minzoom = 0.00999999978, maxzoom = 1000, scroll = 0, scroll_ui = 0,
keeptot = 1, keepzoom = 3, keepofs = 0, flag = 1024, align = 10, winx = 1281, winy = 979, oldwinx = 1281, oldwiny = 979, around = 0, tab_offset = 0x0,
tab_num = 0, tab_cur = 0, sms = 0x0, smooth_timer = 0x0}, winrct = {xmin = 0, xmax = 1280, ymin = 26, ymax = 1004}, drawrct = {xmin = 0, xmax = 1280,
ymin = 26, ymax = 1004}, winx = 1281, winy = 979, swinid = 3, regiontype = 0, alignment = 0, flag = 0, fsize = 0, sizex = 0, sizey = 0, do_draw = 1,
do_draw_overlay = 0, swap = 0, pad = {0, 0, 0}, type = 0x3b14448, uiblocks = {first = 0x0, last = 0x0}, panels = {first = 0x0, last = 0x0}, handlers = {
first = 0x7fffe50b0f88, last = 0x7fffe498de78}, headerstr = 0x0, regiondata = 0x0}

The root cause seems to be that regiondata is NULL when spacetype = SPACE_VIEW3D, possibly a race condition during view switch - redraw can happen prior to regiondata being set or something like that.

Now I know how to reproduce it.

1. Go to Text Editor
2. Click on Editor Selection
3. Move mouse from the Editor selection to Text Editor
4. Crash

was own mistake in a different part of the code, fixed in svn.

Campbell Barton (campbellbarton) closed this task as "Resolved".Via Old WorldSep 10 2012, 3:35 AM

Add Comment