New issue
Advanced search Search tips

Issue 815362 link

Starred by 3 users

Issue metadata

Status: Fixed
Owner:
Closed: Feb 2018
Components:
EstimatedDays: ----
NextAction: ----
OS: ----
Pri: 3
Type: Bug



Sign in to add a comment

DCHECK failure in downloadsInternal.determineFilename

Project Member Reported by lazyboy@chromium.org, Feb 24 2018

Issue description

This happens to me when I tested a downloader extension from webstore, trying to download a file from the internetz.

It seems DownloadsInternalDeterminFilenameFunction will always fail a DCHECK because it never actually responds (from ExtensionFunction's pov, never calls SendResponse) before the function is destroyed:

[29818:29818:0223/154557.569987:FATAL:extension_function.cc(505)] Check failed: !browser_client || browser_client->IsShuttingDown() || did_respond() || ignore_all_did_respond_for_testing_do_not_use. downloadsInternal.determineFilename

bool DownloadsInternalDetermineFilenameFunction::RunAsync() {
  ...
  // This returns true/false.
  return ExtensionDownloadsEventRouter::DetermineFilename(
      GetProfile(),
      include_incognito(),
      extension()->id(),
      params->download_id,
      base::FilePath(filename),
      extensions::api::downloads::ParseFilenameConflictAction(
          params->conflict_action),
      &error_);
}

I think the function meant to call
SendResponse(ExtensionDownloadsEventRouter::DetermineFilename(...));
return true;

I have a quick fix for this.
 
Project Member

Comment 1 by bugdroid1@chromium.org, Feb 27 2018

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/f5f9fe791ff1d5985bcad10b4cabbbdbf7c6225c

commit f5f9fe791ff1d5985bcad10b4cabbbdbf7c6225c
Author: Istiaque Ahmed <lazyboy@chromium.org>
Date: Tue Feb 27 01:19:54 2018

Respond from downloadsInternal.determineFilename function.

Currently this extension function doesn't officialy send a response,
hence on debug builds this results in a DCHECK failure. Fix this.
Also convert the function to UIThreadExtensionFunction.

Bug:  815362 
Change-Id: Ie58dd6fe0b94079f6d9098ae74a666b01b97a1e2
Reviewed-on: https://chromium-review.googlesource.com/936007
Commit-Queue: Istiaque Ahmed <lazyboy@chromium.org>
Reviewed-by: Devlin <rdevlin.cronin@chromium.org>
Cr-Commit-Position: refs/heads/master@{#539361}
[modify] https://crrev.com/f5f9fe791ff1d5985bcad10b4cabbbdbf7c6225c/chrome/browser/extensions/api/downloads/downloads_api.cc
[modify] https://crrev.com/f5f9fe791ff1d5985bcad10b4cabbbdbf7c6225c/chrome/browser/extensions/api/downloads/downloads_api.h
[modify] https://crrev.com/f5f9fe791ff1d5985bcad10b4cabbbdbf7c6225c/chrome/browser/extensions/api/downloads/downloads_api_browsertest.cc
[modify] https://crrev.com/f5f9fe791ff1d5985bcad10b4cabbbdbf7c6225c/chrome/browser/extensions/api/downloads_internal/downloads_internal_api.cc
[modify] https://crrev.com/f5f9fe791ff1d5985bcad10b4cabbbdbf7c6225c/chrome/browser/extensions/api/downloads_internal/downloads_internal_api.h

Status: Fixed (was: Started)

Comment 3 by qin...@chromium.org, May 30 2018

Issue 787883 has been merged into this issue.

Sign in to add a comment