pyodide: Many many errors when porting code to pyodide

🐛 Bug

Thanks to the amazing help of @ryanking13 and @hoodmane , I was able to start using module sparseqr in a small project of mineusing pyodide.

Of course, I never expected that the transition to pyodide would be easy, but upon running my own code in pyodide, I was surpised to see many different errors pop up. I had never seen most of those errors before, and they are not very reproducible (most likely because the execution of the core relies on a random number generator).

Here is a list of the main error that my code throws, none of which I had ever gotten using conda’s python:

- A weird Lapack/Blas error : "failed in converting 1st argument `x' of _fblas.daxpy to C/Fortran array"
- "RuntimeError: memory access out of bounds" thrown in different places including scipy
- "SystemError: Type does not define the tp_name field."
- "RuntimeError: null function or function signature mismatch"

I must say those errors are so foreign to me I don’t really know where to start. Moreover, they are not very reproducible (even considering the RNG), as the very same call might or might not throw an error.

Of course I’m not asking the Pyodide team to debug my code, but merely to give me a few pointers/ideas where to start.

To Reproduce

Go to https://gabrielfougeron.github.io//choreo/ and click “Choreo Execute!”. Several print statements should appear in the console.

Expected behavior

No errors.

Environment

  • Pyodide Version : pull request #2685 + One extra package of mine
  • Browser version : Chrome 102.0.5005.115
  • Any other relevant information:

I built pyodide myself from pull request #2685

  • Build environment : WSL2

About this issue

  • Original URL
  • State: open
  • Created 2 years ago
  • Comments: 17 (17 by maintainers)

Most upvoted comments

FYI it seems the gcrotmk issue has been fixed by switching to OpenBLAS #3331, at least the snippet from https://github.com/pyodide/pyodide/issues/2727#issuecomment-1158039523 runs fine in the latest console and I can still reproduce the issue with the 0.23.1 console (latest Pyodide release at the time of writing)

It must be due to early memory corruption destroying the Python vm’s data structures.