Special handling for Thread.start
in CG construction does not work when fields are involved
#235
Labels
Thread.start
in CG construction does not work when fields are involved
#235
The Problem
Currently (even with #229 in place), OPAL will not detect the call to
run
for the following example. I want to point out that i'm not trying to construct unnecessarily complex artificial examples here, this is an actual issue that prevents me from analyzing DGMF, specifically this line 😄The reason for this is twofold:
TypeIterator.foreachAllocation
does not consider field reads (neitherGetField
norGetStatic
) as valid allocations.ThreadRelatedCallsAnalysis.handleThreadInit
only processes a thread definition site if it is a direct definition, meaning a constructor invocation. It does not attempt to find possible definition sites for an object when it is retrieved from within a field.What i thought the solution could be
Honestly, i'm a little unsure as to how a proper solution for this would look like. In a perfect world, i would:
ThreadRelatedCallsAnalysis.handleThreadInit
for each of those actual definition sitesWhat i've done so far: I implemented a simple solution that solves the example above. It only looks for field write accesse inside the current method, and recursively invokes
handleThreadInit
on all definition sites. The issue for me is that in order to analyze possible definition sites in other methods, i need to obtain their TACAI results, and i (think i) would need to obtain theirtypeIteratorState
as well - i'm not sure if and how that works. My current solution looks something like this (insideThreadRelatedCallsAnalysis.handleThreadInit
, plus minor fixes forTypeIterator.foreachAllocation
:Questions
DeclaredFieldsKey
andFieldAccessInformationkey
to the required project information, would this be a performance issue? Is the trade-off worth it?The text was updated successfully, but these errors were encountered: