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

Unzipping and renaming 3 times results in a file length of 0 #513

Open
xuyouqiao2005 opened this issue Jun 29, 2023 · 1 comment
Open

Unzipping and renaming 3 times results in a file length of 0 #513

xuyouqiao2005 opened this issue Jun 29, 2023 · 1 comment

Comments

@xuyouqiao2005
Copy link

Bug Report

Unzipping and renaming 3 times results in a file length of 0

How to Reproduce

srcFile: xxx.7z
unzipping it, we can got tree:
xxx/
├─1.txt
├─2.txt
├─3.txt

1.txt/2.txt/3.txt is not empty
3

start memfs cmd: -i -n 1024 -m P: -s 848297984 -t 10000 -f
step1: copy xxx.7z to P:\xxx.7z
step2: using 7z to unzipping it to xxx/

step3: rename xxx/ to xxx1/
step4: using 7z to unzipping it to xxx/

step5: rename xxx/ to xxx2/
step6: using 7z to unzipping it to xxx/

use cmd: ls
got:

Mode LastWriteTime Length Name


-a---- 2023/6/29 10:10 0 1.txt
-a---- 2023/6/29 10:10 0 2.txt
-a---- 2023/6/29 9:57 9 3.txt

Behaviors

we find 1.txt/2.txt is changed to 0 bytes
if you repeat step3/step4 again, you counld find other errors, such as cannot not access xxx2/. two xxx/ directorys
2
1

Environment

  • OS version and build: 10.0.19045
  • WinFsp version and build: 20230529T013725Z
@xuyouqiao2005
Copy link
Author

i dont sure that problem is caused in function FspFsvolCreateComplete, you may changed the FileDesc fileNode. if xxx/ directory has more files, such steps resule memfs wild pointer crash.

    ....
    if (FileNode != OpenedFileNode)
    {
        FspFileNodeDereference(FileNode);
        FileDesc->FileNode = FileNode = OpenedFileNode;
    }
    ...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

1 participant