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

React Native Tor on android freezes #30

Open
Overtorment opened this issue May 6, 2021 · 12 comments
Open

React Native Tor on android freezes #30

Overtorment opened this issue May 6, 2021 · 12 comments
Labels
help wanted Extra attention is needed

Comments

@Overtorment
Copy link
Contributor

ios seems to run fine (i use ios day-to-day, and using tor electrum causes no issues).

this doesn't look like native bridge clog: I did enable bridge monitor, and I didn't notice anything unusual there - when the freeze happens there is no activity on the bridge, and freeze still happens.
I still think this is some kind of deadlock on android native code inside tor module.
none of our native modules causes a freeze, so this doesn't look like our misuse or smth.

to reproduce it would be best to checkout bluewallet's master https://github.com/BlueWallet/BlueWallet/

BlueWallet/BlueWallet#3079

@gabidi
Copy link
Contributor

gabidi commented May 6, 2021

Thanks for reporting this will look.

@gabidi gabidi changed the title Socket on android causes freezes React Native Tor on android freezes Aug 2, 2021
@gabidi
Copy link
Contributor

gabidi commented Aug 2, 2021

Copied from BlueWallet/BlueWallet#3079 (comment)

Issue

React native Tor hangs on React Native's default JS engine.

For some reason RN's rendering thread just silently fails with no errors in logs etc. Note that the main thread still works fine and that's why Scroll views still work even after this issues happens (Scroll views run on the main thread).
At this time the solution that seems to work is to change to RN V8 which runs smoothly.

In true trolling bug fashion when you attempt to debug the issue using Chrome the bug will never happen, which at first seemed like a massive troll but eventually you realize that chrome runs v8 XD

Current Workaround:

Install react native v8 https://github.com/Kudo/react-native-v8

Desired Solution

Would appreciate anyone's input on how to fix this on React Native's default JS engine.

@gabidi gabidi added the help wanted Extra attention is needed label Aug 2, 2021
@LechKulesza
Copy link

Current Workaround:

Install react native v8 https://github.com/Kudo/react-native-v8

This works great! thanks a lot for your help!

@gabidi
Copy link
Contributor

gabidi commented Aug 11, 2021

Changing module architecture to JSI could be a possible solution (avoid bridge):

https://formidable.com/blog/2019/lean-core-part-4/

@Overtorment
Copy link
Contributor Author

there is even a fresh guide https://blog.notesnook.com/getting-started-react-native-jsi/
to my understanding, @gabidi you will have to make it happen on your side

@gabidi
Copy link
Contributor

gabidi commented Aug 11, 2021

@Overtorment yes it is. Will explore it this weekend.

@rkfg
Copy link

rkfg commented Nov 9, 2021

Any updates on this? It's quite a blocker for using BlueWallet with a Tor-only node. And nodes that only available through Tor are quite common because not many ISPs provide IPv6, and WAN IPv4 are scarce, many individual customers are behind CGNAT and have no other choice.

@gabidi
Copy link
Contributor

gabidi commented Dec 4, 2021

WIP: it's quite a bit of work to get it refactored and working as JSI c++ module .
I think in finally got the tough part working , now it's about cleaning up and testing. Hopefully this is it :)

@Overtorment
Copy link
Contributor Author

great news? is that a commit we can actually start testing in BW?

cc @marcosrdz

@gabidi
Copy link
Contributor

gabidi commented Dec 4, 2021

@Overtorment no still needs cleanup and update will ping you when android is testable. (1-2 days)

@pjw65
Copy link

pjw65 commented Feb 7, 2022

BlueWallet 6.2.17 freezes/crashes on Android 11 when using custom electrum server (umbrel) over internal tor.

Workaround:

  • Settings/Network/Tor disable
  • Orbot VPN (add Apps/BlueWallet)

@iamvucms
Copy link

iamvucms commented Nov 23, 2022

Enabling hermes will help you fix this issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

6 participants