Skip to content
This repository has been archived by the owner on Apr 4, 2023. It is now read-only.

Getting issue while creating the CFG for few of Wasm modules #93

Open
tareq97-zz opened this issue Aug 10, 2020 · 4 comments
Open

Getting issue while creating the CFG for few of Wasm modules #93

tareq97-zz opened this issue Aug 10, 2020 · 4 comments
Labels
bug Something isn't working

Comments

@tareq97-zz
Copy link

Hi @satabin,

While accessing the CFG for the attached Wasm modules getting the below mentioned error in the screenshot.

cfg_issue

Please find the attached document which provides more information on the error and the position at which the error is caused in Swam.
Issues_with_CFG_Swam (4) (2).pdf.

Also, please find the wasm modules for which the issue is
data_issue.zip
detected.

Note: Also wanted to inform that, the issue is caused after filtering all the Wasi methods and while creating the CFG for the methods which are not injected by wasi, but the actual methods of the WebAssembly modules.

@satabin satabin added the bug Something isn't working label Aug 11, 2020
@satabin
Copy link
Owner

satabin commented Aug 11, 2020

Hi @tareq97 thanks for reporting this. I will investigate what could cause this.

@satabin
Copy link
Owner

satabin commented Aug 11, 2020

Could you provide the code snippet causing this exception?

@tareq97-zz
Copy link
Author

issue_script.zip

Hi @satabin ,

I was able to create the same issue with scala script present inside zip file attached at the function id = 5.

Let me know if this helps.

@tareq97-zz
Copy link
Author

tareq97-zz commented Aug 13, 2020

Hi @satabin ,

Please find below code snippets where the issue is found.

The issue in the script Found at this code snippet: https://github.com/tareq97/swam/blob/db1b9fc297c62d66d115143a0760fd0ab9f59f23/fibo_cfg.sc#L25

finalArray(idx) = BasicBlock(id2postorder(id), name, stmts, jump.map(rejump))(bb.predecessors.map(id2postorder))

Issue found at the above line.

The size of the below-mentioned array and hashmap should be the same. But they are not same while trying to make the CFG for this data https://github.com/tareq97/swam/blob/origin/feature/opt-in/Largest_number_divisible_by_its_digits.wasm for the function id = 5.

Below mentioned is the printed size of array and hashmap.

This is finalArray size : 412
This is Hash map id2postorder size : 408

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants