Skip to content

Broken code in AbstractHost (develop branch) #2279

Description

@marcus-h

It seems that the AbstractHost class got broken in commit
6216f5c ("Allow concurrent handling of tags").
For instance, calling the public AbstractHost.removeTag(...) method raises the
following exception:

java.lang.RuntimeException: Unsupported; this is a bad idea concurrently
    at soot.util.ConcurrentList.remove(ConcurrentList.java:91)
    at soot.tagkit.AbstractHost.removeTag(AbstractHost.java:64)
    ...

We could probably "fix" element removal by using mTagList.iterator()
(instead of using loops that depend on mTagList.size()).

But to be honest, I do not really understand the commit at all: for instance,
if two different threads call AbstractHost.addTag(...) on the same instance,
both threads could execute the

    if (mTagList == null) {
      mTagList = new ConcurrentList<Tag>();

codepath. Is this the intended behavior?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions