New issue
Advanced search Search tips

Issue 905142 link

Starred by 1 user

Issue metadata

Status: Fixed
Owner:
Closed: Nov 14
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: Linux
Pri: 3
Type: Bug



Sign in to add a comment

PDFium Assert Failure in CFX_FileBufferArchive::WriteBlock

Project Member Reported by mpdenton@google.com, Nov 14

Issue description

On ToT, go to http://www.planetpublish.com/wp-content/uploads/2011/11/The_Scarlet_Letter_T.pdf

and then click the print button to print. Hit assertion:
third_party/pdfium/core/fpdfapi/edit/cpdf_creator.cpp:77: virtual bool (anonymous namespace)::CFX_FileBufferArchive::WriteBlock(const void *, size_t): Assertion `pBuf && size > 0' failed.

Let me know if you can reproduce this.
 
Labels: OS-Linux
I can repro.
ASSERT seems kind of pointless since it sure looks like the code handles the WriteBlock(nullptr, 0) case just fine otherwise ... 
Cc: tsepez@chromium.org
Owner: thestig@chromium.org
Status: Assigned (was: Untriaged)
It's trying to write out a stream of size 0.
Seems like we should just handle this to prevent inflicting a burden on the callers.
https://pdfium-review.googlesource.com/45531 but I'm going to try to write a test.
Project Member

Comment 6 by bugdroid1@chromium.org, Nov 14

The following revision refers to this bug:
  https://pdfium.googlesource.com/pdfium/+/c160069648cade1dc45ff85efa21704a6cf6d897

commit c160069648cade1dc45ff85efa21704a6cf6d897
Author: Lei Zhang <thestig@chromium.org>
Date: Wed Nov 14 23:12:58 2018

Avoid writing out empty streams in CPDF_Stream::WriteTo().

Do not call CFX_FileBufferArchive::WriteBlock() with no data to write
out to avoid an ASSERT() failure. Although
CFX_FileBufferArchive::WriteBlock() can handle no data just fine, it is
an IFX_WriteStream::WriteBlock() implementation and not all
IFX_WriteStream::WriteBlock() implementations can handle no data.

BUG= chromium:905142 

Change-Id: Icef8460443a9363526679261aac0c1ef74bccec4
Reviewed-on: https://pdfium-review.googlesource.com/c/45531
Reviewed-by: Tom Sepez <tsepez@chromium.org>
Commit-Queue: Lei Zhang <thestig@chromium.org>

[modify] https://crrev.com/c160069648cade1dc45ff85efa21704a6cf6d897/fpdfsdk/fpdf_save_embeddertest.cpp
[modify] https://crrev.com/c160069648cade1dc45ff85efa21704a6cf6d897/core/fpdfapi/parser/cpdf_stream.cpp
[add] https://crrev.com/c160069648cade1dc45ff85efa21704a6cf6d897/testing/resources/bug_905142.in
[add] https://crrev.com/c160069648cade1dc45ff85efa21704a6cf6d897/testing/resources/bug_905142.pdf

Status: Fixed (was: Assigned)
Project Member

Comment 8 by bugdroid1@chromium.org, Nov 15

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/dbf62f55172f4b5e6e633b3126ebd4d70f3b2add

commit dbf62f55172f4b5e6e633b3126ebd4d70f3b2add
Author: chromium-autoroll <chromium-autoroll@skia-public.iam.gserviceaccount.com>
Date: Thu Nov 15 20:28:53 2018

Roll src/third_party/pdfium 2585eafdcba3..2aa7e8cbc413 (14 commits)

https://pdfium.googlesource.com/pdfium.git/+log/2585eafdcba3..2aa7e8cbc413


git log 2585eafdcba3..2aa7e8cbc413 --date=short --no-merges --format='%ad %ae %s'
2018-11-15 tsepez@chromium.org Revert "Track indirect object holder in more CPDF_ objects."
2018-11-15 thestig@chromium.org Revert "Slightly simplify CPDF_FontEncoding::Realize()."
2018-11-15 tsepez@chromium.org Revert "Make orphaning old objects automatic during dictionary set/removal."
2018-11-15 tsepez@chromium.org Speculative fix for unit test failure under code coverage
2018-11-15 thestig@chromium.org Remove some inactive OWNERS.
2018-11-15 tsepez@chromium.org Better tests for AFSpecial_Format().
2018-11-14 tsepez@chromium.org Process XFA preamble by inclusion rather than hard-coded strings
2018-11-14 thestig@chromium.org Avoid writing out empty streams in CPDF_Stream::WriteTo().
2018-11-14 thestig@chromium.org Slightly simplify CPDF_FontEncoding::Realize().
2018-11-14 tsepez@chromium.org Make orphaning old objects automatic during dictionary set/removal.
2018-11-14 tsepez@chromium.org Process XFA config by inclusion in place of hard coded strings
2018-11-14 tsepez@chromium.org Process XFA locale by inclusion rather than hard-coded string.
2018-11-14 tsepez@chromium.org Track indirect object holder in more CPDF_ objects.
2018-11-14 thestig@chromium.org Add some basic CPDF_PSEngine tests.


Created with:
  gclient setdep -r src/third_party/pdfium@2aa7e8cbc413

The AutoRoll server is located here: https://autoroll.skia.org/r/pdfium-autoroll

Documentation for the AutoRoller is here:
https://skia.googlesource.com/buildbot/+/master/autoroll/README.md

If the roll is causing failures, please contact the current sheriff, who should
be CC'd on the roll, and stop the roller if necessary.



BUG=chromium:901654, chromium:905142 ,chromium:901654
TBR=dsinclair@chromium.org

Change-Id: Id92cee32fc92da023a16e1bd5fe2e24b0752dbb3
Reviewed-on: https://chromium-review.googlesource.com/c/1337641
Reviewed-by: chromium-autoroll <chromium-autoroll@skia-public.iam.gserviceaccount.com>
Commit-Queue: chromium-autoroll <chromium-autoroll@skia-public.iam.gserviceaccount.com>
Cr-Commit-Position: refs/heads/master@{#608494}
[modify] https://crrev.com/dbf62f55172f4b5e6e633b3126ebd4d70f3b2add/DEPS

Sign in to add a comment