FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

x86 crashes · Issue #29 · OttyLab/BitZenyAndroidMiningLibrary · GitHub

Repository navigation

x86 crashes #29

Description

07-04 13:50:24.641 15470-15470/com.example.ottylab.bitzenyminer E/AndroidRuntime: FATAL EXCEPTION: main
                                                                                  Process: com.example.ottylab.bitzenyminer, PID: 15470
                                                                                  java.lang.UnsatisfiedLinkError: dlopen failed: /data/app/com.example.ottylab.bitzenyminer-1/lib/x86/libbitzenymininglibrary.so: has text relocations
                                                                                      at java.lang.Runtime.loadLibrary0(Runtime.java:989)
                                                                                      at java.lang.System.loadLibrary(System.java:1530)
                                                                                      at com.example.ottylab.bitzenymininglibrary.BitZenyMiningLibrary.<clinit>(BitZenyMiningLibrary.java:11)
                                                                                      at com.example.ottylab.bitzenyminer.MainActivity.onCreate(MainActivity.java:70)
                                                                                      at android.app.Activity.performCreate(Activity.java:6679)
                                                                                      at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1118)
                                                                                      at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2618)
                                                                                      at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2726)
                                                                                      at android.app.ActivityThread.-wrap12(ActivityThread.java)
                                                                                      at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1477)
                                                                                      at android.os.Handler.dispatchMessage(Handler.java:102)
                                                                                      at android.os.Looper.loop(Looper.java:154)
                                                                                      at android.app.ActivityThread.main(ActivityThread.java:6119)
                                                                                      at java.lang.reflect.Method.invoke(Native Method)
                                                                                      at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:886)
                                                                                      at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:776)

Activity

  1. OttyLab commented on Jul 5, 2018

    OwnerAuthor

    Currently, x86 library includes TEXTREL entry in it. From Android API23, TEXTREL is prohibited and crash happens.

    To fix this issue, there's 3 approaches

    1. Fix SHA2-x86.S to support position independent code
    2. Do not use SHA2-x86.S
    3. Change target API to 22 (lollipop)

    I'll try 1. first.

  2. OttyLab commented on Jul 16, 2018

    OwnerAuthor

    sha2-x86.S includes .data like this;

    	.data
    	.p2align 7
    sha256_4h:
    	.long 0x6a09e667, 0x6a09e667, 0x6a09e667, 0x6a09e667
    	.long 0xbb67ae85, 0xbb67ae85, 0xbb67ae85, 0xbb67ae85
    	.long 0x3c6ef372, 0x3c6ef372, 0x3c6ef372, 0x3c6ef372
    	.long 0xa54ff53a, 0xa54ff53a, 0xa54ff53a, 0xa54ff53a
    	.long 0x510e527f, 0x510e527f, 0x510e527f, 0x510e527f
    	.long 0x9b05688c, 0x9b05688c, 0x9b05688c, 0x9b05688c
    	.long 0x1f83d9ab, 0x1f83d9ab, 0x1f83d9ab, 0x1f83d9ab
    	.long 0x5be0cd19, 0x5be0cd19, 0x5be0cd19, 0x5be0cd19
    

    Accessing .data code will produce TEXTREL and Android OS refuses to load.

    As a fix, I propose that pushing all data into stack on the exposed function call, then popping all data on return.

  3. added 2 commits that reference this issue on Jul 16, 2018
  4. OttyLab commented on Jul 16, 2018

    OwnerAuthor

    @cryptozeny

    master branch merges a workaround for x86. If you have time, could you try it ? (git submodule deinit is required, I suppose)

    In this workaround, sha2-x86.S is not used (approach 2.). yescrypt does not use this, so there's no performance impact on bitzeny mining.

    Fixing the assembly code would take much time. When I have time, I'll try.

  5. cryptozeny commented on Jul 17, 2018

    great! i will try it sooner. now i am upgradig cpuminer yescrypt0.5 to yesPower0.5. it boosts hashrate about 3~10%. could you update the cpuminer after its upgrading? 😅

  6. OttyLab commented on Jul 18, 2018

    OwnerAuthor

    @cryptozeny

    Of course. Which code base can I use?

    (At least, I need to change the code base from https://github.com/bitzeny/cpuminer to https://github.com/BitzenyCoreDevelopers/cpuminer 😄 )

  7. added 2 commits that reference this issue on Jul 22, 2018
  8. OttyLab commented on Jul 22, 2018

    OwnerAuthor

    @cryptozeny

    I've updated the assembly code and master branch fixes the x86 issue. If you find some issue, please let me know.

    (I must admit that the assembly code is not efficient because it needs to push some values to the stack and it would affect performance.)

  9. OttyLab commented on Jul 24, 2018

    OwnerAuthor

    #32 replaces the cpuminer library

  10. cryptozeny commented on Jul 25, 2018

    sorry for late answer 😅 now i am working on cpuminer-yesPower and its almost done. it boosts 2~10% hash. currently it based on macchky's one. i think its not so far from yours. can it be merged into this app?

  11. cryptozeny commented on Jul 25, 2018

    sadly new yespower doesn't support 32bit arv7l (no neon arm), however the dev of yespower said it will be supported next release. also my cpuminer support both of yespower and old yescrypt.

  12. cryptozeny commented on Jul 25, 2018

    https://gist.github.com/cryptozeny/a249d37066fd84b15b3dc1273558520e

    and it supports also another coin such as yenten, koto, wavi using yescrypt.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions


      Back | FazBrowse Home | New Git URL