title: Android webview crash "Fatal signal 5 (SIGTRAP)"
body: <p>I have an app with a web view in which I load HTML content with JavaScript enabled. The web view is inside a fragment.</p>
  <p>This is how I initialize the web view inside the method <code>onCreateView</code> of the fragment :</p>
  <pre class="lang-java prettyprint-override"><code>WebView webview = (WebView) mainView.findViewById(R.id.webview);
  
  WebSettings webSettings = webview.getSettings();
  
  webSettings.setJavaScriptEnabled(true);
  webSettings.setDisplayZoomControls(false);
  webSettings.setLoadsImagesAutomatically(true);
  webSettings.setBuiltInZoomControls(true);
  webSettings.setDomStorageEnabled(true);
  webSettings.setSupportMultipleWindows(true);
  
  webview.setWebViewClient(new WebViewClient() {
      @Override
      public void onPageFinished(WebView view, String url) {
          super.onPageFinished(view, url);
          /*
          * My code
          */
      }
  });
  
  webview.setWebChromeClient(new WebChromeClient() {
      @Override
      public boolean onCreateWindow(WebView view, boolean isDialog, boolean isUserGesture, Message resultMsg) {
          WebView.HitTestResult result = view.getHitTestResult();
          String data = result.getExtra();
          if (data != null) {
              Intent browserIntent = new Intent(Intent.ACTION_VIEW, Uri.parse(data));
              startActivity(browserIntent);
          }
          return false;
      }
  });
  
  webview.loadDataWithBaseURL(baseUrl, htmlData, &quot;text/html&quot;, &quot;utf-8&quot;, &quot;&quot;);
  </code></pre>
  <p>In the web view, a map is loaded with JavaScript. On this map, we can click on elements and load photos. When clicked, the photo is displayed in a popup (still inside the web view). When I click on the back button to go back to the map, the app crashes.</p>
  <p><a href="https://i.stack.imgur.com/KZrL0.gif" rel="noreferrer"><img src="https://i.stack.imgur.com/KZrL0.gif" alt="GIF of the crash in app" /></a></p>
  <p>Here is the error log :</p>
  <blockquote>
  <p>A/libc: Fatal signal 5 (SIGTRAP), code 1 in tid 949 (Chrome_InProcRe)
  [ 03-21 11:26:08.510   364:  364 W/         ]
  debuggerd: handling request: pid=32610 uid=10289 gid=10289 tid=949</p>
  </blockquote>
  <p>I tested and got the crash on Android 7.1.1, 6.0.1, 5.0.2. Then I tried with Android 4.4.2 and the app didn't crash.</p>
  <p>When I click on the back button (as we can see on the GIF), it should go back to the previous state with the popup closed</p>