brave / brave-browser

Brave browser for Android, iOS, Linux, macOS, Windows.
https://brave.com
Mozilla Public License 2.0
17.58k stars 2.28k forks source link

Crash at HistorySyncMetadataDatabase::UpdateModelTypeState #34138

Open AlexeyBarabash opened 10 months ago

AlexeyBarabash commented 10 months ago

Found by @SergeyZhukovsky at GP dev console

Stack Trace:
  RELADDR   FUNCTION                                                                          FILE:LINE
  0000000005527160  sqlite3VdbeExec                                                                   ../../third_party/sqlite/src/amalgamation/sqlite3.c:94286:25
  v------>  sqlite3Step                                                                       ../../third_party/sqlite/src/amalgamation/sqlite3.c:88974:10
  0000000005509e08  chrome_sqlite3_step                                                               ../../third_party/sqlite/src/amalgamation/sqlite3.c:89035:16
  0000000005503a80  sql::Statement::StepInternal()                                                    ../../sql/statement.cc:78:48
  0000000005503afc  sql::Statement::Run()                                                             ../../sql/statement.cc:90:10
  00000000054fec10  sql::MetaTable::SetValue(std::__Cr::basic_string_view<char, std::__Cr::char_traits<char>>, std::__Cr::basic_string<char, std::__Cr::char_traits<char>, std::__Cr::allocator<char>> const&)  ../../sql/meta_table.cc:198:17
  0000000005c14010  history::HistorySyncMetadataDatabase::UpdateModelTypeState(syncer::ModelType, sync_pb::ModelTypeState const&)  ../../components/history/core/browser/sync/history_sync_metadata_database.cc:117:23
  0000000005cc4c54  syncer::SyncMetadataStoreChangeList::UpdateModelTypeState(sync_pb::ModelTypeState const&)  ../../components/sync/model/sync_metadata_store_change_list.cc:33:16
  0000000005cbceb8  syncer::ClientTagBasedRemoteUpdateHandler::ProcessIncrementalUpdate(sync_pb::ModelTypeState const&, std::__Cr::vector<syncer::UpdateResponseData, std::__Cr::allocator<syncer::UpdateResponseData>>)  ../../components/sync/model/client_tag_based_remote_update_handler.cc:39:21
  v------>  syncer::ClientTagBasedModelTypeProcessor::OnIncrementalUpdateReceived(sync_pb::ModelTypeState const&, std::__Cr::vector<syncer::UpdateResponseData, std::__Cr::allocator<syncer::UpdateResponseData>>)  ../../components/sync/model/client_tag_based_model_type_processor.cc:1047:26

Probably it's related to a new History datatype.

Full stack is attached. Untitled.txt

AlexeyBarabash commented 10 months ago

It's hard to say what caused the crash. It happened inside of sqlite code

        while( 1 /*exit-by-break*/ ){
          zPayload[--i] = (u8)(v&0xFF);
          if( i==0 ) break;
          v >>= 8;
        }

So marking needs-more-info, maybe we'll get some more useful information or STR.