Page MenuHome

Crash due to (preview) jobs running during undo step.
Closed, ResolvedPublic

Description

System Information
Windows 10, Intel UHD Graphics 620

Blender Version
Broken: blender-2.80-7eaf00bfb09-win64
Worked: (optional)

Grease Pencil Crash with undo

Exact steps for others to reproduce the error
In draw mode, insert a stroke. Draw some lines and shapes in various colours and then try to undo more than 12 times. Results in a crash every time

Event Timeline

Confirmed on Windows 10 debug build MSVS2017

Bastien Montagne (mont29) triaged this task as Normal priority.

Cannot reproduce under linux with latest branch…

Cannot reproduce in Windows 10.

@Charlie Jolly (charlie) Do you have a log and/or backtrace?

I succeeded to obtain a crash on linux.

This may help.

Exception thrown: read access violation.
scene->world was 0xFFFFFFFFFFFFFF37.

blender.exe!preview_prepare_scene(Main * bmain=0x0000020ef630b2f8, Scene * scene=0x0000020e8e712598, ID * id=0x0000000000000000, int id_type=-8739, ShaderPreview * sp=0x0000020e8ead4048) Line 378	C
blender.exe!shader_preview_render(ShaderPreview * sp=0x0000020e8ead4048, ID * id=0x0000020ef6122538, int split=0, int first=0) Line 828	C
blender.exe!shader_preview_startjob(void * customdata=0x0000020e8ead4048, short * stop=0x0000020e8473566c, short * do_update=0x0000020e8473566a) Line 845	C
blender.exe!icon_preview_startjob(void * customdata=0x0000020e8ead4048, short * stop=0x0000020e8473566c, short * do_update=0x0000020e8473566a) Line 1046	C
blender.exe!common_preview_startjob(void * customdata=0x0000020e8ead4048, short * stop=0x0000020e8473566c, short * do_update=0x0000020e8473566a, float * UNUSED_progress=0x0000020e84735670) Line 1061	C
blender.exe!icon_preview_startjob_all_sizes(void * customdata=0x0000020e8e59be68, short * stop=0x0000020e8473566c, short * do_update=0x0000020e8473566a, float * progress=0x0000020e84735670) Line 1148	C
blender.exe!do_job_thread(void * job_v=0x0000020e847355f8) Line 338	C
blender.exe!tslot_thread_start(void * tslot_p=0x0000020ea5446048) Line 254	C
pthreadVC2.dll!00007ffeda8c627b()	Unknown
pthreadVC2.dll!00007ffeda8c8eb7()	Unknown
pthreadVC2.dll!00007ffeda8c9102()	Unknown
kernel32.dll!00007ffef9481fe4()	Unknown
ntdll.dll!00007ffefbffcb31()	Unknown

I see now, this is the same bug of T56084 and T56185.

The problem is the preview job is rendering while the undo is done. I'm not sure how fix this.

Bastien Montagne (mont29) raised the priority of this task from Normal to Confirmed, Medium.

There is a condition in ed_undo_step, which aborts the operator if any job is running (WM_jobs_test(wm, scene, WM_JOB_TYPE_ANY)). Problem is, it only checks for jobs which owner is current scene, this ignores several jobs I think (including preview render ones).

Also, I find it odd that we abort the operation here, why not rather kill all current jobs with WM_jobs_kill_all()? I’d expect user would rather want to do their undo, aborting background jobs if necessary?

Summoning @Campbell Barton (campbellbarton) here…

Bastien Montagne (mont29) renamed this task from Grease pencil crash to Grease pencil crash due to jobs running during undo step..
Bastien Montagne (mont29) renamed this task from Grease pencil crash due to jobs running during undo step. to Crash due to (preview) jobs running during undo step..