Bug 136444

Summary: CommitLayerTree decode fails in 32-bit apps on 64-bit devices (TransformationMatrix alignment differs)
Product: WebKit Reporter: Tim Horton <thorton>
Component: WebKit2Assignee: Tim Horton <thorton>
Status: RESOLVED FIXED    
Severity: Normal CC: andersca, benjamin, mitz, sam, simon.fraser
Priority: P2 Keywords: InRadar
Version: 528+ (Nightly build)   
Hardware: Unspecified   
OS: Unspecified   
Attachments:
Description Flags
patch andersca: review+

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