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.

Many many errors when porting code to pyodide

See original GitHub issue

🐛 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

Issue Analytics

  • State:open
  • Created a year ago
  • Comments:15 (15 by maintainers)

github_iconTop GitHub Comments

1reaction
hoodmanecommented, Jun 16, 2022

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

0reactions
rthcommented, Jun 20, 2022

Thanks to Hood for fixing this issue in https://github.com/pyodide/pyodide/pull/2728 So it looks like this fix should improve scipy.sparse support significantly https://github.com/pyodide/pyodide/pull/2728#issuecomment-1158010553

Read more comments on GitHub >

github_iconTop Results From Across the Web

Release 0.21.3 unknown - Pyodide
Pyodide is a port of CPython to WebAssembly/Emscripten. Pyodide makes it possible to install and run Python packages in the browser with ...
Read more >
Release 0.19.1 unknown - Pyodide
Pyodide is a port of CPython to WebAssembly/Emscripten. Pyodide makes it possible to install and run Python packages in the browser with ...
Read more >
Pyodide — Version 0.21.3
Pyodide is a port of CPython to WebAssembly/Emscripten. Pyodide makes it possible to install and run Python packages in the browser with micropip....
Read more >
Release 0.17.0a2 Mozilla - Pyodide
It takes as input a string of Python code. If the code ... port = 8000 ... Multiple packages can also be loaded...
Read more >
Pyodide - Release 0.20.0 unknown
Many packages with C extensions have also been ported for use with ... example the following code will return the version string as...
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