pyodide icon indicating copy to clipboard operation
pyodide copied to clipboard

Update Emscripten to 3.1.15

Open hoodmane opened this issue 3 years ago • 9 comments

hoodmane avatar Jul 02 '22 14:07 hoodmane

Looks like memory corruption in xgboost and opencv @ryanking13...

hoodmane avatar Jul 02 '22 20:07 hoodmane

Hmm, the error message is indirect call signature mismatch, so probably it is emitting an invalid function signature. I'll see what emscripten changed in 3.1.15 release.

There is an error message 0 is not a valid OpCode when building pyodide.asm.js. I don't think this is related to the opencv-python and xgboost failure though.

ryanking13 avatar Jul 03 '22 00:07 ryanking13

the error message is indirect call signature mismatch

I think the bad call is because of earlier memory corruption. In wasm there is no memory protection, you can dereference any number between 0 and the size of the memory (it seems to start out at 20 megabytes). So if stuff is going wrong, you don't see a memory fault. In many cases the first time that it traps is because it tries to call a corrupted function pointer and the signature doesn't match.

hoodmane avatar Jul 03 '22 01:07 hoodmane

I think the bad call is because of earlier memory corruption. In wasm there is no memory protection,

Yeah, it seems like __wasm_call_ctors which is called during the instantiation is corrupted in some reason...

ryanking13 avatar Jul 04 '22 00:07 ryanking13

Since these are both new packages, maybe we should disable them too until we figure out how to make them work with the newer Emscripten? I think it's important to keep the compiler up to date if possible.

hoodmane avatar Jul 06 '22 23:07 hoodmane

Since OpenCV is one of the most requested packages, I would like to include it in 0.21.0 if possible. Maybe we can release 0.21.0 with Emscripten 3.1.14 and then disable those packages in 0.22.0.dev (assuming that we can fix this issue until next next release...)?

ryanking13 avatar Jul 06 '22 23:07 ryanking13

Sounds good.

hoodmane avatar Jul 07 '22 00:07 hoodmane

There have been several EMSDK releases since the PR was created. Could you try 3.1.18? It has 64bit time_t.

tiran avatar Aug 08 '22 10:08 tiran

My guess is that it will still break the two packages. But we may be planning to start only updating Python and Emscripten at the same time once a year until https://github.com/emscripten-core/emscripten/issues/15917 is resolved so maybe it would be worth disabling open-cv and xgboost and then reenabling in 0.21.1 as I suggested above. Or maybe we should wait one more Pyodide release before locking the Emscripten version to the Python version.

hoodmane avatar Aug 08 '22 10:08 hoodmane