Maniphest T56491

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

Assigned To
Campbell Barton (campbellbarton)
Authored By
Garry Watson (Nessie)
Aug 22 2018, 7:48 AM
Tags
  • BF Blender: 2.8
  • Platform: Windows
  • Grease Pencil
Subscribers
Andrey Gladyshev (Endeg)
Andrii (andergrin)
Antonio Vazquez (antoniov)
Bastien Montagne (mont29)
Campbell Barton (campbellbarton)
Carlo Andreacchio (candreacchio)
Charlie Jolly (charlie)
2 More Subscribers

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

Revisions and Commits

rB Blender

Event Timeline

Garry Watson (Nessie) created this task.Aug 22 2018, 7:48 AM
Charlie Jolly (charlie) added a subscriber: Charlie Jolly (charlie).Aug 22 2018, 3:49 PM

Confirmed on Windows 10 debug build MSVS2017

Bastien Montagne (mont29) lowered the priority of this task from 90 to Normal.Aug 23 2018, 11:38 AM
Bastien Montagne (mont29) edited projects, added BF Blender: 2.8, Platform: Windows, Grease Pencil; removed BF Blender.
Bastien Montagne (mont29) added a subscriber: Bastien Montagne (mont29).

Cannot reproduce under linux with latest branch…

Antonio Vazquez (antoniov) added a subscriber: Antonio Vazquez (antoniov).Aug 23 2018, 4:10 PM

Cannot reproduce in Windows 10.

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

ronan ducluzeau (zeauro) added a subscriber: ronan ducluzeau (zeauro).Aug 23 2018, 4:32 PM

I succeeded to obtain a crash on linux.

Charlie Jolly (charlie) added a comment.Aug 23 2018, 4:46 PM

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
Antonio Vazquez (antoniov) added a comment.Aug 23 2018, 5:54 PM

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) assigned this task to Campbell Barton (campbellbarton).Aug 23 2018, 10:04 PM
Bastien Montagne (mont29) triaged this task as 50 priority.
Bastien Montagne (mont29) added a subscriber: Campbell Barton (campbellbarton).

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..Aug 23 2018, 10:05 PM
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..
Bastien Montagne (mont29) added subscribers: Carlo Andreacchio (candreacchio), Andrii (andergrin), Andrey Gladyshev (Endeg), s12a (s12a).
Campbell Barton (campbellbarton) changed the task status from Unknown Status to Resolved by committing rB9abc2dfa4933: Fix T56491: Undo crash while preview jobs run.Aug 24 2018, 4:33 AM
Campbell Barton (campbellbarton) added a commit: rB9abc2dfa4933: Fix T56491: Undo crash while preview jobs run.