-
Notifications
You must be signed in to change notification settings - Fork 117
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
add more test file creation #256
Conversation
I realized a little bit later that I can seed the random number generator so there can be a deterministic test case. I will update the code. |
So when writing a 1GB file you get a segfault, but only on the 3rd one? Does this occur with any fat32 filesystem? Or only in a disk with 2 partitions? If your test case can highlight the issue, then hopefully we can resolve it. Post here when you have the test complete, we can run it and then get it fixed. |
Something weird about the go proxy. Leave it for an hour and we can rerun tests. |
@deitch , Thank you for your quick replies and willingness to work with on this.
My limited (but expanding) knowledge of the FAT file system make me suspect that a directory entry is getting overwritten somehow. In the test code if you remove lines 30 and 31, so that only a single Gig file is made, the error changes from:
to
|
@mrbojangles3 is that the error you were seeing before? In other words, does this test case now faithfully reproduce your issue? |
Why are you getting lint errors on unchanged files? That is really strange. Yeah, I just ran it locally, same version as in there v1.59.0. Maybe go version, it is sensitive to 1.23 vs 1.22? I will try locally. |
@deitch yes, it should match the go version too |
Yeah, that is it. Sigh. I will fix them. |
To the best of my understanding, this reproduces my test case. On my system I actually see a a segfault. The path related errors are the same. my "/b" directory is unable to be found, when I call open on a file that will be a 1G file. |
Oh, that linting is a pain. They include gosec, which has this aggressive G115, which complains about all of the integer overflow conversions, which are necessary. |
That was harder than I wanted, but if you rebase, you should get past lint stuff |
Do you mind squashing the commits do and cleaning up the base, so it is rebased on master, a clean single commit, rather than the merge commit? |
go proxy misbehaving again. |
170c3e5
to
50c1780
Compare
apologies, I think I squashed one commit too many. Since I have your lint changes in. |
f8a6d62
to
1c5247c
Compare
Okay, I think this is what you wanted. |
Yeah that looks right. Let's let CI run, and hope the go proxy issues have been resolved, but that's not us. |
So now I don't get it. You added a test that should fail, and the tests all pass? |
Apologies for being unclear. I modified the test code in fat32/testdata/fat32.go to show how I and perhaps the commenter in #109 were seeing issues with file creation, there was a request for example code. Perhaps I should have added this as a gist? |
I am confused. #109 said that there is a failure when writing certain files, and I think you had said the same thing. Isn't the test you added to trigger that failure? Such that the tests will fail, and then we can fix it such that the tests will pass? |
My takeaway from #109 was that an error occurred in file writing at around 50 files. I was seeing something similar in my usage of go-diskfs. Does the code I submitted run without issue for you? |
Yeah, it does. Look at the CI right here. No problems. If you have an issue, it would be great to get a reproduction into the tests. |
Closing to add test case in future PR |
I am using this project (its great!) I am seeing an issue when I am creating a bootable disk with two partitions. the first partition is a "normal" efi partition that boots and works well. The second partition is a fat32 filesystem that hold all sorts of files and folders. some of the files are 1 GiB in size. When I am writing to my second partition I see a segfault at the 3rd 1 GiB file. The others seem to do okay.
This is a PR that will create a tree on a partition and exposes the same error message that I was seeing on my system. The annoying thing is, I have to have the random-sized file creation turned on. to see my issue, so I don't have a simple test case. I saw that you called for a test program in #109 . This is hopefully that program. Happy to discuss further. Again, thank you for this project.