mtcp-stack / mtcp

mTCP: A Highly Scalable User-level TCP Stack for Multicore Systems
Other
1.99k stars 436 forks source link

A bug by static variables in RunMainLoop() #329

Open taehyunkim1527 opened 1 year ago

taehyunkim1527 commented 1 year ago

Dear contributors,

RunMainLoop() in mtcp/src/core.c:761 is supposed to be executed per core, but has static variables, "static uint16_t len, static uint8_t *pktbuf" at line 787 and 788 thereby being not thread-safe and occurring unexpected problems. I think just removing the keyword "static" will be okay. Please consider any changes to fix the problem. Thank you