Skip to content
This repository has been archived by the owner on Mar 12, 2020. It is now read-only.

New mobile framework accessing internal iOS API: _ptrace #609

Closed
sanderpick opened this issue Mar 11, 2019 · 11 comments
Closed

New mobile framework accessing internal iOS API: _ptrace #609

sanderpick opened this issue Mar 11, 2019 · 11 comments
Assignees
Milestone

Comments

@sanderpick
Copy link
Member

Apple doesn't like something that happened in here:

v1.0.0-rc44...v1.0.0-rc45

@sanderpick sanderpick added this to the Sprint 7 milestone Mar 11, 2019
@sanderpick sanderpick self-assigned this Mar 11, 2019
@sanderpick
Copy link
Member Author

Interesting... if I build the framework locally, grep searching for _ptrace returns no results.

@sanderpick
Copy link
Member Author

_ptrace is coming from the syscall package. Tracking it down to: https://ipfs.io/ipfs/QmWLWmRVSiagqP15jczsGME1qpob6HDbtbHAY2he9W5iUo/opentracing-go

However, this has been a dependency for awhile. Something about the build in CI is causing these API calls to be included... still poking...

@sanderpick
Copy link
Member Author

More info: https://golang.org/doc/go1.12#darwin

libSystem is now used when making syscalls on Darwin, ensuring forward-compatibility with future versions of macOS and iOS. The switch to libSystem triggered additional App Store checks for private API usage. Since it is considered private, syscall.Getdirentries now always fails with ENOSYS on iOS.

@sanderpick
Copy link
Member Author

Current theory is that this has nothing to do with go@1.12, but instead to do with the way I was evaluating the LD flags in CI. Basically, incorrect usage of {}, which was causing additional packages to be compiled with the framework. Unfortunately, I'm having a hard time proving that's the issue because go get -u golang.org/x/mobile/cmd/gomobile is failing about 9/10 times with:

Cloning into '/Users/distiller/go/src/golang.org/x/mobile'...
fatal: remote error: Internal Server Error
fatal: the remote end hung up unexpectedly
package golang.org/x/mobile/cmd/gomobile: exit status 128

Must be an issue with google's git server...

@sanderpick
Copy link
Member Author

sanderpick commented Mar 12, 2019

Ok, nvm. go@1.12 is the culprit. I'm going to force 11.5 on the build machine for now.

@sanderpick
Copy link
Member Author

Reverted CI to go@1.11.5. I can confirm _ptrace cannot be found in the build: https://4266-124269776-gh.circle-artifacts.com/0/Users/distiller/dist/ios_framework/go-textile_c5dc058_ios-framework.tar.gz

@andrewxhill
Copy link
Member

andrewxhill commented Jun 1, 2019

just reopening this as we've moved to 1.12 and hit the same issue.
issue in go, golang/go#31628

@andrewxhill andrewxhill reopened this Jun 1, 2019
@andrewxhill andrewxhill modified the milestones: Sprint 7, Sprint 13 Jun 1, 2019
@sanderpick
Copy link
Member Author

Poking at this now.

@sanderpick
Copy link
Member Author

sanderpick commented Jun 4, 2019

So far:

The farthest I've gotten so far is being stuck at a go1.12 requirement of crypto/tls:

bash-3.2$ env go111module=off gomobile bind -v -work -ldflags="-w $FLAGS" -target=ios github.com/textileio/go-textile/mobile github.com/textileio/go-textile/core
WORK=/var/folders/1b/gl7yt7ds26vcyr1pkgld6l040000gn/T/gomobile-work-107008606/go-build781581901
runtime/cgo
golang.org/x/mobile/internal/mobileinit
os/user
net
# github.com/textileio/go-textile/vendor/github.com/mutecomm/go-sqlcipher
sqlite3.c:34280:6: warning: "gethostuuid() is disabled." [-W#warnings]
github.com/textileio/go-textile/vendor/github.com/mutecomm/go-sqlcipher
github.com/textileio/go-textile/vendor/github.com/libp2p/go-libp2p-tls
# github.com/textileio/go-textile/vendor/github.com/libp2p/go-libp2p-tls
vendor/github.com/libp2p/go-libp2p-tls/crypto.go:46:30: undefined: tls.VersionTLS13
# github.com/textileio/go-textile/vendor/github.com/mutecomm/go-sqlcipher
sqlite3.c:34280:6: warning: "gethostuuid() is disabled." [-W#warnings]
WORK=/var/folders/1b/gl7yt7ds26vcyr1pkgld6l040000gn/T/gomobile-work-107008606
gomobile: darwin-arm: go build -tags ios -v -ldflags -w  -work -buildmode=c-archive -o /var/folders/1b/gl7yt7ds26vcyr1pkgld6l040000gn/T/gomobile-work-107008606/mobile-arm.a gobind failed: exit status 2

@sanderpick
Copy link
Member Author

sanderpick commented Jun 4, 2019

@sanderpick
Copy link
Member Author

PR w/ custom builds was merged: #804. I'll leave this open until we can verify Apple is happy.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants