Commit 14052ade authored by Vladimir Marko's avatar Vladimir Marko Committed by Mathieu Chartier
Browse files

Fix race in artInvokeInterfaceTrampoline().

When artInvokeInterfaceTrampoline() didn't get a resolved
interface method, it was calling FindMethodFromCode<>()
where the interface method was resolved and then a virtual
method for it was looked up. It then tried to retrieve the
interface method from the DexCache where it would usualy be
found as it was just stored there by the method resolution.
However, another thread could have just evicted that entry.

Instead of adding another call to LookupResolvedMethod(),
use the fact that artInvokeInterfaceTrampoline() already
explicitly inlines all the FindMethodFromCode<>() except
for the interface method resolution, so we can simply do
the resolution and then take the existing path for the rest
of the work.

Test: m test-art-host-gtest
Test: testrunner.py --host
Bug: 30627598

(cherry picked from commit 302f69cf)

Change-Id: Ibdf254ae26cc3191d41a5021ae832288bf847ef4
parent bf8561d5
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment