New issue
Advanced search Search tips

Issue 668409 link

Starred by 1 user

Issue metadata

Status: WontFix
Owner:
Closed: Nov 2016
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: Chrome
Pri: 2
Type: Bug



Sign in to add a comment

GetHandleLimit() is always called in prep for "software" memory policy is always created even when using a gpu context will be used

Project Member Reported by djkurtz@chromium.org, Nov 24 2016

Issue description

Forked from  issue 662450 .

Previously, there was no explicit "software" memory policy.
Rather, the "no-gpu-context" memory policy would only be set if there was no "context provider" during CompositorOutputSurface::BindToClient().

[content/renderer/gpu/compositor_output_surface.cc]:

-   if (!context_provider()) {
-     // Without a GPU context, the memory policy otherwise wouldn't be set.
-    client->SetMemoryPolicy(cc::ManagedMemoryPolicy(
-        128 * 1024 * 1024,
-        gpu::MemoryAllocation::CUTOFF_ALLOW_NICE_TO_HAVE,
-        base::SharedMemory::GetHandleLimit() / 3));
-   }

This was changed by this patch:

aa5c49175702f57438c939a7e4796ff19de4b681 is the first bad commit
commit aa5c49175702f57438c939a7e4796ff19de4b681
Author: danakj <danakj@chromium.org>
Date:   Fri Sep 9 17:28:23 2016 -0700

    cc: Remove SetMemoryPolicy from OutputSurface and Display.
    Review-Url: https://codereview.chromium.org/2321883002


Now we always create explicit "software" memory policy during RenderWidgetCompositor::GenerateLayerTreeSettings(), which does:

[content/renderer/gpu/render_widget_compositor.cc]:

+  settings.software_memory_policy.num_resources_limit =
+      base::SharedMemory::GetHandleLimit() / 3;

This new unconditional call to "GetHandleLimit()" (ie, even when using a gpu context), was generating error messages, since glibc's implementation of getrlimit() actually used the syscall prlimit() which was not whitelisted by the sandbox:

getrlimit(RLIMIT_NOFILE) failed
getrlimit(RLIMIT_NOFILE) failed
getrlimit(RLIMIT_NOFILE) failed
getrlimit(RLIMIT_NOFILE) failed


This error message has been suppressed by updating the sandbox.

However, arguably this extra call to GetHandleLimit() could be removed when taking the GPU context path.
 

Comment 1 by piman@chromium.org, Nov 28 2016

Status: WontFix (was: Assigned)
I suggest wontfix. I guess the sandbox policy is different on Chrome OS, which also never falls back to software, but it doesn't seem useful to hardcode that behavior into this very piece of logic (e.g. what if in the future we want to run Chrome OS on devices that don't have a GPU, what if we want to allocate software resources anyway for any reason, etc.). Really getrlimit ought to be fine, so fixing the sandbox is the right call.
There seem to be a lot of these unnecessary getrlimit() calls, though.

As an example, here is just a small snippet of UI log from https://feedback.corp.google.com/product/208/neutron?lView=rd&lReport=18468551385:

