Blender eats all memory when painting texture
Open, ConfirmedPublic

Description

System Information
Ubuntu 16.04 x86_64, Nvidia GeForce GTX TITAN X (GM200)

Blender Version
Broken: 2.79RC1, the same in 2.78

When I try to paint texture on object in attached file, blender stucks and starts eating memory very fast.

Exact steps for others to reproduce the error
Try to paint texture at the center of the object in attached file. At the part with tiles texture (Ter Dlazba 2)

Details

Type
Bug

confirm here: builds a8fbe99 6af7d7e

win 7x64 nvidia 1070.

One click to stroke and the memory goes 2 to 12 gb in a few seconds, and crash on 16 gb if i dont kill fast enough the aplication

And it seem that is because all the uv points are in the same place at (0 , 0)

after proper unwrapping seem to work fine.

The problem here is that UV maps have been scaled up extremely, which becomes visible if you zoom out inside the UV/Image Editor.

Painting on an unwrapped cube with uv maps scaled to 0 works fine, but scaling the UVs of the cube way up causes the same problem:

If I'm not mistaken, this happens: Because blender takes repetition (for tiled textures) into account by default, it iterates over a massive amount of pixels for each triangle that is being painted. The effect is the same as if you were painting on a very high-res texture.

Maybe not having blender freeze as a result of this (checking number of pixels it's about to iterate over) would be a solution, but I'm not certain this could be considered a bug in that case.

@Campbell Barton (campbellbarton) @Antony Riakiotakis (psy-fi)

Sergey Sharybin (sergey) triaged this task as "Confirmed" priority.Sep 11 2017, 12:32 PM