mtcp-stack / mtcp

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

Error while using make for mtcp #261

Open Avinash369 opened 4 years ago

Avinash369 commented 4 years ago

Hi, I am trying to run the 4th step from the README to make the mtcp after the ./configure but its giving this error which am not able to understand why is it so.

`make all-recursive make[1]: Entering directory '/home/avinash/mtcp' Making all in mtcp/src make[2]: Entering directory '/home/avinash/mtcp/mtcp/src' CC core.c CC tcp_stream.c CC config.c CC api.c CC eventpoll.c CC socket.c CC pipe.c CC tcp_util.c CC eth_in.c CC ip_in.c CC tcp_in.c CC eth_out.c CC ip_out.c CC tcp_out.c CC arp.c CC timer.c CC cpu.c CC rss.c CC addr_pool.c CC fhash.c CC memory_mgt.c CC logger.c CC debug.c CC tcp_rb_frag_queue.c CC tcp_ring_buffer.c CC tcp_send_buffer.c CC tcp_sb_queue.c CC tcp_stream_queue.c CC psio_module.c CC io_module.c CC dpdk_module.c CC netmap_module.c CC onvm_module.c CC icmp.c cp ./include/mtcp_api.h ../include/mtcp_api.h cp ./include/mtcp_epoll.h ../include/mtcp_epoll.h mkdir -p ../lib ar rvs ../lib/libmtcp.a core.o tcp_stream.o config.o api.o eventpoll.o socket.o pipe.o tcp_util.o eth_in.o ip_in.o tcp_in.o eth_out.o ip_out.o tcp_out.o arp.o timer.o cpu.o rss.o addr_pool.o fhash.o memory_mgt.o logger.o debug.o tcp_rb_frag_queue.o tcp_ring_buffer.o tcp_send_buffer.o tcp_sb_queue.o tcp_stream_queue.o psio_module.o io_module.o dpdk_module.o netmap_module.o onvm_module.o icmp.o ar: creating ../lib/libmtcp.a a - core.o a - tcp_stream.o a - config.o a - api.o a - eventpoll.o a - socket.o a - pipe.o a - tcp_util.o a - eth_in.o a - ip_in.o a - tcp_in.o a - eth_out.o a - ip_out.o a - tcp_out.o a - arp.o a - timer.o a - cpu.o a - rss.o a - addr_pool.o a - fhash.o a - memory_mgt.o a - logger.o a - debug.o a - tcp_rb_frag_queue.o a - tcp_ring_buffer.o a - tcp_send_buffer.o a - tcp_sb_queue.o a - tcp_stream_queue.o a - psio_module.o a - io_module.o a - dpdk_module.o a - netmap_module.o a - onvm_module.o a - icmp.o make[2]: Leaving directory '/home/avinash/mtcp/mtcp/src' Making all in util make[2]: Entering directory '/home/avinash/mtcp/util' CC tdate_parse.c CC http_parsing.c CC netlib.c make[2]: Leaving directory '/home/avinash/mtcp/util' Making all in io_engine/lib make[2]: Entering directory '/home/avinash/mtcp/io_engine/lib' make[2]: Nothing to be done for 'all'. make[2]: Leaving directory '/home/avinash/mtcp/io_engine/lib' Making all in apps/example make[2]: Entering directory '/home/avinash/mtcp/apps/example' CC epserver.c LD epserver.o CC epwget.c epwget.c: In function ‘SendHTTPRequest’: epwget.c:270:36: error: ‘.’ directive output may be truncated writing 1 byte into a region of size between 0 and 128 [-Werror=format-truncation=] snprintf(fname, MAX_FILE_LEN, "%s.%d", outfile, flowcnt++); ^ In file included from /usr/include/stdio.h:867, from epwget.c:1: /usr/include/x86_64-linux-gnu/bits/stdio2.h:67:10: note: ‘builtin___snprintf_chk’ output between 3 and 141 bytes into a destination of size 128 return builtin_snprintf_chk (s, n, USE_FORTIFY_LEVEL - 1, ^~~~~~~~~~~~~~~~ bos (s), fmt, va_arg_pack ());


cc1: all warnings being treated as errors
make[2]: *** [Makefile:83: epwget.o] Error 1
make[2]: Leaving directory '/home/avinash/mtcp/apps/example'
make[1]: *** [Makefile:378: all-recursive] Error 1
make[1]: Leaving directory '/home/avinash/mtcp'
make: *** [Makefile:311: all] Error 2
`
ajamshed commented 4 years ago

@Avinash369,

Apologies for the delayed response. The mTCP library has not been tested with gcc-8. This compiler warning (compiled with-Werror) is being generated due to extended array bound checking in epwget.c. Can you please replace

char fname[MAX_FILE_LEN + MAX_FILE_LEN + 1];

snprintf(fname, MAX_FILE_LEN + MAX_FILE_LEN + 1, "%s.%d", outfile, flowcnt++);

I will check in these corrections in the devel branch soon.