Sifir-io / react-native-tor

Tor Daemon and Socks5 client for React Native iOS and Android projects!
MIT License
101 stars 16 forks source link

React Native Tor on android freezes #30

Open Overtorment opened 3 years ago

Overtorment commented 3 years ago

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

gabidi commented 3 years ago

Thanks for reporting this will look.

gabidi commented 3 years ago

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.

LechKulesza commented 3 years ago

Current Workaround:

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

This works great! thanks a lot for your help!

gabidi commented 3 years ago

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

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

Overtorment commented 3 years ago

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 commented 3 years ago

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

rkfg commented 3 years ago

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 commented 2 years ago

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 commented 2 years ago

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

cc @marcosrdz

gabidi commented 2 years ago

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

pjw65 commented 2 years ago

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

Workaround:

iamvucms commented 1 year ago

Enabling hermes will help you fix this issue.