Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(96)

Unified Diff: mojo/edk/system/ports/node.cc

Issue 2514553002: Mojo EDK: Work around Nexus 9 hardware bug (Closed)
Patch Set: . Created 4 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « mojo/edk/system/message_pipe_unittest.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: mojo/edk/system/ports/node.cc
diff --git a/mojo/edk/system/ports/node.cc b/mojo/edk/system/ports/node.cc
index 186e8aaad95795f6f608555a0d7c16d17a73db40..daebb5bb610b5ca65fc4572af54a9e2a4d82c464 100644
--- a/mojo/edk/system/ports/node.cc
+++ b/mojo/edk/system/ports/node.cc
@@ -626,8 +626,8 @@ int Node::OnObserveProxyAck(const PortName& port_name,
int Node::OnObserveClosure(const PortName& port_name,
uint64_t last_sequence_num) {
// OK if the port doesn't exist, as it may have been closed already.
- scoped_refptr<Port> port = GetPort(port_name);
- if (!port)
+ scoped_refptr<Port> closed_port = GetPort(port_name);
+ if (!closed_port)
return OK;
// This message tells the port that it should no longer expect more messages
@@ -639,6 +639,12 @@ int Node::OnObserveClosure(const PortName& port_name,
ObserveClosureEventData forwarded_data;
NodeName peer_node_name;
PortName peer_port_name;
+
+ // NOTE: This redundant copy of the scoped_refptr is here as a workaround for
+ // https://crbug.com/665869. Without it a code sequence is generated which
+ // under certain conditions can tickle a Tegra K1 erratum, causing the lock
+ // acquisition below to segfault.
+ scoped_refptr<Port> port = closed_port;
Torne 2016/11/18 11:59:56 Doing this here isn't sufficient - there are also
bool try_remove_proxy = false;
{
base::AutoLock lock(port->lock);
« no previous file with comments | « mojo/edk/system/message_pipe_unittest.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698