-
Notifications
You must be signed in to change notification settings - Fork 71
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
Problem running SyncthingNative on x86_64 arch (Chromebook, emulator) #583
Comments
Syncthing-fork does not work too.
|
Thanks @Catfriend1 - I really appreciate that you're looking into this,
but unfortunately I'm travelling at the moment and, as it's my main
device, I can't really afford to powerwash it to get into developer mode
to install non Play Store apps.
(I'm using Syncthing on the Chromebook's Linux subsystem with no issues
so I have a good workround 👍)
…On 16/12/2019 21:57, Catfriend1 wrote:
@cm-lo @decadecity
Could you please try this release and tell me if it has the same problem with SyncthingNative not starting and producing a "go native crash"?
https://github.com/Catfriend1/syncthing-android/releases/download/v1.3.3.2/com.github.catfriend1.syncthingandroid_v1.3.3.2_a0850dc1.apk
from: https://github.com/Catfriend1/syncthing-android/releases/tag/v1.3.3.2
|
I found another apk in the directory (com.github.catfriend1.syncthingandroid_gplay_v1.3.3.2_a0850dc1.apk). I captured the same three items as my last post in case you need. |
@imsodin The .log file posted above has the full go trace with a lot of watcher and service stuff from thejerf in it. Maybe you'll find some new info in it if you could kindly have a glance again? Does the current codebase offer a way to completely disable calling the watcher stuff (e.g. through env var or config.xml)? On the user's phone Syncthing came up fine until the ready to sync folder line and then died because of an unknown reason, maybe watcher related. |
The log shows the same as the one in the other issue: A pipe syscall used in the notify library is failing with "bad system call". No need to even look at all the rest, that's just the usual goroutines running at the time of the crash - the origin of the crash is clear, what's unclear is why this syscall doesn't work. This is definitely no new bug on Syncthing's side, this is just a problem with the particular build. You can disable file watching in the config (per folder), you can't disable it globally. |
Ok, thanks for your feedback, Simon! I'll try to make a test build with disabled file watcher after christmas 👍 |
Quote from original issue linked above: I see two commits on the syncthing-android (original) repo, but don't know if one has to do with it or a go code change... Between the mentioned versions, I noticed NDK was bumped from r15c to r20. We did that on the fork, too. So let's go another debug session together. I need info, if Syncthing-Fork v1.3.1 works on your x86_64 phones. @cm-lo : Could you please try and report back if the same error also comes up when running https://github.com/Catfriend1/syncthing-android/releases/download/v1.3.1.6/com.github.catfriend1.syncthingandroid_v1.3.1.6_b6564099.apk ? |
I've found a dirty workaround to make SyncthingNative v1.3.3 run on x86_64.
The part about BAD SYSCALL still wonders me.
@imsodin: Could it be that we need to report a bug for golang/sys/unix or update the submodule? I don't know how I could test with different versions of this. Here are the sources I've found to follow the stacktrace: |
@Catfriend1 thanks for your effort. The apk of v1.3.1.6 and v1.3.3.2 do not work and v1.3.3.3 seems work (see screenshot). I enclosed the logcats for all three apks. Merry Christmas! |
What changed between those version is exactly that I added the x86_64 build - there's nothing to be analyzed here: The origin of is the newly added x86_64 build.
And google play accepts that? They seem to be pretty easy to fool then o.O
Maybe, but we'd need to do much more digging (aka creating a minimal reproducer) as our builds involve way too many (non-standard) elements (different compiler for one). The problem might just as well be with the NDK. And I personally don't have any time for that. |
@imsodin thanks for your reply.
Well, they are currently reviewing it xD. Gplay said "compliant with the 64bit policy" after upload. ;-) I've tried with ndk15 and the problem is also there. If it's the ndk , the problem must have been there forever since. |
@Catfriend1 off topic, the reason (of the app is not running) is still shown in my v1.3.3.3 screenshot above even the app is indeed running. Apparently a tiny bug. |
This bug still occurs on the Android 13 emulator (AVD, x86_64 arch). But the above mentioned workaround by copying the x86 artifact to x86_64 doesn't work. The log says "error 2 executing libsyncthingnative.so - file not found" even though the file exists in the path the log mentions. Android 12+ seem to check if the .so arch is correct before executing the file. I've added the x86_64 build to "build-syncthing.py":
Syncthing now starts, and crashes short after with this in the log: https://pastebin.com/vVVN3GbR |
It seems to point at the inotify watcher,but I don't understand why only this 1 (out of 4) archs isn't working an produces the "bad system call".
|
@imsodin I've found the problem which causes SyncthingNative to crash when compiled against android-x86_64. I can workaround the crash by editing the following code: "...\syncthing-android\syncthing\pkg\mod\github.com\syncthing\[email protected]\watcher_inotify.go"
I removed all code from the "loop" function.
Then, I did the libsyncthingnative.so build for x86_64:
and running it on the Android 13 x86_64 emulator from Android studio gives a stable-running SyncthingNative: Sorry to bother you again, but now I need your expertise as I'm not familiar with those go things. Which of the code lines could cause the problem only relevant to x86_64 builds ? Maybe we can report a fix/PR to the inotify-go mod maintainers together?
|
In another issue I've found by googling around, they did update the fsnotify module to solve the same problem: silenceper/gowatch#44 |
@imsodin I've found and verified a workaround by disabling the missing syscall on android-amd64 for both Chromebook and the Android emulator (I would really prefer to use the emulator to continue my work on the fork). Any chance that you could be so kind to assist me getting this upstream? It would also help the official Syncthing Android wrapper as currently AVD >= 12 and Chromebook support is broken and would then be functional without inotify watches. Here's the tested change for Syncthing(Native): In "...\syncthing-android\syncthing\src\github.com\syncthing\syncthing\lib\fs\basicfs_watch.go"
(I've added "runtime") and in "func (f *BasicFilesystem) Watch" I've added the if (runtime.GOOS ...)
after this code (lines 34 to 37):
|
@ivysrono Does the recent v1.23.0.0 release of Syncthing-Fork work on your device? |
Yes.
|
@ivysrono Then, I really wonder why Syncthing-Android (official) doesn't run. It's the same native and it contains a patch to make it work on this OS arch. |
@cm-lo @decadecity
Could you please try this release and tell me if it has the same problem with SyncthingNative not starting and producing a "go native crash"?
https://github.com/Catfriend1/syncthing-android/releases/download/v1.3.3.2/com.github.catfriend1.syncthingandroid_v1.3.3.2_a0850dc1.apk
from: https://github.com/Catfriend1/syncthing-android/releases/tag/v1.3.3.2
Ref.: syncthing/syncthing-android#1451
Ref.: syncthing/syncthing-android#1703
ref: syncthing/syncthing#8710
The text was updated successfully, but these errors were encountered: