react-native-tor icon indicating copy to clipboard operation
react-native-tor copied to clipboard

React Native Tor on android freezes

Open Overtorment opened this issue 3 years ago • 12 comments

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/

https://github.com/BlueWallet/BlueWallet/issues/3079

Overtorment avatar May 06 '21 18:05 Overtorment

Thanks for reporting this will look.

gabidi avatar May 06 '21 18:05 gabidi

Copied from https://github.com/BlueWallet/BlueWallet/issues/3079#issuecomment-870105969

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 avatar Aug 02 '21 14:08 gabidi

Current Workaround:

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

This works great! thanks a lot for your help!

LechKulesza avatar Aug 02 '21 16:08 LechKulesza

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

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

gabidi avatar Aug 11 '21 13:08 gabidi

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

Overtorment avatar Aug 11 '21 15:08 Overtorment

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

gabidi avatar Aug 11 '21 21:08 gabidi

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.

rkfg avatar Nov 09 '21 15:11 rkfg

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 :)

gabidi avatar Dec 04 '21 00:12 gabidi

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

cc @marcosrdz

Overtorment avatar Dec 04 '21 11:12 Overtorment

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

gabidi avatar Dec 04 '21 12:12 gabidi

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)

pjw65 avatar Feb 07 '22 05:02 pjw65

Enabling hermes will help you fix this issue.

iamvucms avatar Nov 23 '22 02:11 iamvucms