Bug 127877

Summary: Allow the OpenGL Profiler to get through the sandbox
Product: WebKit Reporter: Dean Jackson <dino>
Component: WebKit2Assignee: Dean Jackson <dino>
Status: RESOLVED FIXED    
Severity: Normal CC: ap, bfulgham, buildbot, rniwa, sam
Priority: P2    
Version: 528+ (Nightly build)   
Hardware: Unspecified   
OS: Unspecified   
Attachments:
Description Flags
Patch
none
Archive of layout-test-results from webkit-ews-13 for mac-mountainlion-wk2
none
Patch
none
Archive of layout-test-results from webkit-ews-14 for mac-mountainlion-wk2
none
Patch none

Description Dean Jackson 2014-01-29 17:31:59 PST
We need to open the sandbox slightly so that the OpenGL profiler can attach to WebProcess and the PluginProcess.

<rdar://problem/14817250>
Comment 1 Dean Jackson 2014-01-29 17:34:23 PST
Created attachment 222611 [details]
Patch
Comment 2 Sam Weinig 2014-01-29 18:04:45 PST
I thought we decided not to do this? What has changed?
Comment 3 Build Bot 2014-01-29 18:24:39 PST
Comment on attachment 222611 [details]
Patch

Attachment 222611 [details] did not pass mac-wk2-ews (mac-wk2):
Output: http://webkit-queues.appspot.com/results/6717990879887360

New failing tests:
compositing/checkerboard.html
compositing/absolute-inside-out-of-view-fixed.html
animations/3d/matrix-transform-type-animation.html
http/tests/cache/cancel-multiple-post-xhrs.html
animations/3d/state-at-end-event-transform.html
animations/added-while-suspended.html
animations/animation-add-events-in-handler.html
animations/additive-transform-animations.html
animations/3d/replace-filling-transform.html
accessibility/alt-tag-on-image-with-nonimage-role.html
compositing/bounds-in-flipped-writing-mode.html
accessibility/accessibility-node-reparent.html
animations/animation-border-overflow.html
accessibility/accessibility-object-detached.html
animations/animation-controller-drt-api.html
animations/3d/change-transform-in-end-event.html
http/tests/cache/content-type-ignored-during-revalidation.html
compositing/absolute-position-changed-in-composited-layer.html
http/tests/cache/cancel-during-revalidation-succeeded.html
canvas/philip/tests/2d.canvas.readonly.html
http/tests/cache/cancel-during-failure-crash.html
canvas/philip/tests/2d.canvas.reference.html
canvas/philip/tests/2d.clearRect+fillRect.alpha0.5.html
animations/3d/transform-origin-vs-functions.html
accessibility/accessibility-node-memory-management.html
http/tests/cache/cached-main-resource.html
accessibility/adjacent-continuations-cause-assertion-failure.html
canvas/philip/tests/2d.clearRect+fillRect.basic.html
compositing/absolute-position-changed-with-composited-parent-layer.html
canvas/philip/tests/2d.clearRect+fillRect.alpha0.html
Comment 4 Build Bot 2014-01-29 18:24:41 PST
Created attachment 222619 [details]
Archive of layout-test-results from webkit-ews-13 for mac-mountainlion-wk2

