emscripten-core / emscripten-core/emscripten

module can't find dyncall_viff

Aperta
#14,802 1 commento 0 reazioni 0 assegnatari Vedi su GitHub
Lingua principale
C++
Stelle
27.6k
Fork
3.6k
Merge medio
1g 14h
PR unite (30g)
125

Descrizione

I'm trying to call a function loaded from a side module, the function takes 1 argument which is a reference to an object.

this is how I call the function in c++ code
```
typedef void (*INITLIBFN)(ApplicationComponents& appComponents);

INITLIBFN initfunc = (INITLIBFN)dlsym((void*)1, "InitGameAssembly");

initfunc(appcomps);
```

at first I got this error :
```
sandbox.js:1819 Uncaught (in promise) TypeError: Cannot read property 'apply' of undefined
at dynCallLegacy (sandbox.js:1819)
at dynCall (sandbox.js:1823)
at sandbox.js:1830
at stubs. (sandbox.js:2019)
at :wasm-function[622]:0x628b2
at :wasm-function[620]:0x62056
at :wasm-function[623]:0x62a87
at SandboxLayer::OnAttach() (sandbox.wasm:0x43d239)
at Akkad::Application::RunImpl() (sandbox.wasm:0x4464f0)
at __original_main (sandbox.wasm:0x43c2e1)
```
after many hours of looking into the module javascript file I found the following in ```dynCallLegacy ```
![dyncall](https://user-images.githubusercontent.com/18310807/128086576-f58dd824-d048-4e94-af79-5950ba66531d.PNG)

it's getting called with signature ```viff``` with dynCall prefix to it.

I looked all around the module for ```dynCall_viff``` which it doesn't exist, the only thing close to it is ```dynCall_vifff``` (with 3 f)

now I don't know what dynCall exactly does and why it is trying to call a function which the module doesn't have.
any idea on how I can fix this mess ?

Guida per i contributori

Apri la guida per i contributori

Direzione di ricerca

Start by tracing the generated sandbox.js dynCallLegacy and dynCall paths shown in the report, then compare the viff signature from the C++ INITLIBFN declaration with the available dynCall_vifff entry. Reproduce the side-module call and verify that the generated runtime resolves the function and completes InitGameAssembly without the undefined apply error.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Valutazione

Stack tecnologico
cpp, javascript, wasm
Ambito
compilers
Tipo di issue
Bug
Difficoltà
4/5
Tempo stimato
3-5 giorni
Stato di attività
Ferma
Chiarezza
Da chiarire
Idoneità per principianti
35/100

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.