Skip to content

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

Open

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

Activity

  1. moved this to Todo in UTBot Javaon Aug 26, 2022
  2. changed the title [-]Too many permissions file reads[/-] [+]Too many permissions file reads - can slow down much[/+] on Oct 10, 2022
  3. changed the title [-]Too many permissions file reads - can slow down much[/-] [+]Too many permissions file rereads - can slow down much[/+] on Nov 16, 2022
  4. added
    comp-sandboxingIssue is related to sandboxing unpermitted operations by Java Security Manager
    and removed
    ctg-bugIssue is a bug
    on Feb 28, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions