eBPFDevSecTools / opened

OPENED Tool to extract specific eBPF functions from large monoliths (tested on Katran, Mizar, Cilium..)
Apache License 2.0
12 stars 6 forks source link

list index out of range when running function_extractor.py #12

Closed Samfisheryu closed 1 year ago

Samfisheryu commented 1 year ago

image after I successfully ran the extraction_runner.py, I got func.out as following (There is only one function because I pick connection_table_lookup which only occurs once in Katran) image Then I tried to run function_extractor.py image It shows error like this image Can I get a sense of what is going on with this?

qthuang commented 1 year ago

The problem is caused by line 311 function-extractor.py. By uncommenting the print("Prossing", line), we found that the parsing does not stop when there is no line needed to be parsed.

截屏2022-12-01 16 18 56
qthuang commented 1 year ago

In the corresponding func.out, there is no line after "reals,/home/ubuntu/opened/code_annotation/Katran.commented_OPENED_katran_balancer_kern.c, 199, 0"

qthuang commented 1 year ago

Also, when extracting some functions, the func.out sometimes have the line

DUPLICATE MAP DEFNS

{#map_name,file_locations } Which also causes IndesError when parsing.

截屏2022-12-01 16 47 56
palanik1 commented 1 year ago

@qthuang This should be fixed...please pull latest code and let us know if it works?