[Protected Audiences] Add some logging look for invalid debug URLs.
The browser process seems to be getting invalid report URLs from bidder worklet processes for unknown reasons. This CL adds some DumpWithoutCrashing() calls to the bidder worklet logic to try to locate the call path that's causing this. Bug: 41496188 Change-Id: I63a21f56ecbf83f61c37ed60b6069ebb8e7500ef Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5366521 Reviewed-by: Maks Orlovich <morlovich@chromium.org> Commit-Queue: mmenke <mmenke@chromium.org> Cr-Commit-Position: refs/heads/main@{#1272196}
This commit is contained in:

committed by
Chromium LUCI CQ

parent
194166372b
commit
9cf429ba10
content/services/auction_worklet
@ -15,6 +15,7 @@
|
||||
#include <vector>
|
||||
|
||||
#include "base/containers/contains.h"
|
||||
#include "base/debug/dump_without_crashing.h"
|
||||
#include "base/feature_list.h"
|
||||
#include "base/functional/bind.h"
|
||||
#include "base/functional/callback.h"
|
||||
@ -743,7 +744,15 @@ BidderWorklet::V8State::SingleGenerateBidResult::SingleGenerateBidResult(
|
||||
std::move(update_priority_signals_overrides)),
|
||||
pa_requests(std::move(pa_requests)),
|
||||
reject_reason(reject_reason),
|
||||
error_msgs(std::move(error_msgs)) {}
|
||||
error_msgs(std::move(error_msgs)) {
|
||||
// TODO(https://crbug.com/41496188): Remove when bug has been fixed.
|
||||
if (this->debug_loss_report_url && !this->debug_loss_report_url->is_valid()) {
|
||||
base::debug::DumpWithoutCrashing();
|
||||
}
|
||||
if (this->debug_win_report_url && !this->debug_win_report_url->is_valid()) {
|
||||
base::debug::DumpWithoutCrashing();
|
||||
}
|
||||
}
|
||||
|
||||
BidderWorklet::V8State::SingleGenerateBidResult::SingleGenerateBidResult(
|
||||
SingleGenerateBidResult&&) = default;
|
||||
|
@ -9,6 +9,8 @@
|
||||
#include <string>
|
||||
#include <utility>
|
||||
|
||||
#include "base/debug/crash_logging.h"
|
||||
#include "base/debug/dump_without_crashing.h"
|
||||
#include "base/feature_list.h"
|
||||
#include "base/functional/bind.h"
|
||||
#include "base/functional/callback.h"
|
||||
@ -27,7 +29,24 @@ namespace auction_worklet {
|
||||
|
||||
ForDebuggingOnlyBindings::ForDebuggingOnlyBindings(AuctionV8Helper* v8_helper)
|
||||
: v8_helper_(v8_helper) {}
|
||||
ForDebuggingOnlyBindings::~ForDebuggingOnlyBindings() = default;
|
||||
|
||||
ForDebuggingOnlyBindings::~ForDebuggingOnlyBindings() {
|
||||
// Reset() should always be called before destruction, so both URLs should be
|
||||
// nullopt.
|
||||
//
|
||||
// TODO(https://crbug.com/41496188): Remove when bug has been fixed.
|
||||
if (loss_report_url_ || win_report_url_) {
|
||||
SCOPED_CRASH_KEY_BOOL("fledge", "loss-url-unexpectedly-non-null",
|
||||
!!loss_report_url_);
|
||||
SCOPED_CRASH_KEY_BOOL("fledge", "loss-url-unexpectedly-valid",
|
||||
loss_report_url_ && loss_report_url_->is_valid());
|
||||
SCOPED_CRASH_KEY_BOOL("fledge", "win-url-unexpectedly-non-null",
|
||||
!!win_report_url_);
|
||||
SCOPED_CRASH_KEY_BOOL("fledge", "win-url-unexpectedly-valid",
|
||||
!!win_report_url_ && win_report_url_->is_valid());
|
||||
base::debug::DumpWithoutCrashing();
|
||||
}
|
||||
}
|
||||
|
||||
void ForDebuggingOnlyBindings::AttachToContext(v8::Local<v8::Context> context) {
|
||||
v8::Isolate* isolate = v8_helper_->isolate();
|
||||
@ -71,6 +90,22 @@ void ForDebuggingOnlyBindings::Reset() {
|
||||
win_report_url_ = std::nullopt;
|
||||
}
|
||||
|
||||
std::optional<GURL> ForDebuggingOnlyBindings::TakeLossReportUrl() {
|
||||
// TODO(https://crbug.com/41496188): Remove when bug has been fixed.
|
||||
if (loss_report_url_ && !loss_report_url_->is_valid()) {
|
||||
base::debug::DumpWithoutCrashing();
|
||||
}
|
||||
return std::move(loss_report_url_);
|
||||
}
|
||||
|
||||
std::optional<GURL> ForDebuggingOnlyBindings::TakeWinReportUrl() {
|
||||
// TODO(https://crbug.com/41496188): Remove when bug has been fixed.
|
||||
if (win_report_url_ && !win_report_url_->is_valid()) {
|
||||
base::debug::DumpWithoutCrashing();
|
||||
}
|
||||
return std::move(win_report_url_);
|
||||
}
|
||||
|
||||
void ForDebuggingOnlyBindings::ReportAdAuctionLoss(
|
||||
const v8::FunctionCallbackInfo<v8::Value>& args) {
|
||||
ForDebuggingOnlyBindings* bindings = static_cast<ForDebuggingOnlyBindings*>(
|
||||
|
@ -9,6 +9,7 @@
|
||||
|
||||
#include "base/functional/callback.h"
|
||||
#include "base/memory/raw_ptr.h"
|
||||
#include "content/common/content_export.h"
|
||||
#include "content/services/auction_worklet/auction_v8_helper.h"
|
||||
#include "content/services/auction_worklet/context_recycler.h"
|
||||
#include "url/gurl.h"
|
||||
@ -20,7 +21,7 @@ namespace auction_worklet {
|
||||
// used for a context managed by ContextRecycler. The URL passed to the last
|
||||
// successful call will be used as the reporting URL. Throws on invalid URLs or
|
||||
// non-HTTPS URLs.
|
||||
class ForDebuggingOnlyBindings : public Bindings {
|
||||
class CONTENT_EXPORT ForDebuggingOnlyBindings : public Bindings {
|
||||
public:
|
||||
explicit ForDebuggingOnlyBindings(AuctionV8Helper* v8_helper);
|
||||
ForDebuggingOnlyBindings(const ForDebuggingOnlyBindings&) = delete;
|
||||
@ -32,10 +33,8 @@ class ForDebuggingOnlyBindings : public Bindings {
|
||||
void AttachToContext(v8::Local<v8::Context> context) override;
|
||||
void Reset() override;
|
||||
|
||||
std::optional<GURL> TakeLossReportUrl() {
|
||||
return std::move(loss_report_url_);
|
||||
}
|
||||
std::optional<GURL> TakeWinReportUrl() { return std::move(win_report_url_); }
|
||||
std::optional<GURL> TakeLossReportUrl();
|
||||
std::optional<GURL> TakeWinReportUrl();
|
||||
|
||||
private:
|
||||
static void ReportAdAuctionLoss(
|
||||
|
Reference in New Issue
Block a user