When printing a PDF attachment, only blank pages are being printed
Categories
(Thunderbird :: General, defect, P1)
Tracking
(thunderbird_esr128 unaffected, thunderbird137 affected, thunderbird138+ affected)
Tracking | Status | |
---|---|---|
thunderbird_esr128 | --- | unaffected |
thunderbird137 | --- | affected |
thunderbird138 | + | affected |
People
(Reporter: tim, Assigned: lsalzman)
References
(Regression)
Details
(Keywords: regression)
Attachments
(4 files)
User Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:137.0) Gecko/20100101 Firefox/137.0
Steps to reproduce:
Print a PDF attachment.
Actual results:
Only blank pages are being printed.
Expected results:
The contents of the PDF attachment should have been printed.
Comment 1•21 days ago
|
||
Same if you print it to pdf? Sure the printer is working?
Can you attach a sample .eml that contains such an attachment?
Reporter | ||
Comment 2•21 days ago
|
||
Reporter | ||
Comment 3•21 days ago
|
||
The issue also occurs when I print it to a PDF in Thunderbird. The PDF attachment prints correctly if I save it to my computer and print it using Adobe Acrobat.
I have attached a sample email.
Comment 4•21 days ago
|
||
I can confirm that on linux, Daily.
Prints fine on Firefox. Also prints fine on Thunderbird 128.
In the native console I got
[GFX1-]: DrawTargetCairo::Snapshot with bad surface 0x76b3196be400, context 0x76b315070e00, status 0
[GFX1-]: DrawTargetCairo::Snapshot with bad surface 0x76b3196be400, context 0x76b315070e00, status 0
[GFX1-]: DrawTargetCairo::Snapshot with bad surface 0x76b30d01cf00, context 0x76b30e38aa00, status 0
[GFX1-]: DrawTargetCairo::Snapshot with bad surface 0x76b30d01cf00, context 0x76b30e38aa00, status 0
[GFX1-]: DrawTargetCairo::Snapshot with bad surface 0x76b302e7fd00, context 0x76b30e389e00, status 0
[GFX1-]: DrawTargetCairo::Snapshot with bad surface 0x76b302e7fd00, context 0x76b30e389e00, status 0
Updated•21 days ago
|
Comment 7•19 days ago
|
||
Can we get a regression range for this?
Comment 8•19 days ago
|
||
See the duplicate bug. It also removes most of the helper programs or whatever they are called, under settings.
Comment 9•19 days ago
|
||
Regression range: you mean when it last worked?
I only observed this issue yesterday, with 137.0.1;
not sure about 137.0, may not have printed anything then;
I am certain it worked fine with 136 (or whatever was last before 137.0).
![]() |
||
Comment 10•19 days ago
|
||
Regression womdow:
https://hg-edge.mozilla.org/comm-central/pushloghtml?fromchange=d7962b3d85923e407ab984badc54f486e5909fe4&tochange=9b59f8dddd25df72266de3826685e11e28a65388
https://hg-edge.mozilla.org/mozilla-central/pushloghtml?fromchange=a7b709e4e4fa320e15ae82f8a0b7b1a43dadd6d5&tochange=d0efb392c1783f46f27a946f48e3ef729ecd3675
Comment 11•19 days ago
|
||
Thanks very much Alice.
This looks like a problem was introduced with the m-c update to pdf.js which happened in bug 1950814.
Comment 12•19 days ago
|
||
:calixte, any idea what's going on here?
Comment 13•19 days ago
|
||
I just tried in the Firefox nightly containing that patch with the attached pdf and it works for me.
I can reproduce myself with daily on Windows 11.
As far as I can tell, the pdf.js update doesn't contain anything which could cause such a bug.
In looking at the pushlog, I'd say that:
https://hg-edge.mozilla.org/mozilla-central/rev/9cc733bde4acd05b9c2f228499534a31b283d1e7
is probably a better culprit.
:lee, what do you think ?
Comment 14•18 days ago
|
||
Yeah it's working in Firefox but not in Thunderbird - which is very strange. (Tried nightly/daily for both)
Updated•18 days ago
|
Assignee | ||
Comment 15•18 days ago
|
||
My work in bug 1959815 might resolve this. We can see after it lands.
Comment 16•18 days ago
|
||
In case bug 1959815 does not help... would it help to "trap" the
print file generated by Thunderbird (the data sent to CUPS),
to be able to scrutinize?
Comment 17•17 days ago
|
||
Seems to be working with the 2025-04-12 daily build (which has the fix for bug 1959815)
Assignee | ||
Comment 18•17 days ago
|
||
Tim, does this still reproduce with the latest Firefox nightly build?
Reporter | ||
Comment 19•16 days ago
|
||
The issue only occurs in Thunderbird, not in Firefox.
![]() |
||
Comment 20•16 days ago
|
||
comm-central debug build(20250413102421) crashes without crash report when printing pdf.
And Terminal output:
[Parent 9476, Main Thread] WARNING: '!ClientIsValidPrincipalInfo(mClientInfo.PrincipalInfo())', file /builds/worker/checkouts/gecko/dom/clients/manager/ClientSource.cpp:186
[Parent 9476, Main Thread] WARNING: '!ClientIsValidCreationURL(mClientInfo.PrincipalInfo(), aArgs.url())', file /builds/worker/checkouts/gecko/dom/clients/manager/ClientSource.cpp:66
[Parent 9476, Main Thread] WARNING: Failed to retarget HTML data delivery to the parser thread.: file /builds/worker/checkouts/gecko/parser/html/nsHtml5StreamParser.cpp:1215
[Parent 9476, Main Thread] WARNING: NS_ENSURE_SUCCESS(rv, rv) failed with result 0x80004005 (NS_ERROR_FAILURE): file /builds/worker/checkouts/gecko/comm/mailnews/local/src/nsMailboxService.cpp:410
[Parent 9476, WindowsVsyncThread] WARNING: DwmComposition dynamically disabled, falling back to software timers: file /builds/worker/checkouts/gecko/gfx/thebes/gfxWindowsPlatform.cpp:1754
[Parent 9476, Main Thread] WARNING: '!ClientIsValidCreationURL(mClientInfo.PrincipalInfo(), aArgs.url())', file /builds/worker/checkouts/gecko/dom/clients/manager/ClientSource.cpp:66
[Parent 9476, Main Thread] WARNING: NS_ENSURE_SUCCESS(rv, rv) failed with result 0x80004005 (NS_ERROR_FAILURE): file /builds/worker/checkouts/gecko/chrome/nsChromeRegistry.cpp:182
[Parent 9476, Main Thread] WARNING: 'NS_FAILED(rv)', file /builds/worker/checkouts/gecko/chrome/nsChromeProtocolHandler.cpp:73
[Parent 9476, Main Thread] WARNING: Failed to retarget HTML data delivery to the parser thread.: file /builds/worker/checkouts/gecko/parser/html/nsHtml5StreamParser.cpp:1215
[Parent 9476, Main Thread] WARNING: NS_ENSURE_TRUE(mCacheEntry) failed: file /builds/worker/checkouts/gecko/netwerk/protocol/http/nsHttpChannel.cpp:5416
[Parent 9476, Main Thread] WARNING: Invalid computed inline-size!: 'aComputedISize >= 0', file /builds/worker/checkouts/gecko/layout/generic/ReflowInput.cpp:408
[Parent 9476, Main Thread] WARNING: Invalid computed inline-size!: 'aComputedISize >= 0', file /builds/worker/checkouts/gecko/layout/generic/ReflowInput.cpp:408
[Parent 9476, Main Thread] WARNING: Caller should supply a printer name.: file /builds/worker/checkouts/gecko/widget/nsPrintSettingsService.cpp:921
[GFX3-]: Surface size too large (exceeds extent limit)!
[GFX2-]: Allowing surface with invalid size (Cairo) Size(67280,47600)
[9476] Assertion failure: mClipDepth > 0, at /builds/worker/checkouts/gecko/gfx/2d/DrawTargetCairo.cpp:1572
#01: DumpCompleteHeap[T:\mozregression\thunderbird\xul.dll +0x1c6d8f6]
#02: VR_RuntimePath[T:\mozregression\thunderbird\xul.dll +0x41b296c]
#03: VR_RuntimePath[T:\mozregression\thunderbird\xul.dll +0x3c17767]
#04: VR_RuntimePath[T:\mozregression\thunderbird\xul.dll +0x40d550e]
#05: XRE_GetBootstrap[T:\mozregression\thunderbird\xul.dll +0xa7b5533]
#06: XRE_GetBootstrap[T:\mozregression\thunderbird\xul.dll +0xa7b4d14]
#07: XRE_GetBootstrap[T:\mozregression\thunderbird\xul.dll +0xa7b618d]
#08: XRE_GetBootstrap[T:\mozregression\thunderbird\xul.dll +0x87ffa63]
#09: XRE_GetBootstrap[T:\mozregression\thunderbird\xul.dll +0x8815f6c]
#10: XRE_GetBootstrap[T:\mozregression\thunderbird\xul.dll +0x87efdb1]
#11: XRE_GetBootstrap[T:\mozregression\thunderbird\xul.dll +0xa7b5285]
#12: XRE_GetBootstrap[T:\mozregression\thunderbird\xul.dll +0xa7c818c]
#13: XRE_GetBootstrap[T:\mozregression\thunderbird\xul.dll +0xa7b4354]
#14: XRE_GetBootstrap[T:\mozregression\thunderbird\xul.dll +0xa7b4e17]
#15: XRE_GetBootstrap[T:\mozregression\thunderbird\xul.dll +0xa7b618d]
#16: XRE_GetBootstrap[T:\mozregression\thunderbird\xul.dll +0x8bfdd2f]
#17: XRE_GetBootstrap[T:\mozregression\thunderbird\xul.dll +0x8bfe56e]
#18: ??? (???:???)
Comment 21•16 days ago
|
||
In case this helps.
When printing PDF with TB 137.0.1 (having started it from a terminal,
not the app menus), I also see errors in terminal output, something like:
[GFX1-]: DrawSurface with bad surface 1
[GFX1-]: DrawTargetCairo::Snapshot with bad surface 0x7f335b6c2700, context 0x7f3365256a00, status 0
Also, curiously, not all printing is fully blank. About to attach two files:
SU-orig.pdf as saved from TB, SU-sent.pdf as TB sent to the CUPS server.
Comment 22•16 days ago
|
||
Comment 23•16 days ago
|
||
Comment 24•15 days ago
|
||
Same problem Thunderbird 137.0.1
Comment 25•15 days ago
|
||
Please try Daily (on https://www.thunderbird.net/en-US/thunderbird/all/ select the daily channel).
Lee, does comment 20 warrant some additional fixes? That assert was added in bug 1950596.
Comment 27•14 days ago
|
||
Can the severity of this be increased, since it affects a release product, and a major function (printing) is now broken?
Assignee | ||
Comment 28•14 days ago
|
||
Fixes for bug 1959409 and bug 1959815 have both been uplifted to 138.
Comment 29•14 days ago
|
||
Worcester12345, is the bug summary not accurate - is all printing broken and not just pdf?
Thunderbird 138.0b3 comes in the next few days, which will deliver this fixes and it will be helpful for everyone to test them there.
Comment 30•14 days ago
|
||
Printing pdfs works for me now, but it would be good if someone else can also confirm on daily (or 138.0b3 soon).
Comment 31•14 days ago
|
||
Having same bug with 137.0.1 on OSX 14.7.5 Totally blank pages. This was not an issue before the 137.0.1 update.
![]() |
||
Comment 32•14 days ago
•
|
||
(In reply to Magnus Melin [:mkmelin] from comment #30)
Printing pdfs works for me now, but it would be good if someone else can also confirm on daily (or 138.0b3 soon).
I can still reproduce the issue on Daily 139.0a1 20250416004206 Windows11.
Comment 33•13 days ago
|
||
Same problem Thunderbird 137.0.2 ((
Comment 34•13 days ago
|
||
I wonder if this extension will help until the developers fix the problem? https://addons.thunderbird.net/en-us/thunderbird/addon/printingtools-ng/
Comment 35•13 days ago
|
||
I re-tested this, and indeed it's not fixed after all. It's working for some (simple) pdfs but not other. Errors from comment 4 are still happening.
Lee, any further ideas?
Assignee | ||
Comment 36•13 days ago
|
||
(In reply to Magnus Melin [:mkmelin] from comment #35)
I re-tested this, and indeed it's not fixed after all. It's working for some (simple) pdfs but not other. Errors from comment 4 are still happening.
Lee, any further ideas?
Is there a way to test this in Firefox proper rather than Thunderbird? It's not easily possible for me to test/develop on Thunderbird at the moment, so I would need a way to reproduce the issue in Firefox to investigate further.
Comment 37•13 days ago
•
|
||
Unfortunately I don't know of a way. Is there perhaps some pref that controls behavior around this and we have it different?
The assertion in comment 20 probably explains the issue but no idea how Thunderbird gets here and not Firefox.
Comment 38•13 days ago
|
||
Hi, its not fixed completely. It prints PDFs that are text like, but if theres some PDFs with images or an invoice with some graphical art decoration it will print blank in Thunderbird.
Im available to test or debug anything in Thunderbird, just teach me how.
Thanks.
Assignee | ||
Comment 39•13 days ago
|
||
(In reply to Magnus Melin [:mkmelin] from comment #37)
Unfortunately I don't know of a way. Is there perhaps some pref that controls behavior around this and we have it different?
The assertion in comment 20 probably explains the issue bug no idea how Thunderbird gets here and not Firefox.
According to comment 20, the problem seemingly is that the canvas created is too large, and failing because of this.
Calixte, did you make any recent change to PDFjs that causes it to create these gigantic unsupported canvases?
Assignee | ||
Comment 40•13 days ago
|
||
Updated•13 days ago
|
Assignee | ||
Comment 41•13 days ago
|
||
I just posted a patch to potentially address at least one of the issues in the logs shown to me.
If someone could apply the patch to a Thunderbird build and let me know if it further resolved the issue, that would help.
Comment 42•13 days ago
|
||
(In reply to Lee Salzman [:lsalzman] from comment #39)
According to comment 20, the problem seemingly is that the canvas created is too large, and failing because of this.
Calixte, did you make any recent change to PDFjs that causes it to create these gigantic unsupported canvases?
No I didn't.
The canvas we use in order to print is created here:
https://searchfox.org/comm-central/rev/da9f91d5e08cf84932aead6b40cab1f0e0397112/mozilla/toolkit/components/pdfjs/content/web/viewer.mjs#6307-6315
I checked the value we get in Firefox and in TB and they're the same: the width is 1275 and the height is 1650 (the pages dimensions are 612x792).
The Cairo logs show:
[GFX2-]: Allowing surface with invalid size (Cairo) Size(48960,63360)
So it looks like the dimensions are multiplied by 38.4
.
Comment 43•13 days ago
|
||
I just replaced the drawing part of the mozPrintCallback
by a single call tofillRect
(with a red color) and I still get the warnings about the invalid Cairo surface with the same values, but it isn't crashing anymore and the output pdf has 3 red pages ! so the dimensions are very likely not the problem here.
I'd say that removing the assertion should fix the problem (I'm using an artifact build so I can't test Lee's patch).
Comment 44•13 days ago
|
||
I'm from Brazil, and I have the same problem.
Comment 45•13 days ago
|
||
Tested the (In reply to Lee Salzman [:lsalzman] from comment #41)
Thanks! The patch seems good to me. At least the 3 pdfs I tried that didn't work before now print ok.
Comment 46•13 days ago
|
||
Comment 47•13 days ago
|
||
Can anyone give me an idea of ββwhen this fix will be in the stable Thunderbird release?
Comment 48•13 days ago
|
||
The fix is currently landing (should be available in the Daily available in ~4-5h). Probably it could then be uplifted to 138beta with v138 final releasing April 29.
Assignee | ||
Updated•12 days ago
|
Comment 49•12 days ago
|
||
bugherder |
Reporter | ||
Comment 50•12 days ago
|
||
Is this really not going to be fixed until Thunderbird 139.0? This is a fairly major defect.
Assignee | ||
Updated•12 days ago
|
Assignee | ||
Comment 51•12 days ago
|
||
Comment on attachment 9479360 [details]
Bug 1959171 - Guard against imbalanced clips in DrawTargetCairo. r?aosmond
Beta/Release Uplift Approval Request
- User impact if declined/Reason for urgency: Broken PDF printing in Thunderbird.
- Is this code covered by automated tests?: Unknown
- Has the fix been verified in Nightly?: Yes
- Needs manual test from QE?: No
- If yes, steps to reproduce:
- List of other uplifts needed: None
- Risk to taking this patch: Low
- Why is the change risky/not risky? (and alternatives if risky): Converts an assertion to a warning.
- String changes made/needed:
- Is Android affected?: Yes
Comment 52•12 days ago
|
||
Comment on attachment 9479360 [details]
Bug 1959171 - Guard against imbalanced clips in DrawTargetCairo. r?aosmond
Approved for 138.0b9
Comment 53•12 days ago
|
||
uplift |
Description
•