The attached test failures were seen while running run-webkit-tests on the mac-wk2-ews.
Bot: webkit-ews-13  Port: mac-mountainlion-wk2  Platform: Mac OS X 10.8.5
Comment 5 Dean Jackson 2014-01-29 21:09:08 PST
(In reply to comment #2)
> I thought we decided not to do this? What has changed?

We talked to the CoreOS and OpenGL teams at Apple today, and worked out it was ok.
Comment 6 Dean Jackson 2014-01-29 21:09:28 PST
(In reply to comment #5)
> (In reply to comment #2)
> > I thought we decided not to do this? What has changed?
> 
> We talked to the CoreOS and OpenGL teams at Apple today, and worked out it was ok.

See the radar for more details.
Comment 7 Dean Jackson 2014-01-29 21:10:05 PST
(In reply to comment #3)
> (From update of attachment 222611 [details])
> Attachment 222611 [details] did not pass mac-wk2-ews (mac-wk2):
> Output: http://webkit-queues.appspot.com/results/6717990879887360

This patch has no code changes - I think this is a mistake.
Comment 8 Sam Weinig 2014-01-29 21:38:20 PST
(In reply to comment #6)
> (In reply to comment #5)
> > (In reply to comment #2)
> > > I thought we decided not to do this? What has changed?
> > 
> > We talked to the CoreOS and OpenGL teams at Apple today, and worked out it was ok.
> 
> See the radar for more details.

Ok. Let's chat about this tomorrow.
Comment 9 Alexey Proskuryakov 2014-01-29 23:21:05 PST
Comment on attachment 222611 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=222611&action=review

EWS is right - the current patch breaks launching WebProcess on Mountain Lion. Here is what I see in the uploaded results archive:

WebProcess: Couldn't initialize sandbox profile [/Volumes/Data/EWS/WebKit/WebKitBuild/Release/WebKit2.framework/Resources/com.apple.WebProcess.sb], error 'line 88: unbound variable: mach-register '

We should make this conditional on low level OS support with (if (defined? 'mach-register) ...).

> Source/WebKit2/ChangeLog:5
> +        <rdar://problem/14817250>

This patch also fixes <rdar://problem/14271180>, please add it to ChangeLog.

> Source/WebKit2/WebProcess/com.apple.WebProcess.sb.in:88
> +    (global-name-regex #"_oglprof_attach_.*"))

This rule is not quite what was suggested to us. Let's chat offline about why it is so.
Comment 10 Dean Jackson 2014-01-30 10:14:08 PST
Created attachment 222682 [details]
Patch
Comment 11 Dean Jackson 2014-01-30 10:14:56 PST
Thanks Alexey.
Comment 12 Alexey Proskuryakov 2014-01-30 10:19:35 PST
Comment on attachment 222682 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=222682&action=review

r=me

Please upload a fixed patch though to let EWS chew on it and see what happens on Mountain Lion.

> Source/WebKit2/Resources/PlugInSandboxProfiles/com.apple.WebKit.plugin-common.sb:233
> +    (allow mach-register (global-name-regex #â^_oglprof_attach_<[0-9]+>$")))

Looks like you've got a smart quote here, which will break everything.

> Source/WebKit2/WebProcess/com.apple.WebProcess.sb.in:88
> +    (allow mach-register (global-name-regex #â^_oglprof_attach_<[0-9]+>$")))

Ditto.
Comment 13 Alexey Proskuryakov 2014-01-30 10:24:47 PST
Comment on attachment 222682 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=222682&action=review

>> Source/WebKit2/Resources/PlugInSandboxProfiles/com.apple.WebKit.plugin-common.sb:233
>> +    (allow mach-register (global-name-regex #â^_oglprof_attach_<[0-9]+>$")))
> 
> Looks like you've got a smart quote here, which will break everything.

Also, you changed the string to what was suggested to us, but I never said it was correct! I'm not sure if it is. Did you verify that everything works on Mavericks?
Comment 14 Alexey Proskuryakov 2014-01-30 10:27:04 PST
Comment on attachment 222682 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=222682&action=review

>>> Source/WebKit2/Resources/PlugInSandboxProfiles/com.apple.WebKit.plugin-common.sb:233
>>> +    (allow mach-register (global-name-regex #â^_oglprof_attach_<[0-9]+>$")))
>> 
>> Looks like you've got a smart quote here, which will break everything.
> 
> Also, you changed the string to what was suggested to us, but I never said it was correct! I'm not sure if it is. Did you verify that everything works on Mavericks?

Actually, I misread something. Looks like it is correct.
Comment 15 Build Bot 2014-01-30 10:58:11 PST
Comment on attachment 222682 [details]
Patch

Attachment 222682 [details] did not pass mac-wk2-ews (mac-wk2):
Output: http://webkit-queues.appspot.com/results/5152626429657088

New failing tests:
compositing/checkerboard.html
compositing/absolute-inside-out-of-view-fixed.html
animations/3d/matrix-transform-type-animation.html
http/tests/cache/cancel-multiple-post-xhrs.html
animations/3d/state-at-end-event-transform.html
animations/added-while-suspended.html
animations/animation-add-events-in-handler.html
animations/additive-transform-animations.html
animations/3d/replace-filling-transform.html
accessibility/alt-tag-on-image-with-nonimage-role.html
compositing/bounds-in-flipped-writing-mode.html
accessibility/accessibility-node-reparent.html
animations/animation-border-overflow.html
accessibility/accessibility-object-detached.html
animations/animation-controller-drt-api.html
animations/3d/change-transform-in-end-event.html
http/tests/cache/content-type-ignored-during-revalidation.html
compositing/absolute-position-changed-in-composited-layer.html
http/tests/cache/cancel-during-revalidation-succeeded.html
canvas/philip/tests/2d.canvas.readonly.html
http/tests/cache/cancel-during-failure-crash.html
canvas/philip/tests/2d.canvas.reference.html
canvas/philip/tests/2d.clearRect+fillRect.alpha0.5.html
animations/3d/transform-origin-vs-functions.html
accessibility/accessibility-node-memory-management.html
http/tests/cache/cached-main-resource.html
accessibility/adjacent-continuations-cause-assertion-failure.html
canvas/philip/tests/2d.clearRect+fillRect.basic.html
compositing/absolute-position-changed-with-composited-parent-layer.html
canvas/philip/tests/2d.clearRect+fillRect.alpha0.html
Comment 16 Build Bot 2014-01-30 10:58:13 PST
Created attachment 222688 [details]
Archive of layout-test-results from webkit-ews-14 for mac-mountainlion-wk2

The attached test failures were seen while running run-webkit-tests on the mac-wk2-ews.
Bot: webkit-ews-14  Port: mac-mountainlion-wk2  Platform: Mac OS X 10.8.5
Comment 17 Dean Jackson 2014-01-30 11:25:28 PST
Created attachment 222696 [details]
Patch
Comment 18 Dean Jackson 2014-01-30 11:26:29 PST
Chew!
Comment 19 Dean Jackson 2014-01-30 13:25:57 PST
Committed r163109: <http://trac.webkit.org/changeset/163109>