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

Look for "_initialize" only if "_start" not found #2891

Merged

Conversation

eloparco
Copy link
Contributor

@eloparco eloparco commented Dec 9, 2023

A wasm module can be either a command or a reactor, so it can export either _start or _initialize.
Currently, if a command module is run, iwasm still looks for _initialize, resulting in the warning can not find an export 0 named _initialize in the module:

[08:15:00:315 - 1DC30DB40]: Load type section success.

[08:15:00:332 - 1DC30DB40]: Load import section success.

[08:15:00:335 - 1DC30DB40]: Load function section success.

[08:15:00:337 - 1DC30DB40]: Load export section success.

[08:15:00:339 - 1DC30DB40]: Load code segment section success.

[08:15:00:384 - 1DC30DB40]: /Users/eloparco/dev/forks/wasm-micro-runtime/core/iwasm/common/wasm_runtime_common.c, line 5838, can not find an export 0 named _initialize in the module 
[08:15:00:387 - 1DC30DB40]: Load module success.

[08:15:00:401 - 1DC30DB40]: Memory instantiate:
[08:15:00:402 - 1DC30DB40]:   page bytes: 65536, init pages: 1, max pages: 1
[08:15:00:404 - 1DC30DB40]:   heap offset: 65536, heap size: 0

[08:15:00:409 - 1DC30DB40]: Memory instantiate success.

@lum1n0us
Copy link
Collaborator

LGTM.

@wenyongh wenyongh merged commit 6cb2ea4 into bytecodealliance:main Dec 11, 2023
393 checks passed
victoryang00 pushed a commit to victoryang00/wamr-aot-gc-checkpoint-restore that referenced this pull request May 27, 2024
…ytecodealliance#2891)

A wasm module can be either a command or a reactor, so it can export
either `_start` or `_initialize`. Currently, if a command module is run,
`iwasm` still looks for `_initialize`, resulting in the warning:
  `can not find an export 0 named _initialize in the module`.

Change to look for `_initialize` only if `_start` not found to resolve the issue.
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

Successfully merging this pull request may close these issues.

None yet

3 participants