Open Bug 1861745 Opened 2 years ago Updated 8 months ago

Crash in [@ java.lang.NullPointerException: at org.mozilla.geckoview.GeckoSession.saveAsPdfByBrowsingContext(GeckoSession.java)]

Categories

(GeckoView :: PDF Viewer, defect)

Unspecified
Android
defect

Tracking

(firefox119 affected, firefox120 affected, firefox121 affected)

Tracking Status
firefox119 --- affected
firefox120 --- affected
firefox121 --- affected

People

(Reporter: cpeterson, Unassigned)

References

Details

(Keywords: crash, Whiteboard: [fxdroid][foundation])

Crash Data

This crash started in 118. Is that when we enabled the PDF Viewer?

Crash report: https://crash-stats.mozilla.org/report/index/01bc2e29-8624-4164-b57c-f2cd50231027

Exception: java.lang.NullPointerException
Message: Attempt to invoke virtual method 'void org.mozilla.geckoview.GeckoSession$Window.printToPdf(org.mozilla.geckoview.GeckoResult)' on a null object reference

Frame   Module  Function  Source
0   org.mozilla.geckoview.GeckoSession  saveAsPdfByBrowsingContext  GeckoSession.java:14
1   org.mozilla.geckoview.GeckoSession  saveAsPdf   GeckoSession.java:2
2   mozilla.components.browser.engine.gecko.GeckoEngineSession  requestPdfToDownload  GeckoEngineSession.kt:5
3   mozilla.components.browser.state.engine.middleware.EngineDelegateMiddleware$saveToPdf$1   invokeSuspend   EngineDelegateMiddleware.kt:14
4   kotlin.coroutines.jvm.internal.BaseContinuationImpl   resumeWith  ContinuationImpl.kt:9
5   kotlinx.coroutines.DispatchedTask   run   DispatchedTask.kt:112
6   android.os.Handler  handleCallback  Handler.java:873
7   android.os.Handler  dispatchMessage   Handler.java:99
8   android.os.Looper   loop  Looper.java:214
9   android.app.ActivityThread  main  ActivityThread.java:7156
10  java.lang.reflect.Method  invoke  Method.java:-2  False
11  com.android.internal.os.RuntimeInit$MethodAndArgsCaller   run   RuntimeInit.java:494
12  com.android.internal.os.ZygoteInit  main  ZygoteInit.java:975

I have some more info, this is originating from the Fenix menu button to save a PDF.

It could be a regular page or PDF page that the users are attempting to save. I'll see if I can find a STR.

This area was also changed in 118 by:

  • via bug 1809422 to help better ensure a Canonical Browsing Context was available on regular pages,
  • via bug 1842685 for processing printing a PDF differently, so that PDF's with editable forms print. (Bug switched from using the PDF file saver to the PDF print pre-processing routine for saving a PDF. There is an open bug to optimize this flow at bug 1839456.)

Also, I see a few traces with didPrintPageContent, so an alternate STR could also be related to printing pages or PDFs.

Severity: -- → S3
Priority: -- → P2
Whiteboard: [fxdroid][foundation]
See Also: → 1863336

Best lead so far that Calixte discovered is this.mWindow could be null and that is causing the NullPointerException.

Severity: S3 → S4
Priority: P2 → --
You need to log in before you can comment on or make changes to this bug.