maharmstone / ntfs2btrfs

GNU General Public License v2.0
678 stars 29 forks source link

Segmentation fault during inode creation #39

Open topongo opened 2 years ago

topongo commented 2 years ago

The program doesn't start: it notifies me about the algorithms it's gonna use and then crashes instantly. I'm using a gpt partition table on a nvme drive if it can help. I even tried with another partition on the same disk and it works. The not converting partition maybe isn't absolutely vanilla ntfs: if I remember well I created it with mkfs.ntfs and not with the windows utility. I'll try later converting the partition using the tool from windows, but sincerely I doubt it will change anything.

After doing some very simple debugging I discovered that probably there's some problem during a memcmp in the function string_view ntfs::find_sd(uint32_t id, ntfs_file& secure) (at this line)

topongo commented 2 years ago

I'll try later converting the partition using the tool from windows, but sincerely I doubt it will change anything.

No success, after executing ntfs2btrfs.exe -h sha256 F:\ I get this error: ReadFile failed (error 87, The parameter is incorrect.)

maharmstone commented 2 years ago

Could you please paste the output from fsutil fsinfo ntfsinfo and fsutil fsinfo sectorinfo for the partition?

topongo commented 2 years ago

Could you please paste the output from fsutil fsinfo ntfsinfo

NTFS Volume Serial Number :        0x0db5b26d1780c395
NTFS Version      :                3.1
LFS Version       :                2.0
Total Sectors     :                34,462,975  (131.5 GB)
Total Clusters    :                34,462,975  (131.5 GB)
Free Clusters     :                10,908,617  ( 41.6 GB)
Total Reserved Clusters :               1,024  (  4.0 MB)
Reserved For Storage Reserve :              0  (  0.0 KB)
Bytes Per Sector  :                4096
Bytes Per Physical Sector :        4096
Bytes Per Cluster :                4096  (4 KB)
Bytes Per FileRecord Segment    :  4096
Clusters Per FileRecord Segment :  1
Mft Valid Data Length :            1.70 GB
Mft Start Lcn  :                   0x0000000000000004
Mft2 Start Lcn :                   0x0000000001164fff
Mft Zone Start :                   0x000000000043ece0
Mft Zone End   :                   0x000000000044b500
MFT Zone Size  :                   200.13 MB
Max Device Trim Extent Count :     256
Max Device Trim Byte Count :       0xffffffff
Max Volume Trim Extent Count :     62
Max Volume Trim Byte Count :       0x40000000
Resource Manager Identifier :      173667F3-2882-11EB-924E-806E6F6E6963

and fsutil fsinfo sectorinfo for the partition?

LogicalBytesPerSector :                                 4096
PhysicalBytesPerSectorForAtomicity :                    4096
PhysicalBytesPerSectorForPerformance :                  4096
FileSystemEffectivePhysicalBytesPerSectorForAtomicity : 4096
Device Alignment :                                      Aligned (0x000)
Partition alignment on device :                         Aligned (0x000)
No Seek Penalty
Trim Supported
Not DAX capable
Not Thinly-Provisioned
topongo commented 2 years ago

I think this line is the problem:

unsigned int sector_size = 512; // FIXME - find from device

I'll let you know if it is the actual cause.

topongo commented 2 years ago

I think this line is the problem:

unsigned int sector_size = 512; // FIXME - find from device

I'll let you know if it is the actual cause.

Sadly it wasn't, or at least it wasn't the only one.

topongo commented 2 years ago

Any new clues on what the cause might be?

Radiicall commented 1 year ago

I have 2 NTFS partitions on a drive, one is 558.8GB, other one is is 372.7GB.

The program works on the 370\~gb partition but it didnt on the 560\~GB partition, the 560~GB partition had a dirty bit that i changed manually with ntfsfix -d.

Running this in ntfs2btrfs results in a Segmentation fault on inodes. I dont know if this is related because i did unset a dirty bit but im posting this here anyways.