Kanbaru 🌟 (one hikari of too many)

why does touchHLE's app support improve when I return relative rather than absolute paths for the document directory and app bundle. why do apps seemingly rely on this. surely Foundation/CoreFoundation don't actually do this? I can't reproduce it on a real device. surely…

3 replies β†’
3 replies

abadidea

(replying to Kanbaru 🌟 (one hikari of too many))

@hikari apps allocating short fixed buffers that won’t overflow with the full path on real ios but do overflow with the full path of your project folder?

Kanbaru 🌟 (one hikari of too many)

(replying to abadidea)

@0xabad1dea you'd think so, but it's definitely not a buffer overflow issue. the paths I'm using are the right size


Saagar Jha

(replying to Kanbaru 🌟 (one hikari of too many))
@hikari Pretty sure both return absolute paths with a long UUID hardcoded into them

Kanbaru 🌟 (one hikari of too many)

(replying to Saagar Jha)

@saagar EXACTLY


claire

(replying to Kanbaru 🌟 (one hikari of too many))

@hikari@social.noyu.me which API are you implementing that returns the documents directory? If it's NSSearchPathForDirectoriesInDomains I'm pretty sure that has always returned absolute paths, even back to iPhone OS 3 so this seems...weird

claire

(replying to claire)

@hikari@social.noyu.me Alternatively, could the absolute path have spaces in it? iirc this wouldn't happen on real iOS

Kanbaru 🌟 (one hikari of too many)

(replying to claire)

@protosphere it can happen if the app bundle name does, but for this reason I always use its canonical name from the plist

Kanbaru 🌟 (one hikari of too many)

(replying to Kanbaru 🌟 (one hikari of too many))

I have lost weeks of my life to trying to debug this and crashes related to it.

if I don't do this, the apps use what would be valid absolute paths, but which have a missing leading slash. which surely indicates a bug somewhere. how could this possibly work on the real OS. surelyβ€”

…

oh.

screams

photo of the top-left corner of an iPod touch (2nd generation) running an app displaying a white screen with some very small text on it. the first line of the text is β€œgetcwd: /”

Kanbaru 🌟 (one hikari of too many)

(replying to Kanbaru 🌟 (one hikari of too many))

iOS. the only operating system where many games accidentally remove the leading slash from absolute paths and still work.

Mango "James" Fusion

(replying to Kanbaru 🌟 (one hikari of too many))

@hikari how did that even pass approval?

Kanbaru 🌟 (one hikari of too many)

(replying to Mango "James" Fusion)

@mangofu who would think to check for it?