adafruit / iOS13-beta-file-issue

iOS 13 beta has an issue where it deletes all files off a USB drive and/or resets the iPad
0 stars 0 forks source link

Some investigation #1

Open e28eta opened 5 years ago

e28eta commented 5 years ago

Thanks for the blog post & videos @ptorrone! TIL about FAT12, and found @dhalbert's excellent info in https://github.com/adafruit/circuitpython/issues/111

I poked at this some more this evening, since I was wondering if I could verify whether this was a FAT12-specific issue, perhaps by mucking around with the block/cluster sizes to change the number of clusters on disk (I didn't get that far).

I see the same "erase/rename drive" behavior with PyPortal, with it's 8MB of storage. It shows up on my Mac (via diskutil info) as File System Personality: FAT16 drive, vs FAT12 for Circuit Playground Express. They both show up as Partition Type: DOS_FAT_12 🤷‍♂️. So I suspect it's still a FAT12-ish drive, but I'm not positive.

I also found the release notes for fatfs R0.13a, which include:

Fixed f_fdisk() and f_mkfs() create the partition table with wrong CHS parameters. (appeared at R0.09)

It looks like CircuitPython uses a version that'd include this problem. I'm seeing R0.12b.

I think this is the fix: https://github.com/abbrev/fatfs/commit/5c7915feab986c915f2142753f6df2e1497aad30 I tried applying it & seeing if it made a difference, but I got the same "erase/rename drive" & crash iPad behavior (assuming I did it correctly).

Finally, I pulled a panic log ("incident_id":"E764F68C-1BFA-4244-98BD-5743A32672A7" for any Apple lurkers) from my iPad, and it included:

panic(cpu 1 caller 0xfffffff015b6e624): Unaligned kernel data abort

And unaligned accesses seem very plausibly related to 12 bit data.

ptorrone commented 5 years ago

thanks @e28eta for checking this out!

ptorrone commented 5 years ago

@e28eta please check out the latest iOS beta, i think it's fixed, maybe, i need to test more, but so far i was able to open code.py in the files app and nothing deleted itself or crashed.

codepy version

ptorrone commented 5 years ago

OK! beta is out and it's all working great!

https://blog.adafruit.com/2019/07/30/its-now-possible-to-open-edit-and-save-python-code-on-ios-for-embedded-electronics-plugged-in-circuitpython-usb-devices-apple-ios-circuitpython/

ipadYAY-1