Webview crash on background due to 'visitLocalDescendants called on an unattached node'

81 views
Skip to first unread message

Thibault DENIS

unread,
Nov 4, 2024, 5:56:19 AMNov 4
to Google Mobile Ads SDK Developers
Hello,

We are experiencing a new crash since mid-octobre (around 22k events on 2 weeks) in the Google Ad Manager interstitial, which seems to be related to the management of the WebView when the rendering process ends or is interrupted.

We believe we are in a case of memory saturation or a crash of the rendering process. It seems that Google Ad Manager correctly removes the WebView from the view hierarchy, but uses the onDetachedFromWindow callback to execute some JavaScript code. This script calls org.chromium.ui.base.ViewAndroidDelegate.requestFocus a little further in the code without checking if the view is still attached.

I've added a stacktrace of our crash. 

Changes made on our side at the same time:
Update webkit from 1.11.0 to 1.12.1

GAM version: 23.2.0 (nothing related to this crash in the release notes of the new versions)

Possible solution:
Implement a conditional check before each call to requestFocus in org.chromium.ui.base.ViewAndroidDelegate, to confirm that the view is attached but maybe the true issue is somewhere deeper and this fix will just hide it.

Thanks for you help,
Thibault
stacktrace.txt

Thibault DENIS

unread,
Nov 4, 2024, 4:01:52 PMNov 4
to Google Mobile Ads SDK Developers
Hello,
We are experiencing a new crash since mid-octobre (around 22k events on 2 weeks) in the Google Ad Manager interstitial, which seems to be related to the management of the WebView when the rendering process ends or is interrupted.
We believe we are in a case of memory saturation or a crash of the rendering process. It seems that Google Ad Manager correctly removes the WebView from the view hierarchy, but uses the onDetachedFromWindow callback to execute some JavaScript code. This script calls org.chromium.ui.base.ViewAndroidDelegate.requestFocus a little further in the code without checking if the view is still attached.
I've added a stacktrace of our crash.

Changes made on our side at the same time:
- Update webkit from 1.11.0 to 1.12.1
- GAM version: 23.2.0 (nothing related to this crash in the release notes of the new versions)
stacktrace.txt

Mobile Ads SDK Forum Advisor

unread,
Nov 5, 2024, 12:20:21 AMNov 5
to google-adm...@googlegroups.com
Hi,

Could you kindly share a sample project, so that we can have clear view of your implementation and provide solution.

If the file(s) you are looking to share are less than 25mb in total you can attach them to this case on your next reply. If you are having trouble attaching your file to this case or if your file(s) are larger than 25mb, you can share your files with me by performing the following steps:

1. Navigate to

https://docs.google.com/forms/d/e/1FAIpQLSfkAiXMeYP-fw1W3Z-tT9uwmATEKO5X6S-th0gR2ezdKaaqfg/viewform?usp=pp_url&entry.400550049=Mobile+Ads+SDK&entry.460850823=5004Q00002vGhy1QAC&entry.80707362=00274237

2. Fill out all fields, and attach your file(s).

3. Please reply back on this thread when you have uploaded your file(s). Please do not share this link.

 
This message is in relation to case "ref:!00D1U01174p.!5004Q02vGhy1:ref" (ADR-00274237)

Thanks,
 
Google Logo Mobile Ads SDK Team


Simon Marquis

unread,
Nov 7, 2024, 8:28:44 AMNov 7
to Google Mobile Ads SDK Developers
Hey Google Ads team, wake up!
This issue is once again gaining some speed (Nov. 5th) after your silently remotely fixed it last week (see the dip in the graph).
Here is a non-exhaustive list of affected versions we are seeing in our reports:
  • chromium-TrichromeWebViewGoogle6432.aab-stable-666810033:28
  • chromium-TrichromeWebViewGoogle6432.aab-stable-666810233:28
  • chromium-TrichromeWebViewGoogle6432.aab-stable-672305833:28
  • chromium-TrichromeWebViewGoogle6432.aab-stable-672306033:28
  • chromium-TrichromeWebViewGoogle6432.aab-stable-672308633:28

Screenshot 2024-11-07 at 11.35.40.png

> Could you kindly share a sample project, so that we can have clear view of your implementation and provide solution.
The bug is coming from our code, and we are unable to reproduce it with our test environment.

Mobile Ads SDK Forum Advisor

unread,
Nov 7, 2024, 12:21:23 PMNov 7
to simon....@adevinta.com, google-adm...@googlegroups.com, thibaul...@adevinta.com

Hi Simon,

Thank you for sharing the progress and confirming that the issue isn't occuring in your test environment. I believe you are following Set up WebView guide for your implementation. Also, In order to make progress on this crash issue we would require the minimum sample project reproducing the issue. You can make use of Google Android sample apps as a reference. 

Simon Marquis

unread,
Nov 8, 2024, 5:58:58 AMNov 8
to Google Mobile Ads SDK Developers
> The bug is coming from our code, and we are unable to reproduce it with our test environment.

I meant: is not coming from our code...

> Also, In order to make progress on this crash issue we would require the minimum sample project reproducing the issue. You can make use of Google Android sample apps as a reference.

As I said, we are not able to reproduce this on our side. Do you want me to submit an exact clone of your Android sample?

> I believe you are following Set up WebView guide for your implementation.

I'm not sure, I'll ask for confirmation, but I think we mainly use native (and interstitial) ads. The WebView traces that appears in the logs are coming directly from Google Mobile Ads SDKs own implantation.

Reply all
Reply to author
Forward
0 new messages