Is there a way to include debug info?

Ouverte
#146 6 commentaires 0 réactions 0 personnes assignées Voir sur GitHub

Personne n'a encore pris cette issue.

Évaluation

Difficulté
4/5
Temps estimé
3-5 jours
Accessibilité débutants
42/100
Type d'issue
Fonctionnalité
Clarté
Plutôt claire
Activité
À l'abandon
Stack technique
python, rust, wasm

Piste de recherche

Commencez par retracer le chemin de build de componentize-py et la manière dont le .wasm généré est transmis à Wasmtime, en utilisant WasmBacktraceDetails::Enable comme référence pour le débogage. Comparez les contrôles des informations de débogage disponibles à la compilation dans Rust et Go avec les options de componentize-py, puis vérifiez que la backtrace obtenue identifie les fichiers sources d’origine du composant.

Rédigé par le modèle d'indexation à partir du texte de l'issue.

Description

When the .wasm file raises an error, the resulting backtrace does not contain any reference to the original source files (even using wasmtime::WasmBacktraceDetails::Enable).

With Rust and Go components it's possible to use compile-time flags such as --release or -no-debug to control whether debug info is included or not in the .wasm file. So I was wondering if the same would be possible with componentize-py?

Here's an example of the backtrace I get on error (where the only useful reference to my component's code is line 28):

Error: Failed to call component: error while executing at wasm backtrace:
    0: 0xa9b968 - wit-component:adapter:wasi_snapshot_preview1!<wasm function 34>
    1: 0x2230183 - wit-component:shim!adapt-wasi_snapshot_preview1-fd_write
    2: 0x21b2244 - libc.so!__wasi_fd_write
    3: 0x21b1a9f - libc.so!write
    4: 0x14934 - <unknown>!<wasm function 782>
    5: 0xeba24e - _Py_write_impl
                    at /home/runner/work/componentize-py/componentize-py/cpython/builddir/wasi/../../Python/fileutils.c:1962:17              - _Py_write
                    at /home/runner/work/componentize-py/componentize-py/cpython/builddir/wasi/../../Python/fileutils.c:2033:12
    6: 0xf9dffd - _io_FileIO_write_impl
                    at /home/runner/work/componentize-py/componentize-py/cpython/builddir/wasi/../../Modules/_io/fileio.c:874:9              - _io_FileIO_write
                    at /home/runner/work/componentize-py/componentize-py/cpython/builddir/wasi/../../Modules/_io/clinic/fileio.c.h:388:20
    7: 0xd16038 - method_vectorcall_FASTCALL_KEYWORDS_METHOD
                    at /home/runner/work/componentize-py/componentize-py/cpython/builddir/wasi/../../Objects/descrobject.c:387:24
    8: 0xd09540 - _PyObject_VectorcallTstate
                    at /home/runner/work/componentize-py/componentize-py/cpython/builddir/wasi/../../Include/internal/pycore_call.h:92:11              - PyObject_VectorcallMethod
                    at /home/runner/work/componentize-py/componentize-py/cpython/builddir/wasi/../../Objects/call.c:887:24
    9: 0xfab74b - PyObject_CallMethodOneArg
                    at /home/runner/work/componentize-py/componentize-py/cpython/builddir/wasi/../../Include/cpython/abstract.h:103:12              - _textiowrapper_writeflush
                    at /home/runner/work/componentize-py/componentize-py/cpython/builddir/wasi/../../Modules/_io/textio.c:1629:15
   10: 0xfacee3 - _io_TextIOWrapper_write_impl
                    at /home/runner/work/componentize-py/componentize-py/cpython/builddir/wasi/../../Modules/_io/textio.c:1759:13              - _io_TextIOWrapper_write
                    at /home/runner/work/componentize-py/componentize-py/cpython/builddir/wasi/../../Modules/_io/clinic/textio.c.h:680:20
   11: 0xd64d6e - cfunction_vectorcall_O
                    at /home/runner/work/componentize-py/componentize-py/cpython/builddir/wasi/../../Objects/methodobject.c:509:24
   12: 0xd084da - _PyObject_VectorcallTstate
                    at /home/runner/work/componentize-py/componentize-py/cpython/builddir/wasi/../../Include/internal/pycore_call.h:92:11              - PyObject_CallOneArg
                    at /home/runner/work/componentize-py/componentize-py/cpython/builddir/wasi/../../Objects/call.c:401:12
   13: 0xd291f6 - PyFile_WriteObject
                    at /home/runner/work/componentize-py/componentize-py/cpython/builddir/wasi/../../Objects/fileobject.c:132:14
   14: 0xd292e5 - PyFile_WriteString
                    at /home/runner/work/componentize-py/componentize-py/cpython/builddir/wasi/../../Objects/fileobject.c:156:15
   15: 0xeab96b - _Py_WriteIndentedMargin
                    at /home/runner/work/componentize-py/componentize-py/cpython/builddir/wasi/../../Python/traceback.c:430:13              - _PyTraceBack_Print_Indented
                    at /home/runner/work/componentize-py/componentize-py/cpython/builddir/wasi/../../Python/traceback.c:1078:9
   16: 0xe96e54 - print_exception_traceback
                    at /home/runner/work/componentize-py/componentize-py/cpython/builddir/wasi/../../Python/pythonrun.c:911:15              - print_exception
                    at /home/runner/work/componentize-py/componentize-py/cpython/builddir/wasi/../../Python/pythonrun.c:1180:9
   17: 0xe96465 - print_exception_recursive
                    at /home/runner/work/componentize-py/componentize-py/cpython/builddir/wasi/../../Python/pythonrun.c:1474:13
   18: 0xe96122 - _PyErr_Display
                    at /home/runner/work/componentize-py/componentize-py/cpython/builddir/wasi/../../Python/pythonrun.c:1524:9
   19: 0xe9600c - PyErr_Display
                    at /home/runner/work/componentize-py/componentize-py/cpython/builddir/wasi/../../Python/pythonrun.c:1556:5
   20: 0xea872d - sys_excepthook_impl
                    at /home/runner/work/componentize-py/componentize-py/cpython/builddir/wasi/../../Python/sysmodule.c:772:5              - sys_excepthook
                    at /home/runner/work/componentize-py/componentize-py/cpython/builddir/wasi/../../Python/clinic/sysmodule.c.h:102:20
   21: 0xd64ea4 - cfunction_vectorcall_FASTCALL
                    at /home/runner/work/componentize-py/componentize-py/cpython/builddir/wasi/../../Objects/methodobject.c:422:24
   22: 0xd08285 - _PyObject_VectorcallTstate
                    at /home/runner/work/componentize-py/componentize-py/cpython/builddir/wasi/../../Include/internal/pycore_call.h:92:11              - _PyObject_FastCallTstate
                    at /home/runner/work/componentize-py/componentize-py/cpython/builddir/wasi/../../Include/internal/pycore_call.h:116:12              - _PyObject_FastCall
                    at /home/runner/work/componentize-py/componentize-py/cpython/builddir/wasi/../../Objects/call.c:334:12
   23: 0xe94994 - _PyErr_PrintEx
                    at /home/runner/work/componentize-py/componentize-py/cpython/builddir/wasi/../../Python/pythonrun.c:807:28
   24: 0xe96049 - PyErr_PrintEx
                    at /home/runner/work/componentize-py/componentize-py/cpython/builddir/wasi/../../Python/pythonrun.c:845:5
   25: 0x12f52 - <unknown>!<wasm function 291>
   26: 0xaf3c63 - libcomponentize_py_runtime.so!pyo3::err::PyErr::print::hbb86b960398edf90
   27: 0xadda83 - libcomponentize_py_runtime.so!componentize-py#Dispatch
   28: 0x221c1db - libcomponentize_py_bindings.so!edgee:components/data-collection#page-export
Langage dominant
Rust
Étoiles
284
Forks
56
Merge moyen
2 j 4 h
PR mergées (30 j)
3

Préparer son environnement

Par où commencer

  1. Lisez l'issue en entier, puis le guide de contribution du projet.
  2. Signalez en commentaire que vous la prenez — cela évite que deux personnes fassent le même travail.
  3. Forkez le dépôt et travaillez sur une branche.
  4. Ouvrez une pull request qui référence le numéro de l'issue.

Autres issues de bytecodealliance/componentize-py

Toutes les issues de bytecodealliance/componentize-py

Issues similaires

Plus d'issues Rust

Recevez les nouvelles issues par e-mail

Un résumé court des issues GitHub adaptées aux débutants.