New issue
Advanced search Search tips
Note: Color blocks (like or ) mean that a user may not be available. Tooltip shows the reason.

Issue 600864 link

Starred by 1 user

Issue metadata

Status: Fixed
Owner:
Last visit > 30 days ago
Closed: Apr 2016
Components:
EstimatedDays: ----
NextAction: ----
OS: All
Pri: 1
Type: Bug



Sign in to add a comment

Bug in QuicServerInfoMap iteration

Project Member Reported by xunji...@chromium.org, Apr 5 2016

Issue description

quic_stream_factory.cc Line 1715

  for (const auto& key_value :
       http_server_properties_->quic_server_info_map()) {
    const QuicServerId& server_id = key_value.first;
    server_info.reset(quic_server_info_factory_->GetForServer(server_id));
    if (server_info->WaitForDataReady(callback) == OK) {
      DVLOG(1) << "Initialized server config for: " << server_id.ToString();
      InitializeCachedStateInCryptoConfig(server_id, server_info, nullptr);
    }
  }


This loop will run thousands of iterations because of base::MRUCache doesn't support auto syntax.

Please use QuicServerInfoMap::const_reverse_iterator to iterate the map.
 
Awesome (my hunch was right). Will fix right.
I meant right away.
Cc: b...@chromium.org thakis@chromium.org
This could be a problem for other MRU Caches in HttpServerProperties*.* code which use auto syntax on Android (??).
Cc: -b...@chromium.org -thakis@chromium.org
MRUCache supports auto syntax. 

There is a bug in my code. While traversing the MRUCache, we call WaitForDataReady which touches the MRUCache.
Ah, I see. That makes sense. Thanks, Raman!
Project Member

Comment 6 by bugdroid1@chromium.org, Apr 6 2016

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

commit ee679d531c757121a83ee0f919b7af9a30e86ee7
Author: rtenneti <rtenneti@chromium.org>
Date: Wed Apr 06 17:01:13 2016

QUIC - Android - Fix the bug in QuicServerInfoMap iteration when server
configs are loaded from properties file. Iteration can go into an
infinite loop if there is more than one entry. During iteration, Get()
method of MRUCache was being called which would modify the map that is
being iterated.

BUG= 600864 
R=rch@chromium.org

Review URL: https://codereview.chromium.org/1866613002

Cr-Commit-Position: refs/heads/master@{#385484}

[modify] https://crrev.com/ee679d531c757121a83ee0f919b7af9a30e86ee7/net/quic/quic_stream_factory.cc
[modify] https://crrev.com/ee679d531c757121a83ee0f919b7af9a30e86ee7/net/quic/quic_stream_factory_test.cc

Status: Fixed (was: Assigned)

Sign in to add a comment