Bug 136444 - CommitLayerTree decode fails in 32-bit apps on 64-bit devices (TransformationMatrix alignment differs)
Summary: CommitLayerTree decode fails in 32-bit apps on 64-bit devices (Transformation...
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebKit2 (show other bugs)
Version: 528+ (Nightly build)
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Tim Horton
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2014-09-01 21:06 PDT by Tim Horton
Modified: 2014-09-25 12:31 PDT (History)
5 users (show)

See Also:


Attachments
patch (3.81 KB, patch)
2014-09-01 21:13 PDT, Tim Horton
andersca: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Tim Horton 2014-09-01 21:06:12 PDT
For PLATFORM(IOS), 32-bit apps launch 64-bit Web processes.
alignof(TransformationMatrix) = 8 in the 64-bit Web process, but it's 4 in the app.
TransformationMatrix is encoded using SimpleArgumentCoder.
SimpleArgumentCoder respects alignment when copying into the IPC message buffer (Sam says this is important but I don't really understand; Sam or Anders, if you want to clarify that would be cool!).
This means that the message decode fails, and the UI process kills the Web process, whenever you have a TransformationMatrix in a message, which happens a lot with UI-Side Compositing.

rdar://problem/17952526
Comment 1 Tim Horton 2014-09-01 21:08:42 PDT
Various potential fixes:

1. Don't use a SimpleArgumentCoder here; manually encode/decode the 16 doubles.
2. Force the alignment of TransformationMatrix to be the same everywhere (we already force it to 16 byte alignment on some platforms).
3. Don't copy into the message buffer respecting alignment (it sounds like this is a nonstarter).

Going to post a patch for #1, but we can discuss alternatives.
Also going to check if AffineTransform is also affected.
Comment 2 Tim Horton 2014-09-01 21:13:29 PDT
Created attachment 237475 [details]
patch
Comment 3 Simon Fraser (smfr) 2014-09-01 22:03:15 PDT
Comment on attachment 237475 [details]
patch

:(
Comment 4 Tim Horton 2014-09-25 12:31:40 PDT
http://trac.webkit.org/changeset/173973