Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(326)

Issue 2259823004: [XFA] Force destruction order of font managers. (Closed)

Created:
4 years, 4 months ago by dsinclair
Modified:
4 years, 4 months ago
Reviewers:
Lei Zhang, Wei Li
CC:
pdfium-reviews_googlegroups.com, npm
Base URL:
https://pdfium.googlesource.com/pdfium.git@master
Target Ref:
refs/heads/master
Project:
pdfium
Visibility:
Public.

Description

[XFA] Force destruction order of font managers. The GEFont points to the font manager which creates it and tries to unregister itself. Currently the GEFont can be created by the default mapper and then stored in a different mapper. If the default mapper is destroyed first, when the second mapper cleans up the font there will be a call to unregister on the default mapper causing a use-after-free. The long term fix is to fixup the GEFont so it points to the correct mapper to unregister from. This CL forces the destruction order in CXFA_FFApp to cleanup the non-default mapper first. BUG=chromium:637546 Committed: https://pdfium.googlesource.com/pdfium/+/837735660808d52580703183ae24a3c7c7b05c7d

Patch Set 1 #

Patch Set 2 : More resets #

Total comments: 2

Patch Set 3 : Re-arrange header entries #

Unified diffs Side-by-side diffs Delta from patch set Stats (+21 lines, -12 lines) Patch
M xfa/fgas/font/fgas_stdfontmgr.h View 3 chunks +1 line, -2 lines 0 comments Download
M xfa/fgas/font/fgas_stdfontmgr.cpp View 3 chunks +2 lines, -3 lines 0 comments Download
M xfa/fxfa/app/xfa_fontmgr.cpp View 2 chunks +4 lines, -6 lines 0 comments Download
M xfa/fxfa/include/xfa_ffapp.h View 1 2 1 chunk +14 lines, -1 line 0 comments Download

Messages

Total messages: 22 (13 generated)
dsinclair
PTAL. This isn't the issue reported, but it happens with the same input file so ...
4 years, 4 months ago (2016-08-18 15:49:31 UTC) #2
dsinclair
On 2016/08/18 15:58:57, commit-bot: I haz the power wrote: > Dry run: Try jobs failed ...
4 years, 4 months ago (2016-08-18 16:05:13 UTC) #7
dsinclair
K, bots green. Turns out the theme needs to be deleted before the font manager ...
4 years, 4 months ago (2016-08-18 18:13:52 UTC) #12
Wei Li
https://codereview.chromium.org/2259823004/diff/20001/xfa/fxfa/app/xfa_ffapp.cpp File xfa/fxfa/app/xfa_ffapp.cpp (right): https://codereview.chromium.org/2259823004/diff/20001/xfa/fxfa/app/xfa_ffapp.cpp#newcode105 xfa/fxfa/app/xfa_ffapp.cpp:105: m_pFDEFontMgr.reset(); Can you just exchange the order of |m_pFDEFontMgr| ...
4 years, 4 months ago (2016-08-18 22:10:58 UTC) #13
dsinclair
I can't trigger this anymore, going to close this CL.
4 years, 4 months ago (2016-08-22 15:04:04 UTC) #14
dsinclair
Re-opened, this requires XFA which I'd disabled without realizing. https://codereview.chromium.org/2259823004/diff/20001/xfa/fxfa/app/xfa_ffapp.cpp File xfa/fxfa/app/xfa_ffapp.cpp (right): https://codereview.chromium.org/2259823004/diff/20001/xfa/fxfa/app/xfa_ffapp.cpp#newcode105 xfa/fxfa/app/xfa_ffapp.cpp:105: ...
4 years, 4 months ago (2016-08-23 13:59:43 UTC) #16
Wei Li
lgtm
4 years, 4 months ago (2016-08-23 16:33:47 UTC) #18
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.org/2259823004/40001
4 years, 4 months ago (2016-08-23 18:22:17 UTC) #20
commit-bot: I haz the power
4 years, 4 months ago (2016-08-23 18:39:29 UTC) #22
Message was sent while issue was closed.
Committed patchset #3 (id:40001) as
https://pdfium.googlesource.com/pdfium/+/837735660808d52580703183ae24a3c7c7b0...

Powered by Google App Engine
This is Rietveld 408576698