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

fix nil fileEntry #537

Closed
wants to merge 3 commits into from
Closed

fix nil fileEntry #537

wants to merge 3 commits into from

Conversation

liver
Copy link

@liver liver commented Oct 21, 2024

on Create, after addNewChild fe(fileEntry) is nil value

on Create, after addNewChild fe(fileEntry) is nil value
@liver liver changed the title fix bridge.go fix nil fileEntry Oct 23, 2024
@hanwen
Copy link
Owner

hanwen commented Oct 26, 2024

needs a test that repros the problem.

@liver
Copy link
Author

liver commented Oct 26, 2024

accessing a property of an object that does not exist.
For NodeWriter interface, in the case of FileHandle is nil.

@hanwen
Copy link
Owner

hanwen commented Oct 26, 2024

needs a test that demonstrates the crash.

go test -run ^TestRawBridgeCreateNilFileEntry$ -v
Problem area - comment if
@hanwen
Copy link
Owner

hanwen commented Oct 27, 2024

Your test should create a file system, mount it, and then trigger the crash. I suspect that creating a file in an FS that doesn't use file handles might do the trick.

Test change of pool reguest
@liver
Copy link
Author

liver commented Oct 27, 2024

Changed the test.
It seems to me that in this case, the test is superfluous.
I have not changed or added any functionality or logic.
Added a check for the existence of an object before accessing its property.

@hanwen
Copy link
Owner

hanwen commented Oct 28, 2024

why are you proposing this fix then?

@liver
Copy link
Author

liver commented Oct 28, 2024

because I get an error in the latest version

@liver
Copy link
Author

liver commented Oct 31, 2024

fix nil pointer dereference
check for existence of object

@liver
Copy link
Author

liver commented Nov 14, 2024

Is there any chance of correction?

if fe != nil {
    out.Fh = uint64(fe.fh)
}

@hanwen
Copy link
Owner

hanwen commented Nov 15, 2024

I am still waiting for a test that demonstrates a crash in a filesystem without this fix. If you have a FS that doesn't work, it should be straightforward to distill that into a test.

hanwen added a commit that referenced this pull request Nov 15, 2024
Addresses #537

Change-Id: I832d93efbf993d63f9163d1ca7bf07b4602bda56
@hanwen
Copy link
Owner

hanwen commented Nov 15, 2024

@hanwen hanwen closed this Nov 15, 2024
@hanwen
Copy link
Owner

hanwen commented Nov 15, 2024

release tagged as v2.6.4

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

Successfully merging this pull request may close these issues.

2 participants