Skip to content
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

Fatal signal 7 (SIGBUS) in v0.7.6 with comp-lzo enabled. #944

Closed
ThE-MaRaC opened this issue Sep 25, 2018 · 21 comments
Closed

Fatal signal 7 (SIGBUS) in v0.7.6 with comp-lzo enabled. #944

ThE-MaRaC opened this issue Sep 25, 2018 · 21 comments

Comments

@ThE-MaRaC
Copy link

To make issues more manageable, I would appreciate it if you fill out the following details as applicable:

General information

  1. Android Version
    14.1-20180914-NIGHTLY-m8
  2. Android Vendor/Custom ROM
    LineageOS
  3. Device
    HTC One M8
  4. Version of the app (version number/play store version/self-built)
    0.7.6

Description of the issue

When comp-lzo option is used, OpenVPN for Android crashes.

09-24 21:58:34.804 F/libc    (31910): Fatal signal 7 (SIGBUS), code 1, fault addr 0xb695b1cb in tid 31910 (c_pie_openvpn.a)
09-24 21:58:34.804 I/ActivityManager(870): Displayed com.microsoft.rdc.android/com.microsoft.a3rdc.ui.activities.SessionActivity: +307ms
09-24 21:58:34.804 W/        (239): debuggerd: handling request: pid=31910 uid=10095 gid=10095 tid=31910
09-24 21:58:34.808 W/debuggerd(32025): type=1400 audit(0.0:75): avc: denied { search } for name="de.blinkt.openvpn" dev="mmcblk0p47" ino=590052 scontext=u:r:debuggerd:s0 tcontext=u:object_r:app_data_file:s0:c512,c768 tclass=dir permissive=0
09-24 21:58:34.815 F/DEBUG   (32025): *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***
09-24 21:58:34.816 F/DEBUG   (32025): LineageOS Version: '14.1-20180914-NIGHTLY-m8'
09-24 21:58:34.816 F/DEBUG   (32025): Build fingerprint: 'htc/m8_google/htc_m8:6.0/MRA58K.H6/648564:user/release-keys'
09-24 21:58:34.816 F/DEBUG   (32025): Revision: '0'
09-24 21:58:34.816 F/DEBUG   (32025): ABI: 'arm'
09-24 21:58:34.816 F/DEBUG   (32025): pid: 31910, tid: 31910, name: c_pie_openvpn.a  >>> /data/user/0/de.blinkt.openvpn/cache/c_pie_openvpn.armeabi-v7a <<<
09-24 21:58:34.816 F/DEBUG   (32025): signal 7 (SIGBUS), code 1 (BUS_ADRALN), fault addr 0xb695b1cb
09-24 21:58:34.816 F/DEBUG   (32025):     r0 b695b1cb  r1 000000e9  r2 b695c9c4  r3 000000d4
09-24 21:58:34.816 F/DEBUG   (32025):     r4 00000000  r5 000000e3  r6 b695b1cb  r7 befcdef8
09-24 21:58:34.816 F/DEBUG   (32025):     r8 b695cfca  r9 000000e6  sl b695c9c4  fp b695c9c4
09-24 21:58:34.816 F/DEBUG   (32025):     ip b695b65a  sp befcded4  lr befcdf0c  pc b6dbf896  cpsr 200e0030
09-24 21:58:34.820 F/DEBUG   (32025): 
09-24 21:58:34.820 F/DEBUG   (32025): backtrace:
09-24 21:58:34.820 F/DEBUG   (32025):     #00 pc 0019b896  /data/app/de.blinkt.openvpn-2/lib/arm/libopenvpn.so (lzo1x_decompress_safe+213)
09-24 21:58:34.820 F/DEBUG   (32025):     #01 pc 00084fdd  /data/app/de.blinkt.openvpn-2/lib/arm/libopenvpn.so
09-24 21:58:34.820 F/DEBUG   (32025):     #02 pc 0007f031  /data/app/de.blinkt.openvpn-2/lib/arm/libopenvpn.so (process_incoming_link_part2+72)
09-24 21:58:34.820 F/DEBUG   (32025):     #03 pc 0008b3ab  /data/app/de.blinkt.openvpn-2/lib/arm/libopenvpn.so (main+454)
09-24 21:58:34.821 F/DEBUG   (32025):     #04 pc 00017cb9  /system/lib/libc.so (__libc_init+44)
09-24 21:58:34.821 F/DEBUG   (32025):     #05 pc 000003fc  /data/data/de.blinkt.openvpn/cache/c_pie_openvpn.armeabi-v7a

