Bug 399445 - Crash during initialization
Summary: Crash during initialization
Status: RESOLVED FIXED
Alias: None
Product: qca
Classification: Frameworks and Libraries
Component: general (show other bugs)
Version: 2.1.1
Platform: Other Android 9.x
: NOR normal
Target Milestone: ---
Assignee: Ivan Romanov
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2018-10-06 14:52 UTC by Matthias Kuhn
Modified: 2020-01-28 06:09 UTC (History)
3 users (show)

See Also:
Latest Commit:
Version Fixed In:
Sentry Crash Report:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Matthias Kuhn 2018-10-06 14:52:40 UTC
QCA crashes during initialization on Android 9, as can be seen in https://github.com/opengisch/QField/issues/291

Relevant parts of the [backtrace here](https://github.com/opengisch/QField/issues/291#issuecomment-414917279)

```
08-21 18:42:52.240 29595 29595 F DEBUG   : pid: 29562, tid: 29590, name: QtMainThread  >>> ch.opengis.qfield <<<
08-21 18:42:52.240 29595 29595 F DEBUG   : signal 31 (SIGSYS), code 1 (SYS_SECCOMP), fault addr --------
08-21 18:42:52.240 29595 29595 F DEBUG   : Cause: seccomp prevented call to disallowed arm system call 213
```

```
#00 pc 00054f98  /system/lib/libc.so (setuid+12)
#01 pc 0004ab31  /data/app/ch.opengis.qfield-UoBGQ4wNBC2DfegHpQH5wg==/lib/arm/libqca-qt5.so #02 pc 0004ac05  /data/app/ch.opengis.qfield-UoBGQ4wNBC2DfegHpQH5wg==/lib/arm/libqca-qt5.so (QCA::Initializer::Initializer(QCA::MemoryMode, int)+8)
#03 pc 0026cda9  /data/app/ch.opengis.qfield-UoBGQ4wNBC2DfegHpQH5wg==/lib/arm/libqgis_core.so (QgsAuthManager::init(QString const&, QString const&)+52)
```

setuid calls are not allowed starting from Android O (https://android-developers.googleblog.com/2017/07/seccomp-filter-in-android-o.html).

A patch to disable setuid on Android systems has been prepared here https://github.com/KDE/qca/pull/6/files.
 It's not completely clear to me, what impact (if any) this patch has on older Android versions.
Comment 1 Albert Astals Cid 2020-01-25 10:33:25 UTC
There's been a few android fixes recently, could you try a new release?
Comment 2 Matthias Kuhn 2020-01-27 06:56:17 UTC
I don't have a system at hand to test unfortunately.

Do you have a particular commit in mind that is likely to have fixed this?

Right now, we are using the latest version, but still with the patch (linked in the ticket) applied. I don't think there is a reason for QCA to use setuid, so by disabling it we are on the safe side it doesn't do anything that's disallowed (on Android) by design.
Comment 4 Matthias Kuhn 2020-01-28 06:09:33 UTC
The link in the pull request goes points to a fork of my code. So the applied patch is the same as proposed in here.
Good to close.