Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow FetchBalance to return an empty ledger::BalancePtr #6251

Merged
merged 1 commit into from
Jul 29, 2020

Conversation

zenparsing
Copy link
Collaborator

@zenparsing zenparsing commented Jul 29, 2020

Resolves brave/brave-browser#10983

Submitter Checklist:

Test Plan:

  • Start browser with a clean profile.
  • Enable rewards.
  • Quit browser.
  • Open Preferences file and edit the following values:
    • Set "payment_id" to an empty string "".
    • Set "fetch_old_balance" to true.
  • Start browser and open rewards panel.
    • Verify that browser does not crash.

Reviewer Checklist:

  • New files have MPL-2.0 license header.
  • Request a security/privacy review as needed.
  • Adequate test coverage exists to prevent regressions
  • Verify test plan is specified in PR before merging to source

After-merge Checklist:

  • The associated issue milestone is set to the smallest version that the
    changes has landed on.
  • All relevant documentation has been updated.

@zenparsing zenparsing added this to the 1.14.x - Nightly milestone Jul 29, 2020
@zenparsing zenparsing requested a review from NejcZdovc as a code owner July 29, 2020 16:02
@zenparsing zenparsing self-assigned this Jul 29, 2020
@zenparsing zenparsing requested a review from emerick July 29, 2020 18:33
Copy link
Contributor

@emerick emerick left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@zenparsing
Copy link
Collaborator Author

CI failed on unrelated Linux:NotVerifiedWallet

@zenparsing zenparsing merged commit a06d79b into master Jul 29, 2020
@zenparsing zenparsing deleted the ksmith-balance-mojom-bug branch July 29, 2020 21:08
brave-builds pushed a commit that referenced this pull request Jul 30, 2020
@kjozwiak
Copy link
Member

kjozwiak commented Aug 5, 2020

Reproduced the issue on macOS 10.10.6 x64 using the following build:

Brave 1.14.2 Chromium: 84.0.4147.105 (Official Build) nightly (64-bit)
Revision a6b12dfad6663f13a7e16e9a42a6a4975374096b-refs/branch-heads/4147@{#943}
OS macOS Version 10.15.6 (Build 19G73)

Used the STR outlined via #6251 (comment) and crashed rewards as per:

https://brave.sp.backtrace.io/p/brave/debug?filters=(_rxid%3D%226f290000-45d5-d704-0000-000000000000%22)&fingerprint=0000000000000000000000000000000000000000000000000000000000000141&debug=(%2250e00%22,0,0)

[ 00 ] crash_reporter::DumpWithoutCrashing()
[ 01 ] base::debug::DumpWithoutCrashing()
[ 02 ] content::BrowserChildProcessHostImpl::OnMojoError(base::WeakPtr<content::BrowserChildProcessHostImpl>, scoped_refptr<base::SingleThreadTaskRunner>, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&)
[ 03 ] base::internal::Invoker<base::internal::BindState<void (*)(base::WeakPtr<content::BrowserChildProcessHostImpl>, scoped_refptr<base::SingleThreadTaskRunner>, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&), base::WeakPtr<content::BrowserChildProcessHostImpl>, scoped_refptr<base::SingleThreadTaskRunner> >, void (std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&)>::Run(base::internal::BindStateBase*, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&)
[ 04 ] mojo::(anonymous namespace)::RunErrorCallback(unsigned long, MojoProcessErrorDetails const*)
[ 05 ] mojo::core::(anonymous namespace)::RunMojoProcessErrorHandler(mojo::core::(anonymous namespace)::ProcessDisconnectHandler*, void (*)(unsigned long, MojoProcessErrorDetails const*), unsigned long, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&)
[ 06 ] mojo::core::NodeChannel::NotifyBadMessage(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&)
[ 07 ] mojo::core::NodeController::NotifyBadMessageFrom(mojo::core::ports::NodeName const&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&)
[ 08 ] mojo::core::Core::NotifyBadMessage(unsigned long, char const*, unsigned long, MojoNotifyBadMessageOptions const*)
[ 09 ] mojo::internal::ReportValidationError(mojo::internal::ValidationContext*, mojo::internal::ValidationError, char const*)
[ 10 ] <name omitted>
[ 11 ] bat_ledger::mojom::internal::BatLedger_FetchBalance_ResponseParams_Data::Validate(void const*, mojo::internal::ValidationContext*)
[ 12 ] mojo::internal::ValidateResponseGeneric(mojo::Message*, char const*, base::span<std::__1::pair<unsigned int, mojo::internal::GenericValidationInfo> const, 18446744073709551615ul>)
[ 13 ] mojo::MessageDispatcher::Accept(mojo::Message*)
[ 14 ] mojo::internal::MultiplexRouter::ProcessIncomingMessage(mojo::internal::MultiplexRouter::MessageWrapper*, mojo::internal::MultiplexRouter::ClientCallBehavior, base::SequencedTaskRunner*)
[ 15 ] mojo::internal::MultiplexRouter::Accept(mojo::Message*)
[ 16 ] mojo::Connector::DispatchMessage(mojo::Message)
[ 17 ] mojo::Connector::ReadAllAvailableMessages()
[ 18 ] base::TaskAnnotator::RunTask(char const*, base::PendingTask*)
[ 19 ] base::sequence_manager::internal::ThreadControllerWithMessagePumpImpl::DoWorkImpl(base::sequence_manager::LazyNow*)
[ 20 ] base::sequence_manager::internal::ThreadControllerWithMessagePumpImpl::DoWork()
[ 21 ] invocation function for block in base::MessagePumpCFRunLoopBase::RunWorkSource(void*)
[ 22 ] base::mac::CallWithEHFrame(void () block_pointer)
[ 23 ] base::MessagePumpCFRunLoopBase::RunWorkSource(void*)
[ 24 ] 0x7fff36334d52
[ 25 ] 0x7fff36334cf1
[ 26 ] 0x7fff36334b0b
[ 27 ] 0x7fff3633383a
[ 28 ] 0x7fff36332e3e
[ 29 ] RunCurrentEventLoopInMode
[ 30 ] ReceiveNextEventCommon
[ 31 ] _BlockUntilNextEventMatchingListInModeWithFilter
[ 32 ] _DPSNextEvent
[ 33 ] -[NSApplication(NSEvent) _nextEventMatchingEventMask:untilDate:inMode:dequeue:]
[ 34 ] __71-[BrowserCrApplication nextEventMatchingMask:untilDate:inMode:dequeue:]_block_invoke
[ 35 ] base::mac::CallWithEHFrame(void () block_pointer)
[ 36 ] -[BrowserCrApplication nextEventMatchingMask:untilDate:inMode:dequeue:]
[ 37 ] -[NSApplication run]
[ 38 ] base::MessagePumpNSApplication::DoRun(base::MessagePump::Delegate*)
[ 39 ] base::MessagePumpCFRunLoopBase::Run(base::MessagePump::Delegate*)
[ 40 ] base::sequence_manager::internal::ThreadControllerWithMessagePumpImpl::Run(bool, base::TimeDelta)
[ 41 ] base::RunLoop::Run()
[ 42 ] ChromeBrowserMainParts::MainMessageLoopRun(int*)
[ 43 ] content::BrowserMainLoop::RunMainMessageLoopParts()
[ 44 ] content::BrowserMainRunnerImpl::Run()
[ 45 ] content::BrowserMain(content::MainFunctionParams const&)
[ 46 ] content::ContentMainRunnerImpl::RunServiceManager(content::MainFunctionParams&, bool)
[ 47 ] content::ContentMainRunnerImpl::Run(bool)
[ 48 ] service_manager::Main(service_manager::MainParams const&)
[ 49 ] content::ContentMain(content::ContentMainParams const&)
[ 50 ] ChromeMain
[ 51 ] main
[ 52 ] start

Verification PASSED on macOS 10.15.5 x64 using the following build:

Brave | 1.14.18 Chromium: 84.0.4147.105 (Official Build) nightly (64-bit)
-- | --
Revision | a6b12dfad6663f13a7e16e9a42a6a4975374096b-refs/branch-heads/4147@{#943}
OS | macOS Version 10.15.6 (Build 19G73)

Ensured that the above crash wasn't occurring when following the STR/Cases outlined via #6251 (comment).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Desktop] Crash for balance call
4 participants