question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

We have Polkadot.js integrated in react-native, but it crashes under iOS 11.

It should be that iOS 11 isn’t compatible with wasm. Can we don’t use wasm? Or is there a way to make it compatible?

Here is the log:

Crashed: com.facebook.react.JavaScript
0  JavaScriptCore                 0x18bee82e4 JSC::ExecutableAllocator::allocate(unsigned long, void*, JSC::JITCompilationEffort) + 644
1  JavaScriptCore                 0x18bee82e4 JSC::ExecutableAllocator::allocate(unsigned long, void*, JSC::JITCompilationEffort) + 644
2  JavaScriptCore                 0x18c1501dc JSC::LinkBuffer::allocate(JSC::MacroAssembler&, void*, JSC::JITCompilationEffort) + 256
3  JavaScriptCore                 0x18c14f8b4 void JSC::LinkBuffer::copyCompactAndLinkCode<unsigned int>(JSC::MacroAssembler&, void*, JSC::JITCompilationEffort) + 60
4  JavaScriptCore                 0x18c14f7c4 JSC::LinkBuffer::linkCode(JSC::MacroAssembler&, void*, JSC::JITCompilationEffort) + 56
5  JavaScriptCore                 0x18c3208e4 JSC::Wasm::throwExceptionFromWasmThunkGenerator(WTF::AbstractLocker const&) + 764
6  JavaScriptCore                 0x18c320e48 JSC::Wasm::Thunks::stub(WTF::AbstractLocker const&, JSC::MacroAssemblerCodeRef (*)(WTF::AbstractLocker const&)) + 120
7  JavaScriptCore                 0x18c321210 JSC::Wasm::Thunks::stub(JSC::MacroAssemblerCodeRef (*)(WTF::AbstractLocker const&)) + 92
8  JavaScriptCore                 0x18c308b14 JSC::Wasm::Memory::create(JSC::VM&, JSC::Wasm::PageCount, JSC::Wasm::PageCount) + 96
9  JavaScriptCore                 0x18c119540 JSC::JSWebAssemblyInstance::create(JSC::VM&, JSC::ExecState*, JSC::JSWebAssemblyModule*, JSC::JSObject*, JSC::Structure*) + 3020
10 JavaScriptCore                 0x18c342aec JSC::instantiate(JSC::VM&, JSC::ExecState*, JSC::JSPromiseDeferred*, JSC::JSWebAssemblyModule*, JSC::JSObject*, JSC::Resolve) + 116
11 JavaScriptCore                 0x18c2438ac JSC::PromiseDeferredTimer::doWork() + 524
12 JavaScriptCore                 0x18c0d3d70 JSC::JSRunLoopTimer::timerDidFireCallback(__CFRunLoopTimer*, void*) + 76
13 CoreFoundation                 0x184fc3dc0 __CFRUNLOOP_IS_CALLING_OUT_TO_A_TIMER_CALLBACK_FUNCTION__ + 28
14 CoreFoundation                 0x184fc3ae4 __CFRunLoopDoTimer + 864
15 CoreFoundation                 0x184fc32e4 __CFRunLoopDoTimers + 248
16 CoreFoundation                 0x184fc0ecc __CFRunLoopRun + 1928
17 CoreFoundation                 0x184ee0c58 CFRunLoopRunSpecific + 436
18 React                          0x102655b2c +[RCTCxxBridge runRunLoop] + 264
19 Foundation                     0x185a170f4 __NSThread__start__ + 996
20 libsystem_pthread.dylib        0x184c442b4 _pthread_body + 308
21 libsystem_pthread.dylib        0x184c44180 _pthread_body + 310
22 libsystem_pthread.dylib        0x184c42b74 thread_start + 4

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Reactions:1
  • Comments:9 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
jacogrcommented, Nov 3, 2020

From 2.0 onwards (in beta as of now), you can do the following to ensure it always takes the asm.js path on RN. In package.json -

"react-native": {
  "@polkadot/wasm-crypto/wasm/bytes": "@polkadot/wasm-crypto/wasm/bytes-empty"
}

This basically instructs the init path to supply empty WASM bytes, which will skip that path and go into fallback immediately. By default it, regardless of platform, it will still try WASM and if it fails, will fallback to asm (if available), that doesn’t change. With the above you can force it to only use asm.js in all cases.

(The package already applies an wasm/asm-empty -> wasm/asm mapping on RN, as linked above - however that can be applied on other plaforms as well should you wish to use the asm.js version as fallback, or to skip WASM completely as above)

0reactions
polkadot-js-botcommented, May 31, 2021

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue if you think you have a related problem or query.

Read more comments on GitHub >

github_iconTop Results From Across the Web

iPhone 11 randomly crashes and gets stuck on black screen ...
First solution: Force restart your iPhone 11. ; Quickly press then release the Volume Up key. ; Quickly press then release the Volume...
Read more >
App crashes on iOS 11 Beta 4 becau… - Apple Developer
My app crashes because we used a class name of "Event" and Apple introduced this class in iOS 11 Beta in the SymptomAnalytics...
Read more >
6 Ways to Fix iPhone 11 Crashing - iMyFone
1. The Best Way to Fix iPhone 11 Crashing without Any Data Loss · 2. Force Restart · 3. Free Up Some Space...
Read more >
Fixed iPhone Apps Keep Crashing After iOS 16.2 Update in ...
iPhone Apps Keep Crashing Problems and Troubleshooting Tips: iPhone, iPad · 1st: Check for possible updates in iOS and Apps · 2nd: Force...
Read more >
Apps crash on iPhone 11? Here's how to fix iOS apps that ...
Fixing an iPhone 11 with iOS apps that keeps crashing · First solution: Perform the Forced Restart on your iPhone 11 · Second...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found