Print website and go back while previewing lead to problem
Categories
(GeckoView :: General, defect)
Tracking
(Not tracked)
People
(Reporter: 1782769091, Unassigned)
Details
(Whiteboard: [qa-triaged])
Attachments
(2 files)
User Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/16.6 Safari/605.1.15
Steps to reproduce:
Mozilla/5.0 (Android 10; Mobile; rv:137.0) Gecko/137.0 Firefox/137.0
- Go into a web page
- Share
Actual results:
Sometimes the print failed and got exception like:"
java.io.FileNotFoundException: /data/user/0/org.mozilla.fenix.debug/cache/temp4188918591613093066.pdf (No such file or directory)
at java.io.FileInputStream.open0(Native Method)
at java.io.FileInputStream.open(FileInputStream.java:231)
at java.io.FileInputStream.<init>(FileInputStream.java:165)
at org.mozilla.geckoview.GeckoViewPrintDocumentAdapter.onWritePdf(GeckoViewPrintDocumentAdapter.java:163)
at org.mozilla.geckoview.GeckoViewPrintDocumentAdapter.lambda$onWrite$1(GeckoViewPrintDocumentAdapter.java:200)
at org.mozilla.geckoview.GeckoViewPrintDocumentAdapter.$r8$lambda$e-WrbmzkoOQYZ9mY25feYHwwzm0(Unknown Source:0)
at org.mozilla.geckoview.GeckoViewPrintDocumentAdapter$$ExternalSyntheticLambda2.onValue(D8$$SyntheticClass:0)
at org.mozilla.geckoview.GeckoResult.lambda$thenInternal$6(GeckoResult.java:588)
at org.mozilla.geckoview.GeckoResult.$r8$lambda$82f7lYxeXTzVvMgd9wZnqr4Ug34(Unknown Source:0)
at org.mozilla.geckoview.GeckoResult$$ExternalSyntheticLambda7.run(D8$$SyntheticClass:0)
at android.os.Handler.handleCallback(Handler.java:873)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loop(Looper.java:193)
at android.app.ActivityThread.main(ActivityThread.java:6669)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:493)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:858)
Could not close i/o stream:
java.lang.NullPointerException: Attempt to invoke virtual method 'void java.io.InputStream.close()' on a null object reference
at org.mozilla.geckoview.GeckoViewPrintDocumentAdapter.onWritePdf(GeckoViewPrintDocumentAdapter.java:177)
at org.mozilla.geckoview.GeckoViewPrintDocumentAdapter.lambda$onWrite$1(GeckoViewPrintDocumentAdapter.java:200)
at org.mozilla.geckoview.GeckoViewPrintDocumentAdapter.$r8$lambda$e-WrbmzkoOQYZ9mY25feYHwwzm0(Unknown Source:0)
at org.mozilla.geckoview.GeckoViewPrintDocumentAdapter$$ExternalSyntheticLambda2.onValue(D8$$SyntheticClass:0)
at org.mozilla.geckoview.GeckoResult.lambda$thenInternal$6(GeckoResult.java:588)
at org.mozilla.geckoview.GeckoResult.$r8$lambda$82f7lYxeXTzVvMgd9wZnqr4Ug34(Unknown Source:0)
at org.mozilla.geckoview.GeckoResult$$ExternalSyntheticLambda7.run(D8$$SyntheticClass:0)
at android.os.Handler.handleCallback(Handler.java:873)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loop(Looper.java:193)
at android.app.ActivityThread.main(ActivityThread.java:6669)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:493)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:858)
"
Expected results:
The printer appear normally
Comment 1•4 months ago
|
||
The severity field is not set for this bug.
:royang, could you have a look please?
For more information, please visit BugBot documentation.
Updated•4 months ago
|
Comment 2•4 months ago
|
||
From stack, it looks like it's related to opening input stream in PDF. Moving to GV.
Comment 3•4 months ago
•
|
||
Thanks for reporting! A few questions could help us debug:
- What model is your device?
- Does this happen on all pages or only certain pages?
- Does it seem like it happens only if you tap through very quickly?
The error is happening in the GeckoViewPrintDocumentAdapter. It seems like a race condition could be at play here. (Content is generated into a PDF file before printing.)
Reporter | ||
Comment 4•4 months ago
|
||
Thank you for your insightful analysis! I have followed your suggestion, tried to produce the bug, and finally succeed.
The bug will appear when: you click share->print and then click back soon as the previewing is not finished.
Model: Google Plxel 2
Pages: I have tried several pages with the bug successfully reproduced. For example, the "Firefox for Android Support" Page, the "pocket app" page
Situation: Click back when previewing will lead to the bug, but after the preview is finished then click back, the bug won't happen
Comment 5•4 months ago
|
||
I was not able to reproduce this issue following the steps from Comment 4 on Firefox Nighty 137 (2025-03-03) using a Google Pixel 8 (Android 15) and a Samsung S24 Ultra (Android 14).
Could you please attach a video with the issue?
Thanks!
Updated•4 months ago
|
Reporter | ||
Comment 6•4 months ago
|
||
Reporter | ||
Comment 7•4 months ago
|
||
Reporter | ||
Comment 8•4 months ago
|
||
Sure, I have tried to reproduce and record in two devices.
Device 1
Model: Google Pixel 2
Android: 9.0
Version: 137.0a1-20250204223304 debug
The corresponding stacktrace of the first video:
2025-03-04 14:07:29.532 14804-14804 GVPrintDocumentAdapter org.mozilla.fenix.debug E Could not complete onWrite for printing:
java.io.FileNotFoundException: /data/user/0/org.mozilla.fenix.debug/cache/temp5705559982248708971.pdf (No such file or directory)
at java.io.FileInputStream.open0(Native Method)
at java.io.FileInputStream.open(FileInputStream.java:231)
at java.io.FileInputStream.<init>(FileInputStream.java:165)
at org.mozilla.geckoview.GeckoViewPrintDocumentAdapter.onWritePdf(GeckoViewPrintDocumentAdapter.java:163)
at org.mozilla.geckoview.GeckoViewPrintDocumentAdapter.lambda$onWrite$1(GeckoViewPrintDocumentAdapter.java:200)
at org.mozilla.geckoview.GeckoViewPrintDocumentAdapter.$r8$lambda$e-WrbmzkoOQYZ9mY25feYHwwzm0(Unknown Source:0)
at org.mozilla.geckoview.GeckoViewPrintDocumentAdapter$$ExternalSyntheticLambda2.onValue(D8$$SyntheticClass:0)
at org.mozilla.geckoview.GeckoResult.lambda$thenInternal$6(GeckoResult.java:588)
at org.mozilla.geckoview.GeckoResult.$r8$lambda$82f7lYxeXTzVvMgd9wZnqr4Ug34(Unknown Source:0)
at org.mozilla.geckoview.GeckoResult$$ExternalSyntheticLambda7.run(D8$$SyntheticClass:0)
at android.os.Handler.handleCallback(Handler.java:873)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loop(Looper.java:193)
at android.app.ActivityThread.main(ActivityThread.java:6669)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:493)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:858)
2025-03-04 14:07:29.532 14804-14804 GVPrintDocumentAdapter org.mozilla.fenix.debug E Could not close i/o stream:
java.lang.NullPointerException: Attempt to invoke virtual method 'void java.io.InputStream.close()' on a null object reference
at org.mozilla.geckoview.GeckoViewPrintDocumentAdapter.onWritePdf(GeckoViewPrintDocumentAdapter.java:177)
at org.mozilla.geckoview.GeckoViewPrintDocumentAdapter.lambda$onWrite$1(GeckoViewPrintDocumentAdapter.java:200)
at org.mozilla.geckoview.GeckoViewPrintDocumentAdapter.$r8$lambda$e-WrbmzkoOQYZ9mY25feYHwwzm0(Unknown Source:0)
at org.mozilla.geckoview.GeckoViewPrintDocumentAdapter$$ExternalSyntheticLambda2.onValue(D8$$SyntheticClass:0)
at org.mozilla.geckoview.GeckoResult.lambda$thenInternal$6(GeckoResult.java:588)
at org.mozilla.geckoview.GeckoResult.$r8$lambda$82f7lYxeXTzVvMgd9wZnqr4Ug34(Unknown Source:0)
at org.mozilla.geckoview.GeckoResult$$ExternalSyntheticLambda7.run(D8$$SyntheticClass:0)
at android.os.Handler.handleCallback(Handler.java:873)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loop(Looper.java:193)
at android.app.ActivityThread.main(ActivityThread.java:6669)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:493)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:858)
Device 2
Model: Google Pixel 8 pro
Android: 13
Version: 138.0a1-20250303162910 nightly
The corresponding stacktrace of the second video:
2025-03-04 14:15:28.189 20422-20422 GVPrintDocumentAdapter org.mozilla.fenix E Could not complete onWrite for printing:
java.io.FileNotFoundException: /data/user/0/org.mozilla.fenix/cache/temp6827121734829312455.pdf: open failed: ENOENT (No such file or directory)
at libcore.io.IoBridge.open(IoBridge.java:574)
at java.io.FileInputStream.<init>(FileInputStream.java:160)
at org.mozilla.geckoview.GeckoViewPrintDocumentAdapter.onWritePdf(GeckoViewPrintDocumentAdapter.java:9)
at org.mozilla.geckoview.GeckoViewPrintDocumentAdapter.lambda$onWrite$1(GeckoViewPrintDocumentAdapter.java:13)
at org.mozilla.geckoview.GeckoViewPrintDocumentAdapter.$r8$lambda$e-WrbmzkoOQYZ9mY25feYHwwzm0(GeckoViewPrintDocumentAdapter.java:1)
at org.mozilla.geckoview.GeckoViewPrintDocumentAdapter$$ExternalSyntheticLambda1.onValue(R8$$SyntheticClass:9)
at org.mozilla.geckoview.GeckoResult.lambda$thenInternal$6(GeckoResult.java:11)
at org.mozilla.geckoview.GeckoResult.$r8$lambda$82f7lYxeXTzVvMgd9wZnqr4Ug34(GeckoResult.java:1)
at org.mozilla.geckoview.GeckoResult$$ExternalSyntheticLambda7.run(R8$$SyntheticClass:9)
at android.os.Handler.handleCallback(Handler.java:942)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loopOnce(Looper.java:201)
at android.os.Looper.loop(Looper.java:288)
at android.app.ActivityThread.main(ActivityThread.java:7872)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:548)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:936)
Caused by: android.system.ErrnoException: open failed: ENOENT (No such file or directory)
at libcore.io.Linux.open(Native Method)
at libcore.io.ForwardingOs.open(ForwardingOs.java:563)
at libcore.io.BlockGuardOs.open(BlockGuardOs.java:274)
at libcore.io.ForwardingOs.open(ForwardingOs.java:563)
at android.app.ActivityThread$AndroidOs.open(ActivityThread.java:7758)
at libcore.io.IoBridge.open(IoBridge.java:560)
at java.io.FileInputStream.<init>(FileInputStream.java:160)
at org.mozilla.geckoview.GeckoViewPrintDocumentAdapter.onWritePdf(GeckoViewPrintDocumentAdapter.java:9)
at org.mozilla.geckoview.GeckoViewPrintDocumentAdapter.lambda$onWrite$1(GeckoViewPrintDocumentAdapter.java:13)
at org.mozilla.geckoview.GeckoViewPrintDocumentAdapter.$r8$lambda$e-WrbmzkoOQYZ9mY25feYHwwzm0(GeckoViewPrintDocumentAdapter.java:1)
at org.mozilla.geckoview.GeckoViewPrintDocumentAdapter$$ExternalSyntheticLambda1.onValue(R8$$SyntheticClass:9)
at org.mozilla.geckoview.GeckoResult.lambda$thenInternal$6(GeckoResult.java:11)
at org.mozilla.geckoview.GeckoResult.$r8$lambda$82f7lYxeXTzVvMgd9wZnqr4Ug34(GeckoResult.java:1)
at org.mozilla.geckoview.GeckoResult$$ExternalSyntheticLambda7.run(R8$$SyntheticClass:9)
at android.os.Handler.handleCallback(Handler.java:942)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loopOnce(Looper.java:201)
at android.os.Looper.loop(Looper.java:288)
at android.app.ActivityThread.main(ActivityThread.java:7872)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:548)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:936)
2025-03-04 14:15:28.190 20422-20422 GVPrintDocumentAdapter org.mozilla.fenix E Could not close i/o stream:
java.lang.NullPointerException: Attempt to invoke virtual method 'void java.io.InputStream.close()' on a null object reference
at org.mozilla.geckoview.GeckoViewPrintDocumentAdapter.onWritePdf(GeckoViewPrintDocumentAdapter.java:82)
at org.mozilla.geckoview.GeckoViewPrintDocumentAdapter.lambda$onWrite$1(GeckoViewPrintDocumentAdapter.java:13)
at org.mozilla.geckoview.GeckoViewPrintDocumentAdapter.$r8$lambda$e-WrbmzkoOQYZ9mY25feYHwwzm0(GeckoViewPrintDocumentAdapter.java:1)
at org.mozilla.geckoview.GeckoViewPrintDocumentAdapter$$ExternalSyntheticLambda1.onValue(R8$$SyntheticClass:9)
at org.mozilla.geckoview.GeckoResult.lambda$thenInternal$6(GeckoResult.java:11)
at org.mozilla.geckoview.GeckoResult.$r8$lambda$82f7lYxeXTzVvMgd9wZnqr4Ug34(GeckoResult.java:1)
at org.mozilla.geckoview.GeckoResult$$ExternalSyntheticLambda7.run(R8$$SyntheticClass:9)
at android.os.Handler.handleCallback(Handler.java:942)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loopOnce(Looper.java:201)
at android.os.Looper.loop(Looper.java:288)
at android.app.ActivityThread.main(ActivityThread.java:7872)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:548)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:936)
Reporter | ||
Updated•4 months ago
|
Description
•