New issue
Advanced search Search tips
Note: Color blocks (like or ) mean that a user may not be available. Tooltip shows the reason.

Issue 670875 link

Starred by 4 users

Issue metadata

Status: Fixed
Owner:
Closed: May 2017
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: All
Pri: 2
Type: Bug-Regression



Sign in to add a comment

SVG + high pixel density + AMD + hardware acceleration = crash

Reported by benoit.j...@gmail.com, Dec 2 2016

Issue description

UserAgent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_11_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/55.0.2883.75 Safari/537.36

Steps to reproduce the problem:
1. Hardware acceleration enabled (works fine without it)
2. AMD graphic card (can't reproduce with Intel, didn't test with Nvidia)
3. High pixel density screen (crash on my macbook pro 2880x1800 15.4", works on desktop display 2560*1440, 27")
4. Draw long, self-crossing SVG line: goto http://codepen.io/FrenchBen/pen/BQYNvQ?editors=1001

What is the expected behavior?
Line draws "normally" on any screen

What went wrong?
-If you load the page on a low pixel density screen first (everything fine), then dragging the window on the high pixel density screen will mess up the rendering of the line (see screenshots). Any further interaction with the chart will "trigger" a memory leak (chrome goes up to 50gB of memory use in ~20s) ending up in the tab crashing

-If you load the page on a high pixel density screen then the memory leak is triggered and the page will eat all the memory before crashing

Did this work before? Yes 54.0.2840.98 (64-bit)

Chrome version: 55.0.2883.75  Channel: stable
OS Version: OS X 10.11.6
Flash Version: Shockwave Flash 23.0 r0

Used to work on 54.0.2840.98 (64-bit)
Fails on  55.0.2883.75 (64-bit)
Also fails on 57.0.2939.0 canary (64-bit)

works on FF 50.0.1
works on Safari 10.0.1
 
line_OK.png
301 KB View Download
Line_not_OK.png
379 KB View Download
memory.png
32.4 KB View Download

Comment 2 by ajha@chromium.org, Dec 3 2016

Components: Internals>GPU
Labels: -Pri-2 M-55 Needs-Bisect Pri-1
Labels: TE-NeedsTriageFromMTV
At our end, we have mac test machines with Intel graphic cards.
Adding TE-NeedsTriageFromMTV for futher triage
Cc: senorblanco@chromium.org vmi...@chromium.org bsalomon@chromium.org ericrk@chromium.org
benoit.j.chavailer@, are you able to provide the output of "about:gpu" (type into the address bar) from both the Chrome 55 build where this reproduces and the Chrome 54 build where this does not? This makes diagnosing the issue (and matching your hardware config) easier. Thanks!

senorblanco@, given that this is AMD, I'm guessing we're hitting the MSAA path rendering path. Has anything changed substantially in this path from 54 > 55?
Re: #4: There may have been a refactor or two, but there were no substantial changes, IIRC.
This reproduces on all configurations tested with MSAA forced (Intel / NVidia / AMD). You can reproduce by opening about://flags and setting gpu rasterization to "force enabled for all layers" and GPU Rasterization MSAA Sample Count to "4".

Will bisect.
Please find enclosed the results of about:gpu in 55 and 54 on the same macbook machine
chrome 54.txt
7.2 KB View Download
chrome55.txt
5.0 KB View Download
Labels: -OS-Mac OS-All
Owner: senorblanco@chromium.org
Status: Assigned (was: Unconfirmed)
This appears to be a long-standing issue (I've been able to repro back to Chrome 52) - not sure why the reporter is seeing a difference in M54>M55, although I've found that the crash can be a bit flaky on my systems, so it may just be a case of getting lucky.

I can also repro on Windows as well, assuming I force GPU rasterization. It appears that something goes wrong in the GrTessellator causing it to perform runaway allocations. The callstack I get at the point when we crash from OOM is:

 	base.dll!base::win::`anonymous namespace'::ForceCrashOnSigAbort(int __formal) Line 67	C++
 	ucrtbase.dll!raise()	Unknown
 	ucrtbase.dll!abort()	Unknown
 	skia.dll!sk_abort_no_print() Line 32	C++
 	skia.dll!`anonymous namespace'::simplify(`anonymous-namespace'::Vertex * vertices, `anonymous-namespace'::Comparator & c, SkChunkAlloc & alloc) Line 1304	C++
 	skia.dll!`anonymous namespace'::contours_to_polys(`anonymous-namespace'::Vertex * * contours, int contourCnt, SkPath::FillType fillType, const SkRect & pathBounds, bool antialias, SkChunkAlloc & alloc) Line 1670	C++
 	skia.dll!`anonymous namespace'::path_to_polys(const SkPath & path, float tolerance, const SkRect & clipBounds, int contourCnt, SkChunkAlloc & alloc, bool antialias, bool * isLinear) Line 1705	C++
>	skia.dll!GrTessellator::PathToTriangles(const SkPath & path, float tolerance, const SkRect & clipBounds, GrTessellator::VertexAllocator * vertexAllocator, bool antialias, const unsigned int & color, bool canTweakAlphaForCoverage, bool * isLinear) Line 1757	C++
 	skia.dll!TessellatingPathBatch::draw(GrVertexBatch::Target * target, const GrGeometryProcessor * gp) Line 239	C++
 	skia.dll!TessellatingPathBatch::onPrepareDraws(GrVertexBatch::Target * target) Line 306	C++
 	skia.dll!GrVertexBatch::onPrepare(GrBatchFlushState * state) Line 20	C++
 	skia.dll!GrRenderTargetOpList::prepareBatches(GrBatchFlushState * flushState) Line 170	C++
 	skia.dll!GrDrawingManager::internalFlush(GrResourceCache::FlushType type) Line 83	C++
 	skia.dll!GrDrawingManager::prepareSurfaceForExternalIO(GrSurface * surface) Line 142	C++
 	skia.dll!GrRenderTargetContext::prepareForExternalIO() Line 1226	C++
 	skia.dll!SkGpuDevice::flush() Line 1789	C++
 	cc.dll!cc::ResourceProvider::ScopedSkSurfaceProvider::~ScopedSkSurfaceProvider() Line 1198	C++
 	cc.dll!cc::`anonymous namespace'::RasterizePicture(SkPicture * picture, cc::ContextProvider * context_provider, cc::ResourceProvider::ScopedWriteLockGL * resource_lock, bool async_worker_context_enabled, bool use_distance_field_text, bool can_use_lcd_text, int msaa_sample_count, cc::ImageDecodeController * image_decode_controller, bool use_image_hijack_canvas) Line 124	C++
 	cc.dll!cc::GpuRasterBufferProvider::PlaybackOnWorkerThread(cc::ResourceProvider::ScopedWriteLockGL * resource_lock, const gpu::SyncToken & sync_token, bool resource_has_previous_content, const cc::RasterSource * raster_source, const gfx::Rect & raster_full_rect, const gfx::Rect & raster_dirty_rect, unsigned __int64 new_content_id, const gfx::SizeF & scales, const cc::RasterSource::PlaybackSettings & playback_settings) Line 277	C++
 	cc.dll!cc::GpuRasterBufferProvider::RasterBufferImpl::Playback(const cc::RasterSource * raster_source, const gfx::Rect & raster_full_rect, const gfx::Rect & raster_dirty_rect, unsigned __int64 new_content_id, const gfx::SizeF & scales, const cc::RasterSource::PlaybackSettings & playback_settings) Line 156	C++
 	cc.dll!cc::`anonymous namespace'::RasterTaskImpl::RunOnWorkerThread() Line 132	C++
 	content.dll!content::CategorizedWorkerPool::RunTaskInCategoryWithLockAcquired(cc::TaskCategory category) Line 360	C++
 	content.dll!content::CategorizedWorkerPool::RunTaskWithLockAcquired(const std::vector<enum cc::TaskCategory,std::allocator<enum cc::TaskCategory> > & categories) Line 339	C++
 	content.dll!content::CategorizedWorkerPool::Run(const std::vector<enum cc::TaskCategory,std::allocator<enum cc::TaskCategory> > & categories, base::ConditionVariable * has_ready_to_run_tasks_cv) Line 230	C++
 	base.dll!base::SimpleThread::ThreadMain() Line 69	C++
 	base.dll!base::`anonymous namespace'::ThreadFunc(void * params) Line 86	C++
 	kernel32.dll!BaseThreadInitThunk()	Unknown
 	ntdll.dll!RtlUserThreadStart()	Unknown

Let me know if I can provide more details.

Interesting, just want to point out that we could consistently (100%) reproduce on 55 on 3 different machines, and never had it crashed on 54 on 2 different machines
Components: -Internals>GPU Internals>GPU>Rasterization
Turning on logging in the tessellator, tt seems to be splitting the same edge over and over again (on its top vertex).

splitting edge (1765 -> 1765.38) at vertex 1765.38 (318.828, 187.53)
removing edge (1765 -> 1765.38) above vertex 1765.38
insert edge (1765 -> 1765.38) above vertex 1765.38
intersecting 1765.38 -> 1766 with 1765 -> 1765.38
found intersection, pt is 318.828, 187.53
splitting edge (1765 -> 1765.38) at vertex 1765.38 (318.828, 187.53)
removing edge (1765 -> 1765.38) above vertex 1765.38
insert edge (1765 -> 1765.38) above vertex 1765.38
intersecting 1765.38 -> 1766 with 1765 -> 1765.38
found intersection, pt is 318.828, 187.53
...
Here is a quick fix which works around the problem. It gets rid of the OOM, but does leave some rendering artifacts. I'm going to see if I can find a fix for the deeper problem, although it could be difficult if it's what I think it is.
enclosing-edge-fix.patch
90.1 KB Download

Comment 13 by hcm@chromium.org, Apr 26 2017

Labels: -Pri-1 Pri-2
Lowering priority since a fix was committed, though we may do more work here.
Status: Fixed (was: Assigned)
A fix was landed, but I can't get the original codepen case to draw anymore (on any browser).

If it still repros, feel free to reopen (or better yet, open a new bug if the repro is different).

Sign in to add a comment