Comments (2)
To update this issue, after introducing logic to properly handle whether a file is a header or source,
I was then met with this error output:
[ERROR] [error] neighborhood not found
[ERROR] Seg Code: func
[ERROR] PA: /dirs/iotop-c-a/src/iotop.h-humanize_val
[ERROR] PB: /dirs/iotop-c-b/src/iotop.h-humanize_val
[ERROR] PC: /dirs/iotop-c-c/src/iotop.h-turn_into_human_value
[ERROR] Transformation Failed
[ERROR] unable to evolve the code
[ERROR] Crash during evaluate code slices, after 0.082 minutes.
[ERROR] Transformation Failed
[ERROR] Error. Exiting...
[ERROR] Unexpected error during evaluate code slices.
[ERROR] Runtime Error
[ERROR] Error. Exiting...
The logic I introduced was simply:
def determine_splitter_from_filepath(fp: str) -> str:
if ".c." in fp:
return ".c."
if ".h." in fp:
return ".h."
raise Exception(f'could not determine how to split path: "{fp}"')
Which would then be used like
def generate_slice_for_vector(vector_path, use_macro=False):
# ...
splitter = determine_splitter_from_filepath(vector_path)
source_file, segment = vector_path.split(splitter)
# ...
from fixmorph.
Here's the patch in question that caused this:
The "upstream patch" being backported:
diff --git a/src/iotop.h b/src/iotop.h
index 0048a59..64175c7 100644
--- a/src/iotop.h
+++ b/src/iotop.h
@@ -261,7 +261,7 @@ inline void arr_sort(struct xxxid_stats_arr *pa,int (*cb)(const void *a,const vo
inline void calc_total(struct xxxid_stats_arr *cs,double *read,double *write);
inline void calc_a_total(struct act_stats *act,double *read,double *write,double time_s);
-inline void humanize_val(double *value,char *str,int allow_accum);
+inline void humanize_val(double *value,char *str,int allow_accum, char *dummy_var);
inline int iotop_sort_cb(const void *a,const void *b);
inline int create_diff(struct xxxid_stats_arr *cs,struct xxxid_stats_arr *ps,double time_s,uint64_t ts_c,filter_callback_w cb,int width,int *cnt);
inline int value2scale(double val,double mx);
diff --git a/src/view_batch.c b/src/view_batch.c
index 62dc3b8..0f83b9c 100644
--- a/src/view_batch.c
+++ b/src/view_batch.c
@@ -30,10 +30,10 @@ static inline void view_batch(struct xxxid_stats_arr *cs,struct xxxid_stats_arr
calc_total(cs,&total_read,&total_write);
calc_a_total(act,&total_a_read,&total_a_write,time_s);
- humanize_val(&total_read,str_read,1);
- humanize_val(&total_write,str_write,1);
- humanize_val(&total_a_read,str_a_read,0);
- humanize_val(&total_a_write,str_a_write,0);
+ humanize_val(&total_read,str_read,1, "");
+ humanize_val(&total_write,str_write,1, "");
+ humanize_val(&total_a_read,str_a_read,0, "");
+ humanize_val(&total_a_write,str_a_write,0, "");
printf(HEADER1_FORMAT,total_read,str_read,"",total_write,str_write,"");
@@ -77,8 +77,8 @@ static inline void view_batch(struct xxxid_stats_arr *cs,struct xxxid_stats_arr
if (s->exited) // do not show exited processes in batch view
continue;
- humanize_val(&read_val,read_str,1);
- humanize_val(&write_val,write_str,1);
+ humanize_val(&read_val,read_str,1, "");
+ humanize_val(&write_val,write_str,1, "");
pw_name=u8strpadt(s->pw_name,10);
diff --git a/src/view_curses.c b/src/view_curses.c
index c2334e4..f1a87f5 100644
--- a/src/view_curses.c
+++ b/src/view_curses.c
@@ -733,10 +733,10 @@ static inline void view_curses(struct xxxid_stats_arr *cs,struct xxxid_stats_arr
hist_a_w[0]=total_a_write;
}
- humanize_val(&total_read,str_read,1);
- humanize_val(&total_write,str_write,1);
- humanize_val(&total_a_read,str_a_read,0);
- humanize_val(&total_a_write,str_a_write,0);
+ humanize_val(&total_read,str_read,1, "");
+ humanize_val(&total_write,str_write,1, "");
+ humanize_val(&total_a_read,str_a_read,0, "");
+ humanize_val(&total_a_write,str_a_write,0, "");
gr_width_h=gr_width;
if (maxy<10||maxx<(int)strlen(HEADER1_FORMAT)+2*(7-5+3-2+(!config.f.hidegraph?gr_width_h+1:0)-2)) {
@@ -1066,8 +1066,8 @@ static inline void view_curses(struct xxxid_stats_arr *cs,struct xxxid_stats_arr
write_val=s->write_val;
}
- humanize_val(&read_val,read_str,1);
- humanize_val(&write_val,write_str,1);
+ humanize_val(&read_val,read_str,1, "");
+ humanize_val(&write_val,write_str,1, "");
pwt=esc_low_ascii(s->pw_name);
pw_name=u8strpadt(pwt,9);
diff --git a/src/views.c b/src/views.c
index 78bc076..9e1a3d1 100644
--- a/src/views.c
+++ b/src/views.c
@@ -213,7 +213,8 @@ inline int create_diff(struct xxxid_stats_arr *cs,struct xxxid_stats_arr *ps,dou
return cs->length;
}
-inline void humanize_val(double *value,char *str,int allow_accum) {
+inline void humanize_val(double *value,char *str,int allow_accum, char *dummy_var) {
+ printf("dummy var: %s\n", dummy_var);
const char *u="BKMGTPEZY";
size_t p=0;
Patch that generated the "downstream":
diff --git a/src/iotop.h b/src/iotop.h
index 0048a59..ec95b26 100644
--- a/src/iotop.h
+++ b/src/iotop.h
@@ -261,7 +261,7 @@ inline void arr_sort(struct xxxid_stats_arr *pa,int (*cb)(const void *a,const vo
inline void calc_total(struct xxxid_stats_arr *cs,double *read,double *write);
inline void calc_a_total(struct act_stats *act,double *read,double *write,double time_s);
-inline void humanize_val(double *value,char *str,int allow_accum);
+inline void turn_into_human_value(double *value,char *str,int allow_accum);
inline int iotop_sort_cb(const void *a,const void *b);
inline int create_diff(struct xxxid_stats_arr *cs,struct xxxid_stats_arr *ps,double time_s,uint64_t ts_c,filter_callback_w cb,int width,int *cnt);
inline int value2scale(double val,double mx);
diff --git a/src/view_batch.c b/src/view_batch.c
index 62dc3b8..408b8c0 100644
--- a/src/view_batch.c
+++ b/src/view_batch.c
@@ -30,10 +30,10 @@ static inline void view_batch(struct xxxid_stats_arr *cs,struct xxxid_stats_arr
calc_total(cs,&total_read,&total_write);
calc_a_total(act,&total_a_read,&total_a_write,time_s);
- humanize_val(&total_read,str_read,1);
- humanize_val(&total_write,str_write,1);
- humanize_val(&total_a_read,str_a_read,0);
- humanize_val(&total_a_write,str_a_write,0);
+ turn_into_human_value(&total_read,str_read,1);
+ turn_into_human_value(&total_write,str_write,1);
+ turn_into_human_value(&total_a_read,str_a_read,0);
+ turn_into_human_value(&total_a_write,str_a_write,0);
printf(HEADER1_FORMAT,total_read,str_read,"",total_write,str_write,"");
@@ -77,8 +77,8 @@ static inline void view_batch(struct xxxid_stats_arr *cs,struct xxxid_stats_arr
if (s->exited) // do not show exited processes in batch view
continue;
- humanize_val(&read_val,read_str,1);
- humanize_val(&write_val,write_str,1);
+ turn_into_human_value(&read_val,read_str,1);
+ turn_into_human_value(&write_val,write_str,1);
pw_name=u8strpadt(s->pw_name,10);
diff --git a/src/view_curses.c b/src/view_curses.c
index c2334e4..96df5b6 100644
--- a/src/view_curses.c
+++ b/src/view_curses.c
@@ -733,10 +733,10 @@ static inline void view_curses(struct xxxid_stats_arr *cs,struct xxxid_stats_arr
hist_a_w[0]=total_a_write;
}
- humanize_val(&total_read,str_read,1);
- humanize_val(&total_write,str_write,1);
- humanize_val(&total_a_read,str_a_read,0);
- humanize_val(&total_a_write,str_a_write,0);
+ turn_into_human_value(&total_read,str_read,1);
+ turn_into_human_value(&total_write,str_write,1);
+ turn_into_human_value(&total_a_read,str_a_read,0);
+ turn_into_human_value(&total_a_write,str_a_write,0);
gr_width_h=gr_width;
if (maxy<10||maxx<(int)strlen(HEADER1_FORMAT)+2*(7-5+3-2+(!config.f.hidegraph?gr_width_h+1:0)-2)) {
@@ -1066,8 +1066,8 @@ static inline void view_curses(struct xxxid_stats_arr *cs,struct xxxid_stats_arr
write_val=s->write_val;
}
- humanize_val(&read_val,read_str,1);
- humanize_val(&write_val,write_str,1);
+ turn_into_human_value(&read_val,read_str,1);
+ turn_into_human_value(&write_val,write_str,1);
pwt=esc_low_ascii(s->pw_name);
pw_name=u8strpadt(pwt,9);
diff --git a/src/views.c b/src/views.c
index 78bc076..3927b73 100644
--- a/src/views.c
+++ b/src/views.c
@@ -213,7 +213,7 @@ inline int create_diff(struct xxxid_stats_arr *cs,struct xxxid_stats_arr *ps,dou
return cs->length;
}
-inline void humanize_val(double *value,char *str,int allow_accum) {
+inline void turn_into_human_value(double *value,char *str,int allow_accum) {
const char *u="BKMGTPEZY";
size_t p=0;
from fixmorph.
Related Issues (9)
- Construction of string literals without using plus operators
- Fix documentation example for unified diffs HOT 1
- can't find SYDIT code for c
- Run error
- Issue with Dockerfile HOT 2
- Unexpected error during evaluating code slices: 'double' HOT 3
- Generated Patch Includes Extra Parenthesis
- Dockerize Artifacts HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from fixmorph.