Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

os: WriteFile failures with operation not permitted on iOS #57161

Closed
ericdream opened this issue Dec 8, 2022 · 2 comments
Closed

os: WriteFile failures with operation not permitted on iOS #57161

ericdream opened this issue Dec 8, 2022 · 2 comments
Labels
FrozenDueToAge mobile Android, iOS, and x/mobile OS-Darwin WaitingForInfo Issue is not actionable because of missing required information, which needs to be provided.
Milestone

Comments

@ericdream
Copy link

What version of Go are you using (go version)?

$ go version 1.16

Does this issue reproduce with the latest release?

I haven't used the latest release

What operating system and processor architecture are you using (go env)?

GO111MODULE="on"
GOARCH="arm64"
GOEXE=""
GOFLAGS="-mod=mod"
GOHOSTARCH="arm64"
GOHOSTOS="darwin"
GOINSECURE=""
GOOS="darwin"
GOPROXY="https://goproxy.cn,direct"
GOROOT="/usr/local/go"
GOSUMDB="sum.golang.org"
GOTMPDIR=""
GOTOOLDIR="/usr/local/go/pkg/tool/darwin_arm64"
GOVCS=""
GOVERSION="go1.16.15"
GCCGO="gccgo"
AR="ar"
CC="clang"
CXX="clang++"
CGO_ENABLED="1"
CGO_CFLAGS="-g -O2"
CGO_CPPFLAGS=""
CGO_CXXFLAGS="-g -O2"
CGO_FFLAGS="-g -O2"
CGO_LDFLAGS="-g -O2"
PKG_CONFIG="pkg-config"
GOGCCFLAGS="-fPIC -arch arm64 -pthread -fno-caret-diagnostics -Qunused-arguments -fmessage-length=0 -fdebug-prefix-map=/var/folders/9k/dt625z5x4sj2pcf0n5twxrc00000gn/T/go-build1768545817=/tmp/go-build -gno-record-gcc-switches -fno-common"

What did you do?

I have a Go project that then compiles into an iOS library to use in an iOS project.

Code snippets
ioutil.WriteFile(path, data, os.ModePerm)

Write some data to a file using ioutil.WriteFile

What did you expect to see?

return error is nil

What did you see instead?

The error of operation not permitted occasionally appears on some iphone phones
:open /xxx/xxx.json: operation not permitted

@bcmills bcmills added OS-Darwin mobile Android, iOS, and x/mobile labels Dec 8, 2022
@bcmills bcmills added this to the Unplanned milestone Dec 8, 2022
@bcmills
Copy link
Contributor

bcmills commented Dec 8, 2022

That seems likely to be either an application error or a bug in the iOS filesystem or kernel. I suggest that you check for race conditions in the application (is something perhaps changing the permissions of the parent directory?), and consider escalating the bug to Apple.

If you can reproduce the failure mode in a simple, standalone test, it may be possible to reproduce it on the Go project's ios builders, in which case it might be possible to develop a workaround, but without a reproducer I don't think there's anything we can feasibly do to address this.

(CC @golang/ios)

@bcmills bcmills added the WaitingForInfo Issue is not actionable because of missing required information, which needs to be provided. label Dec 8, 2022
@bcmills bcmills changed the title affected/package: io/ioutil os: WriteFile failures with operation not permitted on iOS Dec 8, 2022
@bcmills
Copy link
Contributor

bcmills commented Dec 8, 2022

$ go version 1.16

Per the Go release policy, only the two most recent major releases of Go are supported — currently Go 1.18 and 1.19, and soon Go 1.19 and 1.20. If you can reproduce this problem on a supported version, please post the reproducer and reopen this issue.

@bcmills bcmills closed this as not planned Won't fix, can't repro, duplicate, stale Dec 8, 2022
@golang golang locked and limited conversation to collaborators Dec 8, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
FrozenDueToAge mobile Android, iOS, and x/mobile OS-Darwin WaitingForInfo Issue is not actionable because of missing required information, which needs to be provided.
Projects
None yet
Development

No branches or pull requests

3 participants