syncthing-android icon indicating copy to clipboard operation
syncthing-android copied to clipboard

Crashes with bad syscall while generating keys

Open ghost opened this issue 6 years ago • 12 comments

I am using a Google Slate with the latest version of Chrome: Version 78.0.3904.92 (Official Build) (64-bit) and Android: Version 9. Syncthing worked perfectly in my tablet until the app automatically upgraded itself from version 1.3.1 to version 1.3.2. After the upgrade:

  1. The app keeps staying in the initialisation state and shows "Loading" indefinitely. At the same time notification shows "Syncthing is starting";
  2. the log of the app contains only one line "--------- beginning of main";
  3. force stop and restart, and re-install the app cannot resolve the issue.

ghost avatar Dec 06 '19 11:12 ghost

Hi,

could you run "adb logcat" from a computer with the phone connected to obtain a log, please?

Catfriend1 avatar Dec 08 '19 16:12 Catfriend1

Hi @Catfriend1

Thanks. I powerwashed the Pixel Slate before turned it into Developer Mode and enabled ADB log. Therefore the logcat was started after Syncthing was installed on the clean Pixel Slate and right before it was launched for the first time. The app and log lasted for ten minutes before they are stopped. The enclosed text file is the logcat log and the enclosed screenshot is how the app was looked like after ten minutes (after I passed through the splash screens).

Syncthing_logcat.txt

Screenshot 2019-12-12 at 23 51 00

ghost avatar Dec 12 '19 16:12 ghost

Thanks for the log. The relevant bit:

12-12 23:39:35.962  2258     0 E Go      : SIGSYS: bad system call
12-12 23:39:35.962  2258     0 E Go      : PC=0x567129b2fa2b m=0 sigcode=1
12-12 23:39:35.962  2258     0 E Go      : 
12-12 23:39:35.962  2258     0 E Go      : goroutine 29 [running]:
12-12 23:39:35.962  2258     0 E Go      : syscall.RawSyscall(0x16, 0xc0016c92c8, 0x0, 0x0, 0x0, 0x567129e547e2, 0x123)
12-12 23:39:35.962  2258     0 E Go      : 	/opt/go/src/syscall/asm_linux_amd64.s:78 +0x2b fp=0xc0016c9260 sp=0xc0016c9258 pc=0x567129b2fa2b
12-12 23:39:35.962  2258     0 E Go      : golang.org/x/sys/unix.pipe(0xc0016c92c8, 0x0, 0x0)
12-12 23:39:35.962  2258     0 E Go      : 	/opt/gopath/pkg/mod/golang.org/x/[email protected]/unix/zsyscall_linux_amd64.go:2426 +0x4c fp=0xc0016c92b0 sp=0xc0016c9260 pc=0x567129e553ec
12-12 23:39:35.962  2258     0 E Go      : golang.org/x/sys/unix.Pipe(0xc0000e43d0, 0x2, 0x2, 0x0, 0x0)
12-12 23:39:35.962  2258     0 E Go      : 	/opt/gopath/pkg/mod/golang.org/x/[email protected]/unix/syscall_linux_amd64.go:135 +0x67 fp=0xc0016c92e0 sp=0xc0016c92b0 pc=0x567129e54187
12-12 23:39:35.962  2258     0 E Go      : github.com/syncthing/notify.(*inotify).epollinit(0xc00014a000, 0x9, 0x0)
12-12 23:39:35.962  2258     0 E Go      : 	/opt/gopath/pkg/mod/github.com/syncthing/[email protected]/watcher_inotify.go:152 +0x70 fp=0xc0016c9320 sp=0xc0016c92e0 pc=0x567129e5e610
12-12 23:39:35.962  2258     0 E Go      : github.com/syncthing/notify.(*inotify).lazyinit(0xc00014a000, 0x0, 0x0)
12-12 23:39:35.962  2258     0 E Go      : 	/opt/gopath/pkg/mod/github.com/syncthing/[email protected]/watcher_inotify.go:128 +0xfd fp=0xc0016c93b0 sp=0xc0016c9320 pc=0x567129e5e41d
12-12 23:39:35.962  2258     0 E Go      : github.com/syncthing/notify.(*inotify).watch(0xc00014a000, 0xc00003a3a0, 0x18, 0xc000100fc2, 0x672a6e7cd821ed8a, 0x567129a85822)
12-12 23:39:35.962  2258     0 E Go      : 	/opt/gopath/pkg/mod/github.com/syncthing/[email protected]/watcher_inotify.go:89 +0x40 fp=0xc0016c9410 sp=0xc0016c93b0 pc=0x567129e5e020
12-12 23:39:35.962  2258     0 E Go      : github.com/syncthing/notify.(*inotify).Watch(0xc00014a000, 0xc00003a3a0, 0x18, 0xc000100fc2, 0x0, 0xc0016c04d8)
12-12 23:39:35.962  2258     0 E Go      : 	/opt/gopath/pkg/mod/github.com/syncthing/[email protected]/watcher_inotify.go:74 +0x49 fp=0xc0016c9450 sp=0xc0016c9410 pc=0x567129e5df49
12-12 23:39:35.962  2258     0 E Go      : github.com/syncthing/notify.(*nonrecursiveTree).recFunc.func1(0xc00003a3a0, 0x18, 0xc00021c180, 0xc00021c1b0, 0x13, 0x56712afd6438)
12-12 23:39:35.962  2258     0 E Go      : 	/opt/gopath/pkg/mod/github.com/syncthing/[email protected]/tree_nonrecursive.go:199 +0x19e fp=0xc0016c94c0 sp=0xc0016c9450 pc=0x567129e6155e
12-12 23:39:35.963  2178  2260 W SyncthingNativeCode: SIGSYS: bad system call
12-12 23:39:35.963  2258     0 E Go      : github.com/syncthing/notify.node.AddDir(0xc00003a3a0, 0x18, 0xc00021c180, 0xc00021c1b0, 0xc0003d20a0, 0xc00007c3c0, 0x56712a936380, 0xc0003d20a0)
12-12 23:39:35.963  2258     0 E Go      : 	/opt/gopath/pkg/mod/github.com/syncthing/[email protected]/node.go:67 +0x145 fp=0xc0016c9618 sp=0xc0016c94c0 pc=0x567129e56a55
12-12 23:39:35.963  2258     0 E Go      : github.com/syncthing/notify.node.AddDir-fm(0xc0003d20a0, 0xc00007c3c0, 0xc0003d20a0, 0x56712aff7540)
12-12 23:39:35.963  2258     0 E Go      : 	/opt/gopath/pkg/mod/github.com/syncthing/[email protected]/node.go:62 +0x5b fp=0xc0016c9668 sp=0xc0016c9618 pc=0x567129e64b4b
12-12 23:39:35.963  2258     0 E Go      : github.com/syncthing/notify.(*nonrecursiveTree).watchrec(0xc0000ea360, 0xc00003a3a0, 0x18, 0xc00021c180, 0xc00021c1b0, 0xc0000eaea0, 0xc001000fc2, 0xc00007c3c0, 0xc00021c180, 0xc00021c1b0)
12-12 23:39:35.963  2258     0 E Go      : 	/opt/gopath/pkg/mod/github.com/syncthing/[email protected]/tree_nonrecursive.go:230 +0x190 fp=0xc0016c9740 sp=0xc0016c9668 pc=0x567129e5a880
12-12 23:39:35.963  2258     0 E Go      : github.com/syncthing/notify.(*nonrecursiveTree).Watch(0xc0000ea360, 0xc00003a3a0, 0x18, 0xc0000eaea0, 0xc00007c3c0, 0xc00003c0e8, 0x1, 0x1, 0x0, 0x0)
12-12 23:39:35.963  2258     0 E Go      : 	/opt/gopath/pkg/mod/github.com/syncthing/[email protected]/tree_nonrecursive.go:166 +0x1eb fp=0xc0016c97e0 sp=0xc0016c9740 pc=0x567129e5a25b
12-12 23:39:35.963  2258     0 E Go      : github.com/syncthing/notify.WatchWithFilter(...)
12-12 23:39:35.963  2258     0 E Go      : 	/opt/gopath/pkg/mod/github.com/syncthing/[email protected]/notify.go:75
12-12 23:39:35.963  2258     0 E Go      : github.com/syncthing/syncthing/lib/fs.(*BasicFilesystem).Watch(0xc0003f2db0, 0x56712a2774ed, 0x1, 0x56712aa17660, 0xc0000d2480, 0x56712aa21160, 0xc00007c140, 0x56712a90f101, 0xc000040d10, 0x56712aa16020, ...)
12-12 23:39:35.963  2258     0 E Go      : 	/opt/tcagent/syncthing-1-work/31d51f290561a759/syncthing/src/github.com/syncthing/syncthing/lib/fs/basicfs_watch.go:45 +0x254 fp=0xc0016c98c8 sp=0xc0016c97e0 pc=0x567129e67bf4
12-12 23:39:35.963  2178  2260 W SyncthingNativeCode: PC=0x567129b2fa2b m=0 sigcode=1
12-12 23:39:35.963  2258     0 E Go      : github.com/syncthing/syncthing/lib/fs.(*walkFilesystem).Watch(0xc0003f2dc0, 0x56712a2774ed, 0x1, 0x56712aa17660, 0xc0000d2480, 0x56712aa21160, 0xc00007c140, 0x1, 0xc0001325c0, 0x1, ...)
12-12 23:39:35.963  2258     0 E Go      : 	<autogenerated>:1 +0xa0 fp=0xc0016c9938 sp=0xc0016c98c8 pc=0x567129e78bc0
12-12 23:39:35.963  2258     0 E Go      : github.com/syncthing/syncthing/lib/model.(*folder).monitorWatch(0xc0000be000, 0x56712aa21160, 0xc00007c140)
12-12 23:39:35.963  2258     0 E Go      : 	/opt/tcagent/syncthing-1-work/31d51f290561a759/syncthing/src/github.com/syncthing/syncthing/lib/model/folder.go:635 +0x480 fp=0xc0016c9fc8 sp=0xc0016c9938 pc=0x56712a1c0c40
12-12 23:39:35.963  2258     0 E Go      : runtime.goexit()
12-12 23:39:35.963  2258     0 E Go      : 	/opt/go/src/runtime/asm_amd64.s:1357 +0x1 fp=0xc0016c9fd0 sp=0xc0016c9fc8 pc=0x567129ad9341
12-12 23:39:35.963  2178  2260 W SyncthingNativeCode: 
12-12 23:39:35.963  2258     0 E Go      : created by github.com/syncthing/syncthing/lib/model.(*folder).startWatch
12-12 23:39:35.963  2258     0 E Go      : 	/opt/tcagent/syncthing-1-work/31d51f290561a759/syncthing/src/github.com/syncthing/syncthing/lib/model/folder.go:620 +0x10c

It doesn't recognise that as a crash and keeps polling the API like forever.

Given "/opt/go/src/syscall/asm_linux_amd64.s" it looks like you are running the newly added amd64/x86_64 arch and somehow a syscall makes that blow up. @Catfriend1 you are running that arch for quite a long time - did you encounter any such problems too?

imsodin avatar Dec 12 '19 16:12 imsodin

It seems like another stripped down kernel that does not support something basic liks pipes?

I am skeptical to believe this worked before as we did not ship this arch? If you install an old version of the apk manually, does it actually work? If yes, what version does the UI report.

AudriusButkevicius avatar Dec 12 '19 18:12 AudriusButkevicius

@imsodin I'm completely clueless what causes this. I've just added the x86_64 arch "for google play" - don't know about one single user actively using that arch. If others on x86_64 arch are reading this, it might be helpful when they join the conversation.

Another guess :Could it be that the kernel doesn't support file watching and in case it doesn't "come up" the pipe fails?

Catfriend1 avatar Dec 12 '19 19:12 Catfriend1

@AudriusButkevicius Syncthing versions 1.2.2 to 1.3.1 (android 32 bit) work perfectly with my Pixel Slate before.

Screenshot 2019-12-14 at 01 09 50

ghost avatar Dec 13 '19 16:12 ghost

What's the version printed on the first line of the log?

AudriusButkevicius avatar Dec 13 '19 18:12 AudriusButkevicius

@AudriusButkevicius do you mean this?

12-14 12:35:35.243 2027 2065 I SyncthingNativeCode: [start] INFO: syncthing v1.3.1 "Fermium Flea" (go1.13.4 android-386) vagrant@basebox-stretch64 2019-10-07 11:30:25 UTC

Syncthing_logcat_2.txt

ghost avatar Dec 14 '19 04:12 ghost

FWIW I'm seeing this issue on my Pixel Slate as well, same as described in @cm-lo's initial report.

decadecity avatar Dec 16 '19 13:12 decadecity

Yeah, sadly I can't explain why 32 but works and 64bit doesn't. Presumably file watching works ok on 32bit?

AudriusButkevicius avatar Dec 16 '19 13:12 AudriusButkevicius

Working fix: https://github.com/syncthing/syncthing/pull/8710

Catfriend1 avatar Dec 08 '22 12:12 Catfriend1

Syncthing-Android 1.23.0 does't fix this issue on WSA 2210.40000.7.0.

ivysrono avatar Jan 10 '23 09:01 ivysrono