Skip to content
This repository was archived by the owner on Dec 3, 2024. It is now read-only.

Fails to start in Android 10 / Q: TLS segment underaligned #1291

Closed
callahad opened this issue Mar 13, 2019 · 33 comments
Closed

Fails to start in Android 10 / Q: TLS segment underaligned #1291

callahad opened this issue Mar 13, 2019 · 33 comments

Comments

@callahad
Copy link

Hi, Syncthing does not launch in Android Q. The in-app logs report:

--------- beginning of main
--------- beginning of crash
03-13 23:12:51.467 W/SyncthingNativeCode(21438): error: "/data/app/com.nutomic.syncthingandroid-kgE8B7kQjgjrpd1_hr0zbw==/lib/arm64/libsyncthing.so": executable's TLS segment is underaligned: alignment is 8, needs to be at least 64 for ARM64 Bionic
@callahad
Copy link
Author

Looks like this is due to an upstream bug in Go: golang/go#29674

@Catfriend1
Copy link
Contributor

Hmmm I'll wait a little bit until q is really in it's final stage before looking deeper... Thanks for the report.

@kvaster
Copy link

kvaster commented Mar 15, 2019

I've monkey-patch-fix for now for me:
Catfriend1/syncthing-android#370

@jaseemabid
Copy link

Same issue on the Pixel 2 official Q build. Cannot use syncthing anymore :/

--------- beginning of main
03-17 17:51:14.737 W/SyncthingNativeCode( 8900): error: "/data/app/com.nutomic.syncthingandroid-nNfpUCdCsSnNG2p4dSoerA==/lib/arm64/libsyncthing.so": executable's TLS segment is underaligned: alignment is 8, needs to be at least 64 for ARM64 Bionic
--------- beginning of crash
03-17 17:52:00.946 W/SyncthingNativeCode( 8900): error: "/data/app/com.nutomic.syncthingandroid-nNfpUCdCsSnNG2p4dSoerA==/lib/arm64/libsyncthing.so": executable's TLS segment is underaligned: alignment is 8, needs to be at least 64 for ARM64 Bionic

@CedricCabessa
Copy link

I confirm this patch Catfriend1/syncthing-android@3a188d4 fixes the issue on my Pixel 2 on Android Q

Catfriend1/syncthing-android#370

@danblah
Copy link

danblah commented Mar 28, 2019

I confirm this patch Catfriend1/syncthing-android@3a188d4 fixes the issue on my Pixel 3 XL on Android Q

Catfriend1/syncthing-android#370

@CedricCabessa
Copy link

any news on this?

The bug is still present in the last version of syncthing and Q beta 4 (this is the final api)

I'm very happy with Catfriend's patch :-)

@imsodin
Copy link
Member

imsodin commented Jun 16, 2019

Go 1.13 will have a proper fix. That's going to be released soon (beginning of August). And I personally wouldn't want to modify the Syncthing binary (or any binary) in general.

@hdurer
Copy link

hdurer commented Sep 2, 2019

This seems to still be an issue.

Is there a plan to create a new release soon that will pick up the go fix from last month?

@Catfriend1
Copy link
Contributor

The plan is to build with go1.13 (containing the fix you've mentioned) as soon as it is released.
Currently, go 1.13rc2 is available, so it shouldn't take long until the final release.

@imsodin
Copy link
Member

imsodin commented Sep 2, 2019

I plan to use go1.13 (RC or final release) for the next scheduled candidate release of syncthing-android next week.

@Catfriend1
Copy link
Contributor

@imsodin I've tested go1.13rc2 and it works fine on the Q emulator.

@Athanasius
Copy link

Well, SyncThing is currently 100% non-functional on Android 10. Any chance of a beta release using the go release candidate ?

@yacoob
Copy link

yacoob commented Sep 3, 2019

Yes, if possible please err on the side of conservative approach and don't keep Android version broken for long. Desktop version is relatively easy to recompile. Rolling your own apk is more difficult, plus sometimes impossible to install it due to device policies. :(

@Athanasius
Copy link

Indeed, building it for myself will be problematic given the golang-1.7 on Debian oldstable. I'm more than willing to be a guinea pig if any dev has a version that should work on Android 10.

@AudriusButkevicius
Copy link
Member

AudriusButkevicius commented Sep 4, 2019

@imsodin we should re-release latest released version built with new go perhaps.

@hdurer
Copy link

hdurer commented Sep 4, 2019

For simple users like myself stumbling upon this: syncthing-fork does work already. Switching is a hassle but doable and gets your device back into working order in my experience.

@calmh calmh pinned this issue Sep 4, 2019
@calmh calmh changed the title Fails to start in Android Q Beta: TLS segment underaligned Fails to start in Android 10 / Q: TLS segment underaligned Sep 4, 2019
@imsodin
Copy link
Member

imsodin commented Sep 4, 2019

I will rerelease 1.2.2 as 1.2.2.1 with go1.13 soon (building now).

@duckpuppy
Copy link

I see the 1.2.2.1 release on the releases list here - has it been submitted to the Play Store? I was just offered the 1.2.2 upgrade today, so I'm sure it'll be delayed for me a bit even if it's already been submitted.

@txoof
Copy link

txoof commented Sep 5, 2019

What is the release schedule on the play store? Eagerly awaiting the update...

@Athanasius
Copy link

Indeed I'm still eagerly checking for an update a few times a day.

Sure, I could use syncthing-fork or any other special build with the fix, but it won't pick up the same settings, and with the official app in the state it's in I can't export my current settings. That is another bug that needs addressing IMO. Ensure the UI always has working menu to change/import/export settings no matter the state of network connections (this whole thing is a TLS issue brought on by a library issue, yes?).

Yes, I'll be exporting my settings the moment I get the official app update.

@AdrianStone0405
Copy link

AdrianStone0405 commented Sep 6, 2019

1.2.2 in Essential PH-1(Android 10) always loading and can't use.

@imsodin
Copy link
Member

imsodin commented Sep 6, 2019

Since upgrading to go1.13 there's a problem with the build servers that I wasn't able to solve yet, that's why the announced release hasn't happened yet (and I can't currently give an ETA).

@Athanasius
Copy link

Thanks for giving us a heads up on the delay.

@yacoob
Copy link

yacoob commented Sep 9, 2019

I've just got an update to 1.2.2.2, with changelog mentioning go1.13 build and this issue. Sadly, syncthing crashes on startup now:

java.lang.RuntimeException: Unable to start service com.nutomic.syncthingandroid.service.SyncthingService@664cd8f with Intent { cmp=com.nutomic.syncthing android/.service.SyncthingService }: java.lang.SecurityException: Permission Denial: startForeground from pid=29211, uid=10162 requires android.permission.FOREGROUND_SERVICE

I've sent the feedback via Android crash reporter, so you should have more details. I haven't denied any permissions to Syncthing, and I don't see a matching one to enable explicitly in app info.

@llzzrrdd
Copy link

llzzrrdd commented Sep 9, 2019

Hi, same issue as yacoob described here (pixel 2).

@sungamagnus
Copy link

sungamagnus commented Sep 9, 2019

Same problem.
Looks like an easy fix by adding <uses-permission android:name="android.permission.FOREGROUND_SERVICE" /> to AndroidManifest.xml - https://stackoverflow.com/a/52382711

Created a simple PR #1400


Edit:
Just realized there's an automated TeamCity Build for syncthing. Here's the debug build of syncthing with my fix.[1]. Note I can't test it at the moment. Proceed with your own risk.

[1] https://build.syncthing.net/viewLog.html?buildId=45936&buildTypeId=SyncthingAndroid_Build&tab=artifacts#%2Fapk;%2Farm64-v8a;%2Fx86;%2Flogs;%2Farmeabi

@cciprian5
Copy link

After the update on the beta channel, the app is not opening anymore. It just crashes and there is no log written.

@sungamagnus
Copy link

My PR #1400 is 15 min too late (#1399)

@AudriusButkevicius
Copy link
Member

Closing this as this issue is fixed. There is a separate issue which I am trying to fix on the mobile on a train, but github removed half the features from mobile ui, so not much fun.

@Athanasius
Copy link

I just got the 1.2.2.3 update and it appears to be working (sync'd a new file over from my server). I've now made a backup of the settings in case of future hiccups....

@camachat
Copy link

camachat commented Sep 9, 2019

1.2.2.3 works on Pixel 3

@ai-christianson
Copy link

Can confirm working. 1.2.2.3 Pixel 2.

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

No branches or pull requests