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

Crash in brave_rewards::RunDBTransactionOnFileTaskRunner #15779

Closed
iefremov opened this issue May 12, 2021 · 1 comment · Fixed by brave/brave-core#13509
Closed

Crash in brave_rewards::RunDBTransactionOnFileTaskRunner #15779

iefremov opened this issue May 12, 2021 · 1 comment · Fixed by brave/brave-core#13509
Assignees
Labels
closed/stale Issue is no longer relevant, perhaps because the feature it refers to has been deprecated. crash feature/rewards OS/Android Fixes related to Android browser functionality OS/Desktop priority/P2 A bad problem. We might uplift this to the next planned release.

Comments

@iefremov
Copy link
Contributor

it seems the posted task still can observe bad ledger_database_ in RunDBTransactionOnFileTaskRunner

happens in 90.1.24.76 that already has recent threading fixes

cc @emerick @zenparsing @bridiver

https://brave.sp.backtrace.io/p/brave/debug?filters=(_deleted%3D0%2C(callstack.functions%2Ccontains%2CLedgerDatabase))&debug=(%22104302c%22,0,0)

[ 00 ] 0x7f8179308344
[ 01 ] readDbPage
[ 02 ] getPageNormal
[ 03 ] getPageMMap
[ 04 ] getAndInitPage
[ 05 ] moveToRoot
[ 06 ] sqlite3BtreeMovetoUnpacked
[ 07 ] sqlite3VdbeExec
[ 08 ] chrome_sqlite3_step
[ 09 ] sql::Statement::StepInternal()
[ 10 ] ledger::LedgerDatabaseImpl::RunTransaction(mojo::StructPtr<ledger::mojom::DBTransaction>, ledger::mojom::DBCommandResponse*)
[ 11 ] brave_rewards::RunDBTransactionOnFileTaskRunner(mojo::StructPtr<ledger::mojom::DBTransaction>, ledger::LedgerDatabase*)
[ 12 ] base::internal::Invoker<base::internal::BindState<mojo::StructPtr<ads_database::mojom::DBCommandResponse> (*)(mojo::StructPtr<ads_database::mojom::DBTransaction>, ads::Database*), mojo::StructPtr<ads_database::mojom::DBTransaction>, ads::Database*>, mojo::StructPtr<ads_database::mojom::DBCommandResponse> ()>::RunOnce(base::internal::BindStateBase*)
[ 13 ] void base::internal::ReturnAsParamAdapter<mojo::StructPtr<ads_database::mojom::DBCommandResponse> >(base::OnceCallback<mojo::StructPtr<ads_database::mojom::DBCommandResponse> ()>, std::__1::unique_ptr<mojo::StructPtr<ads_database::mojom::DBCommandResponse>, std::__1::default_delete<mojo::StructPtr<ads_database::mojom::DBCommandResponse> > >*)
[ 14 ] base::internal::Invoker<base::internal::BindState<void (*)(base::OnceCallback<bool ()>, std::__1::unique_ptr<bool, std::__1::default_delete<bool> >*), base::OnceCallback<bool ()>, std::__1::unique_ptr<bool, std::__1::default_delete<bool> >*>, void ()>::RunOnce(base::internal::BindStateBase*)
[ 15 ] base::(anonymous namespace)::PostTaskAndReplyRelay::RunTaskAndPostReply(base::(anonymous namespace)::PostTaskAndReplyRelay)

@iefremov iefremov added crash priority/P2 A bad problem. We might uplift this to the next planned release. OS/Android Fixes related to Android browser functionality OS/Desktop feature/rewards labels May 12, 2021
@iefremov iefremov changed the title Crash in RewardsServiceImpl Crash in RewardsServiceImpl::RunDBTransactionOnFileTaskRunner May 12, 2021
@iefremov iefremov changed the title Crash in RewardsServiceImpl::RunDBTransactionOnFileTaskRunner Crash in RunDBTransactionOnFileTaskRunner May 12, 2021
@iefremov iefremov changed the title Crash in RunDBTransactionOnFileTaskRunner Crash in brave_rewards::RunDBTransactionOnFileTaskRunner May 12, 2021
@zenparsing
Copy link

The ledger_database_ pointer is generally deleted with DeleteSoon, except for one case here. I'm not sure if the crash is arising from this line or not, but one solution would be to use base::OnTaskRunnerDeleter to ensure that the pointer is always deleted on the "file task runner", instead of calling DeleteSoon explicitly. @iefremov @bridiver, would that be a good path forward, or is there another approach that we should take?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
closed/stale Issue is no longer relevant, perhaps because the feature it refers to has been deprecated. crash feature/rewards OS/Android Fixes related to Android browser functionality OS/Desktop priority/P2 A bad problem. We might uplift this to the next planned release.
Projects
None yet
3 participants