Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Reading section failed #128

Open
eyalk11 opened this issue Oct 23, 2021 · 1 comment
Open

Reading section failed #128

eyalk11 opened this issue Oct 23, 2021 · 1 comment

Comments

@eyalk11
Copy link

eyalk11 commented Oct 23, 2021

Hi,
I tried to load an existing WASM module (maybe a bit unusual module, I don't know).

<ipython-input-5-a1926f0a6fca> in <module>
----> 1 wasm.Module(open(r'/home/ekarni/pyodide/addlibs/__loader.wasm','rb'))

~/.pyenv/versions/3.9.6/lib/python3.9/site-packages/ppci/wasm/components.py in __init__(self, *input)
    109             elif hasattr(arg, "read"):
    110                 assert not hasattr(arg, "read_module")
--> 111                 return self._from_file(arg)
    112
    113         # Else, more direct instantiation

~/.pyenv/versions/3.9.6/lib/python3.9/site-packages/ppci/wasm/components.py in _from_file(self, f)
    248
    249         reader = BinaryFileReader(f)
--> 250         reader.read_module(self)
    251
    252     def to_string(self):

~/.pyenv/versions/3.9.6/lib/python3.9/site-packages/ppci/wasm/binary/reader.py in read_module(self, module)
     58             section_data = self.read_length_prefixed_bytes()
     59             with self.push_data(section_data):
---> 60                 self.read_section(section_id)
     61
     62         logger.info(

~/.pyenv/versions/3.9.6/lib/python3.9/site-packages/ppci/wasm/binary/reader.py in read_section(self, section_id)
     69     def read_section(self, section_id):
     70         """ Process a single section. """
---> 71         section_name = self._section_id_to_name[section_id]
     72         logger.debug("Loading %s section", section_name)
     73

KeyError: 12

A very simple module does work. This module was compiled by emcc.
I can upload it.

@eyalk11
Copy link
Author

eyalk11 commented Oct 23, 2021

__loader.zip

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant