Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Virtualization scheme Version 2 causing extremely slow file deleting speed using del /f /s /q /A:- ::::C #3650

Closed
0x391F opened this issue Feb 26, 2024 · 8 comments
Labels
fixed in next build Fixed in the next Sandboxie version High priority To be done as soon as possible

Comments

@0x391F
Copy link
Contributor

0x391F commented Feb 26, 2024

Describe what you noticed and did

Virtualization scheme Version 2 causing extremely slow speed when using del /f /s /q /A:- ::::C to delete files (!!!Warning!!! DO NOT run it in REAL system!!! Replace ::::C with C:)

How often did you encounter it so far?

No response

Expected behavior

It should as fast as Virtualization scheme Version 1.

Affected program

cmd.exe

Download link

N/A

Where is the program located?

The program is installed only outside the sandbox.

Did the program or any related process close unexpectedly?

No, not at all.

Crash dump

No response

What version of Sandboxie are you running now?

Sandboxie v1.13.0

Is it a new installation of Sandboxie?

I just updated Sandboxie from a previous version (I don't remember which one).

Is it a regression from previous versions?

No response

In which sandbox type you have this problem?

Not relevant to my request.

Can you reproduce this problem on a new empty sandbox?

I can confirm it also on a new empty sandbox.

What is your Windows edition and version?

Windows 10 Enterprise LTSC 2021 x64 (21H2)

In which Windows account you have this problem?

An account with UAC protection set to Always notify.

Please mention any installed security software

ESET Internet Security 17.0.16.0

Did you previously enable some security policy settings outside Sandboxie?

No response

Trace log

No response

Sandboxie.ini configuration

No response

@0x391F 0x391F added the Confirmation pending Further confirmation is requested label Feb 26, 2024
@bastik-1001
Copy link
Contributor

Just for my curiosity, did you notice other performance degradation from scheme 1 to scheme 2?

@offhub
Copy link
Collaborator

offhub commented Mar 18, 2024

The problem is that the time increases exponentially as the number of files/folders processed increases.

UseFileDeleteV2=n
sbie3650-n2
sbie3650-01

UseFileDeleteV2=y
sbie3650-y2
sbie3650-00

@DavidXanatos
Copy link
Member

Yea, I'm not sure how to easily fix this, the issue is that each time something gets deleted we need to update the FilePaths.dat file.

The proper fix would be to let the service maintain a cached database but then we would need to query the service on every file operation, or alternatively keep a per process cache but use the service to maintain the FilePaths.dat file and push updates to all running processes. That would be overall slower but would have constant performance no mater how many files get deleted.

In my opinion deleting a lot of host files within the sandbox is a rare use case hence the current tradeoff overall is beneficial.

That said assuming no contention for the FilePaths.dat we could improve the update procedure to not re create the entire file from scratch, but only append entries if the file was not modified in the mean time.

@bastik-1001
Copy link
Contributor

Thank you for the explanation.

That said assuming no contention for the FilePaths.dat we could improve the update procedure to not re create the entire file from scratch, but only append entries if the file was not modified in the mean time.

While I don't know how much of a reduction this will bring, it sounds like an improvement.

@DavidXanatos
Copy link
Member

It would help a lot, and now that I think of it, we should improve also on the edge case of thousands of files on one directory, this is also not handled ideally

@DavidXanatos DavidXanatos added ToDo To be done High priority To be done as soon as possible and removed Confirmation pending Further confirmation is requested labels Mar 19, 2024
@DavidXanatos DavidXanatos added fixed in next build Fixed in the next Sandboxie version and removed ToDo To be done labels Apr 5, 2024
DavidXanatos added a commit that referenced this issue Apr 5, 2024
@bastik-1001
Copy link
Contributor

@offhub, Can you give some examples again, to show by how much it was improved?

@DavidXanatos
Copy link
Member

Not its as fast as scheme V1 the differenc is withing the error margin.

@offhub
Copy link
Collaborator

offhub commented Apr 11, 2024

Old (~319 secs)

sbie3650old

New (~24 secs)

sbie3650new

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
fixed in next build Fixed in the next Sandboxie version High priority To be done as soon as possible
Projects
None yet
Development

No branches or pull requests

4 participants