getrlimit(RLIMIT_NOFILE) failed
getrlimit(RLIMIT_NOFILE) failed
getrlimit(RLIMIT_NOFILE) failed
getrlimit(RLIMIT_NOFILE) failed
getrlimit(RLIMIT_NOFILE) failed
getrlimit(RLIMIT_NOFILE) failed
getrlimit(RLIMIT_NOFILE) failed
getrlimit(RLIMIT_NOFILE) failed
getrlimit(RLIMIT_NOFILE) failed
getrlimit(RLIMIT_NOFILE) failed
getrlimit(RLIMIT_NOFILE) failed
getrlimit(RLIMIT_NOFILE) failed
getrlimit(RLIMIT_NOFILE) failed
getrlimit(RLIMIT_NOFILE) failed
[1237:1237:1205/072856:ERROR:message_service.cc(469)] Failed to create native process.
getrlimit(RLIMIT_NOFILE) failed
getrlimit(RLIMIT_NOFILE) failed
getrlimit(RLIMIT_NOFILE) failed
getrlimit(RLIMIT_NOFILE) failed
[1237:1237:1205/073041:ERROR:network_metrics_provider.cc(244)] NOTREACHED() hit.
getrlimit(RLIMIT_NOFILE) failed
getrlimit(RLIMIT_NOFILE) failed
getrlimit(RLIMIT_NOFILE) failed
getrlimit(RLIMIT_NOFILE) failed
getrlimit(RLIMIT_NOFILE) failed
getrlimit(RLIMIT_NOFILE) failed
getrlimit(RLIMIT_NOFILE) failed
getrlimit(RLIMIT_NOFILE) failed
getrlimit(RLIMIT_NOFILE) failed
getrlimit(RLIMIT_NOFILE) failed
getrlimit(RLIMIT_NOFILE) failed
getrlimit(RLIMIT_NOFILE) failed
getrlimit(RLIMIT_NOFILE) failed
getrlimit(RLIMIT_NOFILE) failed
getrlimit(RLIMIT_NOFILE) failed
getrlimit(RLIMIT_NOFILE) failed
getrlimit(RLIMIT_NOFILE) failed
getrlimit(RLIMIT_NOFILE) failed
getrlimit(RLIMIT_NOFILE) failed
getrlimit(RLIMIT_NOFILE) failed
getrlimit(RLIMIT_NOFILE) failed
getrlimit(RLIMIT_NOFILE) failed
getrlimit(RLIMIT_NOFILE) failed
[1237:1237:1205/073856:ERROR:message_service.cc(469)] Failed to create native process.
getrlimit(RLIMIT_NOFILE) failed
getrlimit(RLIMIT_NOFILE) failed
getrlimit(RLIMIT_NOFILE) failed
getrlimit(RLIMIT_NOFILE) failed
getrlimit(RLIMIT_NOFILE) failed
getrlimit(RLIMIT_NOFILE) failed
getrlimit(RLIMIT_NOFILE) failed
getrlimit(RLIMIT_NOFILE) failed
getrlimit(RLIMIT_NOFILE) failed
getrlimit(RLIMIT_NOFILE) failed
[1:1:1205/074205:ERROR:KeyboardEventManager.cpp(344)] Not implemented reached in static bool blink<IPv6: 3>KeyboardEventManager<IPv6: 35>urrentCapsLockState()
getrlimit(RLIMIT_NOFILE) failed
[1237:1237:1205/074818:ERROR:device_event_log_impl.cc(140)] [07:48:18.561] Network: device_event_log.cc:117 @@@ Slow method: ../../../../../../../home/chrome-bot/chrome_root/src/chromeos/network/network_state_handler.cc:ManagedStateListChanged: 61ms
[1237:1237:1205/074818:ERROR:device_event_log_impl.cc(140)] [07:48:18.639] Network: network_state_handler.cc:599 DefaultNetworkPropertyUpdated: GBUS.Error = "out-of-range"
[1237:1237:1205/074818:ERROR:device_event_log_impl.cc(140)] [07:48:18.641] Network: network_state_handler.cc:900 Default network in unexpected state: GBUS (/service/11)State: failure
[1237:1237:1205/074818:ERROR:device_event_log_impl.cc(140)] [07:48:18.665] Network: network_state_handler.cc:599 NetworkPropertyUpdated: GBUS.Error = "Unknown"
[1237:1237:1205/074818:ERROR:arc_net_host_impl.cc(61)] NOTREACHED() hit.
[1237:1237:1205/074818:ERROR:arc_net_host_impl.cc(61)] NOTREACHED() hit.
getrlimit(RLIMIT_NOFILE) failed
getrlimit(RLIMIT_NOFILE) failed
[1237:1237:1205/074820:ERROR:device_event_log_impl.cc(140)] [07:48:20.249] Network: network_state_handler.cc:599 NetworkPropertyUpdated: GBUS.Error = "out-of-range"
[1237:1237:1205/074820:ERROR:device_event_log_impl.cc(140)] [07:48:20.266] Network: network_state_handler.cc:599 NetworkPropertyUpdated: GBUS.Error = "Unknown"
[1237:1449:1205/074821:ERROR:connection_factory_impl.cc(367)] Failed to connect to MCS endpoint with error -131
[1237:1237:1205/074826:ERROR:arc_net_host_impl.cc(61)] NOTREACHED() hit.
[1237:1237:1205/074826:ERROR:arc_net_host_impl.cc(61)] NOTREACHED() hit.
[1237:1237:1205/074826:ERROR:arc_net_host_impl.cc(61)] NOTREACHED() hit.
[1237:1237:1205/074826:ERROR:arc_net_host_impl.cc(61)] NOTREACHED() hit.
[1237:1237:1205/074826:ERROR:arc_net_host_impl.cc(61)] NOTREACHED() hit.
[1237:1237:1205/074826:ERROR:arc_net_host_impl.cc(61)] NOTREACHED() hit.
[1237:1237:1205/074826:ERROR:arc_net_host_impl.cc(61)] NOTREACHED() hit.
[1237:1237:1205/074826:ERROR:arc_net_host_impl.cc(61)] NOTREACHED() hit.
getrlimit(RLIMIT_NOFILE) failed
getrlimit(RLIMIT_NOFILE) failed
getrlimit(RLIMIT_NOFILE) failed
getrlimit(RLIMIT_NOFILE) failed
getrlimit(RLIMIT_NOFILE) failed
getrlimit(RLIMIT_NOFILE) failed
getrlimit(RLIMIT_NOFILE) failed
getrlimit(RLIMIT_NOFILE) failed
[1237:1237:1205/075018:ERROR:event_rewriter.cc(418)] Device ID 1 is unknown.
[1237:1237:1205/075018:ERROR:event_rewriter.cc(418)] Device ID 1 is unknown.
[1237:1237:1205/075018:ERROR:event_rewriter.cc(418)] Device ID 1 is unknown.
[1237:1237:1205/075018:ERROR:event_rewriter.cc(418)] Device ID 1 is unknown.
[1237:1237:1205/075018:ERROR:event_rewriter.cc(418)] Device ID 1 is unknown.
getrlimit(RLIMIT_NOFILE) failed
getrlimit(RLIMIT_NOFILE) failed
getrlimit(RLIMIT_NOFILE) failed
getrlimit(RLIMIT_NOFILE) failed

Comment 3 by piman@chromium.org, Dec 6 2016

It'd happen once per page. In what way is it a problem exactly? It's not like that is a slow syscall or anything, is it?
Components: -Internals>Graphics Internals>GPU
Moving old issues out of Internal>Graphics to delete this obsolete component ( crbug.com/685425  for details)

Sign in to add a comment