Full log is attached.
2018-09-24-21-58-52.txt
Previous version was not affected.
Let me know if you need any other info.

@schwabe
Copy link
Owner

schwabe commented Sep 27, 2018

Strange that the app crashes in lzo. That is strange.

@vgaetera
Copy link

vgaetera commented Sep 29, 2018

@ThE-MaRaC could it be that server is using a different setting?
You can try to change client-side setting to comp-lzo adaptive for better compatibility.


Actually comp-lzo is marked as deprecated in the OpenVPN 2.4 manual:
https://community.openvpn.net/openvpn/wiki/Openvpn24ManPage
The new one equivalent of comp-lzo adaptive is compress without any arguments.

@ThE-MaRaC
Copy link
Author

Thx for info.
Previous version connects without any problem, other clients are also working with the same config, so I am pretty sure that everything is OK with the server.
I will test comp-lzo adaptive and compress options later and report back.

@schwabe
Copy link
Owner

schwabe commented Sep 30, 2018

comp-lzo adaptive should not make any difference. It is crashing in decompress and not while compressing

@ThE-MaRaC
Copy link
Author

Unfortunately compress option didn't help.
When compress option is used without any argument the following is reported in openvpn log:
14:28 Bad compression stub (swap) decompression header byte: 250
When compress option is used with lzo argument openvpn crashes with the same backtrace.
New log is attached. Let me know if you need anything else.
2018-09-30-14-28-10.txt

@schwabe
Copy link
Owner

schwabe commented Sep 30, 2018

compress lzo exactly the same as comp-lzo, so that is kind of expected.

@schwabe schwabe mentioned this issue Oct 1, 2018
@schwabe schwabe changed the title Fatal signal 7 (SIGBUS) in v0.7.6 Fatal signal 7 (SIGBUS) in v0.7.6 with comp-lzo enabled. Oct 1, 2018
@markusb68
Copy link

It crashes here on a NEXUS 5 and NEXUS 7 (Both on Stock Android 6).
On a NEXUS 9 (Stock Android 7.1.1) it works with lzo enabled.

I use the same configuration on all 3 devices since months.
Some of your latest changes in Beta broke it on Android 6

@schwabe
Copy link
Owner

schwabe commented Oct 1, 2018

Seem only 32 bit devices are affected

@markusb68
Copy link

Any fix in sight or do we always need to disable lzo on 32 bit devices from now on?

@schwabe
Copy link
Owner

schwabe commented Oct 2, 2018

@markusb68 I cannot reproduce the bug on my side. Might that the switch to ndk 18 did not go as smoothly as before. I cleaned and recompiled the project. Can you retest with 0.7.7pre from http://plai.de/android/ics-openvpn-0.7.7pre.apk and see if it makes are difference?

@markusb68
Copy link

0.7.7pre does not fix it. Still get exit code 7 when lzo is enabeled

@schwabe
Copy link
Owner

schwabe commented Oct 2, 2018

Okay. I cannot reproduce that on my device that makes fixing that error very hard.

@schwabe
Copy link
Owner

schwabe commented Oct 2, 2018

Can you check if it also crashes when selecting the openvpn3 core? To help narrow this down.

@markusb68
Copy link

With openvpn3 core it doesn't connect at all, it loops like this:

2018-10-02 17:04:53 offizielle Version 0.7.6 läuft auf google Nexus 5 (hammerhead), Android 6.0.1 (M4B30Z) API 23, ABI armeabi-v7a, (google/hammerhead/hammerhead:6.0.1/M4B30Z/3437181:user/release-keys)
2018-10-02 17:04:59 Generiere OpenVPN-Konfiguration…
2018-10-02 17:04:59 Netzwerkstatus: CONNECTED to WIFI "ZSE-WLAN"
2018-10-02 17:04:59 Debug state info: CONNECTED to WIFI "ZSE-WLAN", pause: userPause, shouldbeconnected: true, network: SHOULDBECONNECTED
2018-10-02 17:04:59 Debug state info: CONNECTED to WIFI "ZSE-WLAN", pause: userPause, shouldbeconnected: true, network: SHOULDBECONNECTED
2018-10-02 17:04:59 OpenVPN core 3.git:master(icsopenvpn/v0.7.6-1-g3bbf7454) android armv7a thumb2 32-bit built on Oct 2 2018 14:48:05
2018-10-02 17:04:59 Copyright (C) 2012-2017 OpenVPN Inc. All rights reserved.
2018-10-02 17:04:59 Frame=512/2048/512 mssfix-ctrl=1250
2018-10-02 17:04:59 UNUSED OPTIONS
1 [verb] [4]
2 [connect-retry-max] [5]
3 [connect-retry] [5] [300]
4 [resolv-retry] [60]
12 [nobind]
14 [resolv-retry] [infinite]
15 [reneg-sec] [0]
16 [tls-cipher] [TLS-SRP-SHA-RSA-WITH-3DES-EDE-CBC-SHA:TLS-DHE-RSA-WITH-AES-128-C...]
2018-10-02 17:04:59 Contacting 188.104.247.213:11947 via UDP
2018-10-02 17:04:59 Connecting to [markusb68.mine.nu]:11947 (188.104.247.213) via UDPv4
2018-10-02 17:04:59 Tunnel Options:V4,dev-type tun,link-mtu 1558,tun-mtu 1500,proto UDPv4,comp-lzo,cipher AES-256-CBC,auth SHA1,keysize 256,key-method 2,tls-client
2018-10-02 17:04:59 Creds: Username/Password
2018-10-02 17:04:59 Peer Info:
IV_GUI_VER=de.blinkt.openvpn 0.7.6
IV_VER=3.git:master
IV_PLAT=android
IV_NCP=2
IV_TCPNL=1
IV_PROTO=2
IV_LZO=1
2018-10-02 17:05:39 Session invalidated: KEEPALIVE_TIMEOUT
2018-10-02 17:05:39 Client terminated, restarting in 2000 ms...
2018-10-02 17:05:41 Contacting 188.104.247.213:11947 via UDP
2018-10-02 17:05:41 Connecting to [markusb68.mine.nu]:11947 (188.104.247.213) via UDPv4
2018-10-02 17:05:41 Tunnel Options:V4,dev-type tun,link-mtu 1558,tun-mtu 1500,proto UDPv4,comp-lzo,cipher AES-256-CBC,auth SHA1,keysize 256,key-method 2,tls-client
2018-10-02 17:05:41 Creds: Username/Password
2018-10-02 17:05:41 Peer Info:
IV_GUI_VER=de.blinkt.openvpn 0.7.6
IV_VER=3.git:master
IV_PLAT=android
IV_NCP=2
IV_TCPNL=1
IV_PROTO=2
IV_LZO=1

@schwabe
Copy link
Owner

schwabe commented Oct 2, 2018

Strange. It seems that for some reason openvpn3 also does not receive the ping packets (which are also payload packets).

This is also specific to the 32 bit device only? (I.e. does openvpn3 on the Nexus 9 work?).

@markusb68
Copy link

openvpn3 on the Nexus 9 DOESN'T work either.

@ThE-MaRaC
Copy link
Author

ThE-MaRaC commented Oct 3, 2018

When compiled in debug mode (-O0) OpenVPN is working, at least it is working on my phone.
APK: https://drive.google.com/open?id=1oiaWdx-zkimIXM6dWWqXc_e0LvqHu5no
Correction for android/ndk#573 is possible reason why release build is not working.

@schwabe
Copy link
Owner

schwabe commented Oct 24, 2018

the ndk thing is about exception and the whole code is C. SO there are no exception anywhere at all. So it is not that bug.

But there has been minor revision of the NDK and here is a binary compiled with the new version: http://plai.de/android/ics-openvpn-0.7.7pre2.apk

I haven't tested it myself yet.

@schwabe schwabe closed this as completed in f321fe4 Dec 4, 2018
@schwabe
Copy link
Owner

schwabe commented Dec 4, 2018

http://plai.de/android/ics-openvpn-0.7.7pre3.apk version with the workaround in it.

@talwl
Copy link

talwl commented Jan 16, 2019

@ThE-MaRaC Thanks.I met the same problem as you.It may be caused by (android/ndk#573). I try to switch '-Os' from '-Oz', then release build is working.

@schwabe
Copy link
Owner

schwabe commented Jan 16, 2019

the 573 code is only talking about C++ exceptions which are not used at all here.

laschico pushed a commit to laschico/ics-openvpn that referenced this issue Jun 27, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants