Skip to content

Too many permissions file rereads - can slow down much #796

Open
@alisevych

Description

@alisevych

Description

Currently if there is some unrecognized permission - we have 55K errors in concrete execution logs.
It shows indirectly that there are many permission read attempts. And this is only for one method test generation.
Permissions file is not expected to be changed during UTBot execution.
So it can be read only before test generation - to save time.

To Reproduce

Steps to reproduce the behavior:

  1. Open IntelliJ IDEA with installed UTBot plugin (with Security Manager turned on)
  2. Open/create a project with JDK 8/11
  3. Add the following class:
public class SecurityCheck {
    public String property(String key) {
        return System.getProperty(key);
    }
}
  1. Create or put the following text into user.home}/.utbot/sandbox.policy // here "test" is invalid
grant {
    permission java.util.PropertyPermission "*", "test";
};
  1. Generate tests for the SecurityCheck class
  2. Check Concrete executor logs

Expected behavior

Permissions file can be read once before test generation - to save time.

Actual behavior

There are about 55K errors "invalid permission: test" in concrete executor log.
This shows that UTBot is trying to read and recognize this permission many times during test execution.

Visual proofs (screenshots, logs, images)

Many errors with the following text:

java.security.policy: error adding Permission, java.util.PropertyPermission:
	java.lang.IllegalArgumentException: invalid permission: test

Environment

Windows 10 Pro
IntelliJ IDEA 2022.1 - 2022.1.4
JDK 8 / 11

Metadata

Metadata

Assignees

Labels

comp-sandboxingIssue is related to sandboxing unpermitted operations by Java Security Managerctg-enhancementNew feature, improvement or change requestspec-performancePerformance-related issue

Type

No type

Projects

Status

Todo

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions