Strange Issue with Copied Files

All your general support questions for OpenZFS on OS X.

Strange Issue with Copied Files

Postby Haravikk » Mon Jan 17, 2022 1:38 pm

So I'm setting up a new ZFS dataset and I've run into a weird issue where I'm not sure if the problem is with ZFS or not, as it seems to only affect certain files that I've copied.

The files in question work perfectly fine on their original APFS volume, but when copied to ZFS by any means they cause programs (including Quicklook/Finder) to crash when opening them. It doesn't seem to matter how I copy them; using the Finder, ditto, cp, or rsync, or cat (cat in >> out), the copies always exhibit this strange behaviour. If I copy them back to an APFS or HFS+ volume though they're absolutely fine. Even zipping a file on APFS/HFS+ then unzipping it on the ZFS volume didn't seem to work. Thinking it might be an encoding related issue I've also tried copying via iconv to a few different encodings but no luck there either.

I can open up the files on ZFS just fine using a command line tool (or by just spitting them into a terminal with cat), and if I copy/paste the text from there I can create and save a file without issue. Files created on ZFS seem to be just fine, the issue only appears to affect copied files.

I've been beating my head against the wall on this one for ages, so it's time to ask for help; like I say, I'm not sure if this is a ZFS issue as such, or something else, but I've tried every copying tool I can think of, and I've tried different settings of com.apple.mimic (off, hfs and apfs, all behave the same).

These are the commands I used to create the pool and dataset I'm trying to work with:

Code: Select all
# Create new pool with two disks (striped, till I can add mirrors)
zpool create -f \
-m none \
-o ashift=12 \
-o autoexpand=on \
-o feature@encryption=enabled \
-O relatime=on \
-O casesensitivity=insensitive \
-O com.apple.ignoreowner=off \
-O compression=zstd \
-O dnodesize=auto \
-O normalization=formD \
-O xattr=sa \
zdata disk0 disk1

# Create dataset
sudo zfs create \
-o encryption=on \
-o keylocation=prompt \
-o keyformat=passphrase \
-o mountpoint=/Users/haravikk \
zdata/haravikk


And here is a zip archive of a crash report for TextEdit.app, along with the file that the crash was for (a PHP script):
https://www.dropbox.com/s/40lttxd5k2aub ... e.zip?dl=0

Crashes for the Finder, Xcode etc. are all basically the same, the key part seems to be:

Code: Select all
Crashed Thread:        4  Dispatch queue: NSDocumentController Opening (QOS: UNSPECIFIED)

Exception Type:        EXC_BAD_ACCESS (SIGSEGV)
Exception Codes:       KERN_INVALID_ADDRESS at 0x0000000000000001
Exception Note:        EXC_CORPSE_NOTIFY

Termination Signal:    Segmentation fault: 11
Termination Reason:    Namespace SIGNAL, Code 0xb
Terminating Process:   exc handler [56224]

VM Regions Near 0x1:
-->
    __TEXT                 000000010cc01000-000000010cc1c000 [  108K] r-x/r-x SM=COW  /System/Applications/TextEdit.app/Contents/MacOS/TextEdit


If you're able to reproduce the same issue that I'm having then you should able to decompress the .zip file on the ZFS volume itself, but won't be able to open it in Xcode, TextEdit or the Finder (via Quicklook).

This issue has me really confused, and it's preventing me from copying data from the APFS/HFS volumes I want to retire in favour of ZFS :(
Haravikk
 
Posts: 75
Joined: Tue Mar 17, 2015 4:52 am

Re: Strange Issue with Copied Files

Postby Haravikk » Tue Jan 18, 2022 4:41 am

Ack, seems I just needed a good night's sleep.

Digging into it this morning I found that I wasn't running the latest release; I definitely tried to update before but it must have failed in a way that I didn't notice (must have happened more than once too, as I was still on 2.0.1)!

Fully uninstalling then re-installing seems to have addressed this weird issue, so I assume it was something fixed in one of the intervening releases. I'm kind of curious what it might have been though as it's super strange; it seems like the data copying without any issues, but accessing it from the ZFS volume was causing an issue, but maybe only for text files (others seemed unaffected, at least the ones I tested)?

On a not really related note, but what's the expected behaviour of com.apple.mimic=apfs? I tried setting that when trying to figure this out and had left it on, but the datasets I set to =apfs still appear as "Mac OS Extended" in the Finder, is there some kind of problem with mimicking APFS? I switched back to HFS for now.
Haravikk
 
Posts: 75
Joined: Tue Mar 17, 2015 4:52 am


Return to General Help

Who is online

Users browsing this forum: No registered users and 35 guests