2
0
mirror of https://git.missingno.dev/kolibrios-nvme-driver/ synced 2024-11-21 15:13:48 +01:00

File Corruption? #7

Open
opened 2024-08-14 02:19:25 +02:00 by ramenu · 5 comments
Member

I'm not sure what's going on here, but if anyone can replicate this please let me know.

So essentially, I copied everything from the /sys folder into the filesystem of the NVMe drive. Everything works, and everything loads as expected. The problem is when you shutdown and restart, the files will be there but for some reason some of the executables that worked before the shutdown now suddenly page fault.

P.S: If you're testing this, try it on a decent sized filesystem (copying everything from /sys folder into the NVMe one works well for this), check if executable loads properly before shutdown, try shutting down, do the same thing (make sure you try it with a bunch of different files), and see if a page fault happens.

I'm not sure what's going on here, but if anyone can replicate this please let me know. So essentially, I copied everything from the /sys folder into the filesystem of the NVMe drive. Everything works, and everything loads as expected. The problem is when you shutdown and restart, the files will be there but for some reason some of the executables that worked before the shutdown now suddenly page fault. P.S: If you're testing this, try it on a decent sized filesystem (copying everything from /sys folder into the NVMe one works well for this), check if executable loads properly before shutdown, try shutting down, do the same thing (make sure you try it with a bunch of different files), and see if a page fault happens.
Author
Member

Ok, there's definitely something weird going on. This has happened on more than one occasion. Both on QEMU and Virtualbox, however it's random.

I don't know why exactly this happens, especially since the files are completely okay before restart. But I'll have to investigate later.

Ok, there's definitely something weird going on. This has happened on more than one occasion. Both on QEMU and Virtualbox, however it's random. I don't know why exactly this happens, especially since the files are completely okay before restart. But I'll have to investigate later.
ramenu self-assigned this 2024-08-26 18:15:34 +02:00
Author
Member

It seems like this issue always occurs for files between 4KiB and 8Kib. Files below and above that seem to be fine. So it's possible this has to do a bug with allocating a PRP entry for PRP2.

It seems like this issue always occurs for files between 4KiB and 8Kib. Files below and above that seem to be fine. So it's possible this has to do a bug with allocating a PRP entry for PRP2.
Author
Member

Aha! So it looks like if you pass a page-aligned buffer then PRP2 allocates successfully and no problems occur. However, if a unaligned buffer is used, then it doesn't. So there's a problem with PRP list allocation with unaligned buffers, it seems.

Aha! So it looks like if you pass a page-aligned buffer then PRP2 allocates successfully and no problems occur. However, if a unaligned buffer is used, then it doesn't. So there's a problem with PRP list allocation with unaligned buffers, it seems.
Author
Member

Mostly fixed in 3d95901b65 but there's still a few files causing problems.

Mostly fixed in https://git.kolibrios.org/GSoC/kolibrios-nvme-driver/commit/3d95901b653c57571600a8fa263c4dbf840afce5 but there's still a few files causing problems.

Okay, I think I got reproduction of this.
Latest commit (I suppose), VirtualBox, loading driver by hands from ISO.
Yesterday I saved two files with FASM code on NVME drive, and today they both are cut to the 30 lines and have encoding problems.
While compiled executables are totally okay and can be run.

UPD. Looks like this square symbols at the and of file are exactly corrupted code, that got displayed as broken encoding for some reason.

UPD. I have two corrupted code files and size of each is shown as 4 KB, so I suppose, it corrupts part larger then 1 disk sector?

Okay, I think I got reproduction of this. Latest commit (I suppose), VirtualBox, loading driver by hands from ISO. Yesterday I saved two files with FASM code on NVME drive, and today they both are cut to the 30 lines and have encoding problems. While compiled executables are totally okay and can be run. UPD. Looks like this square symbols at the and of file are exactly corrupted code, that got displayed as broken encoding for some reason. UPD. I have two corrupted code files and size of each is shown as 4 KB, so I suppose, it corrupts part larger then 1 disk sector?
Sign in to join this conversation.
No Label
No Milestone
No Assignees
2 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: GSoC/kolibrios-nvme-driver#7
No description provided.