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

Version 1.0.1 crashes on start #22

Closed
ewoks opened this issue Apr 13, 2017 · 4 comments
Closed

Version 1.0.1 crashes on start #22

ewoks opened this issue Apr 13, 2017 · 4 comments

Comments

@ewoks
Copy link

ewoks commented Apr 13, 2017

Configuration: macOS, Android 5.0.1, Samsung S4
Steps to reproduce:

  • S4 doesn't have any gnirehtet version installed,
  • in terminal execute: ./gnirehtet rt
    Expected behaviour: App is installed, service started and running.
    Actual behaviour: App crashes on phone. Terminal stays with I Main: Starting server...
    Suspected reason: Low API level. App should support it by specification, no?

Terminal log:

$ ./gnirehtet rt
Installing gnirehtet...
'adb' install -r gnirehtet.apk
gnirehtet.apk: 1 file pushed. 1.0 MB/s (14672 bytes in 0.014s)
	pkg: /data/local/tmp/gnirehtet.apk
Success
Starting gnirehtet...
'adb' reverse tcp:31416 tcp:31416
'adb' shell am startservice -a com.genymobile.gnirehtet.START
Starting service: Intent { act=com.genymobile.gnirehtet.START }
'java' -jar relay.jar
2017-04-13 10:44:58.803 I Main: Starting server...

Logcat:

04-13 10:44:17.664 25142-25142/? E/Zygote: MountEmulatedStorage()
04-13 10:44:17.664 25142-25142/? E/Zygote: v2
04-13 10:44:17.664 25142-25142/? I/libpersona: KNOX_SDCARD checking this for 10406
04-13 10:44:17.664 25142-25142/? I/libpersona: KNOX_SDCARD not a persona
04-13 10:44:17.724 25142-25142/? I/SELinux: Function: selinux_compare_spd_ram, SPD-policy is existed. and_ver=SEPF_GT-I9295_5.0.1 ver=51
04-13 10:44:17.724 25142-25142/? I/SELinux: Function: selinux_compare_spd_ram , priority [2] , priority version is VE=SEPF_GT-I9295_5.0.1-1_0045
04-13 10:44:17.724 25142-25142/? E/SELinux: [DEBUG] get_category: variable seinfo: default sensitivity: NULL, cateogry: NULL
04-13 10:44:17.794 25142-25142/? D/ResourcesManager: creating new AssetManager and set to /data/app/com.genymobile.gnirehtet-1/base.apk
04-13 10:44:17.814 25142-25142/? D/GnirehtetControlService: Received request com.genymobile.gnirehtet.START
04-13 10:44:17.824 25142-25142/? D/GnirehtetControlService: VPN was already authorized
04-13 10:44:17.834 25142-25142/? D/GnirehtetService: Received request com.genymobile.gnirehtet.START_VPN
04-13 10:44:17.844 25142-25142/? W/GnirehtetService: Cannot set underlying network, API version 21 < 22
04-13 10:44:17.844 25142-25142/? D/AndroidRuntime: Shutting down VM
04-13 10:44:17.844 25142-25142/? E/AndroidRuntime: FATAL EXCEPTION: main
                                                   Process: com.genymobile.gnirehtet, PID: 25142
                                                   java.lang.RuntimeException: Unable to start service com.genymobile.gnirehtet.GnirehtetService@3a1c97f3 with Intent { act=com.genymobile.gnirehtet.START_VPN cmp=com.genymobile.gnirehtet/.GnirehtetService (has extras) }: java.lang.NullPointerException: Attempt to invoke virtual method 'java.io.FileDescriptor android.os.ParcelFileDescriptor.getFileDescriptor()' on a null object reference
                                                       at android.app.ActivityThread.handleServiceArgs(ActivityThread.java:3324)
                                                       at android.app.ActivityThread.access$2200(ActivityThread.java:177)
                                                       at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1546)
                                                       at android.os.Handler.dispatchMessage(Handler.java:102)
                                                       at android.os.Looper.loop(Looper.java:145)
                                                       at android.app.ActivityThread.main(ActivityThread.java:5942)
                                                       at java.lang.reflect.Method.invoke(Native Method)
                                                       at java.lang.reflect.Method.invoke(Method.java:372)
                                                       at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1388)
                                                       at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1183)
                                                    Caused by: java.lang.NullPointerException: Attempt to invoke virtual method 'java.io.FileDescriptor android.os.ParcelFileDescriptor.getFileDescriptor()' on a null object reference
                                                       at com.genymobile.gnirehtet.GnirehtetService.startForwarding(GnirehtetService.java:147)
                                                       at com.genymobile.gnirehtet.GnirehtetService.startVpn(GnirehtetService.java:89)
                                                       at com.genymobile.gnirehtet.GnirehtetService.onStartCommand(GnirehtetService.java:75)
                                                       at android.app.ActivityThread.handleServiceArgs(ActivityThread.java:3307)
                                                       at android.app.ActivityThread.access$2200(ActivityThread.java:177) 
                                                       at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1546) 
                                                       at android.os.Handler.dispatchMessage(Handler.java:102) 
                                                       at android.os.Looper.loop(Looper.java:145) 
                                                       at android.app.ActivityThread.main(ActivityThread.java:5942) 
                                                       at java.lang.reflect.Method.invoke(Native Method) 
                                                       at java.lang.reflect.Method.invoke(Method.java:372) 
                                                       at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1388) 
                                                       at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1183) 

@rom1v
Copy link
Collaborator

rom1v commented Apr 13, 2017

The NullPointerException is already fixed in master by commit a2d855d, when establish() returns null.

However, if it always returns null on your device, I don't know what to do…

@ewoks
Copy link
Author

ewoks commented Apr 13, 2017

hmm.. I just uninstall, restarted device and dialog to allow vpn appeared. Does that give a better clue about crash? I can add more logcat of this successful attempt if that is useful

@rom1v
Copy link
Collaborator

rom1v commented Apr 13, 2017

hmm.. I just uninstall, restarted device and dialog to allow vpn appeared.

Great, then it's ok, establish() may return null unexpectedly:

However, this method returns null if the application is not prepared or is revoked. This helps solve possible race conditions between other VPN applications.

And a2d855d handles this case. So it's fixed ;-)

@rom1v rom1v closed this as completed Apr 13, 2017
@ewoks
Copy link
Author

ewoks commented Apr 13, 2017

Cool. Will checkout when you publish new binaries. This is ready for closing in that case ;) Good job once again 👍

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

2 participants