-
Notifications
You must be signed in to change notification settings - Fork 290
Closed
Labels
Description
If pps option with non numerical value is used than tcpreplay crash on "Floating point exception"
cgs@idog-ubuntu:~/workspace/tcpreplay$ src/tcpreplay -i docker0 --pps "abc" tcp.pcap
Warning: May need to run as root to get access to all network interfaces.
Floating point exception (core dumped)
core dump
cgs@idog-ubuntu:~/workspace/tcpreplay$ gdb src/tcpreplay core
GNU gdb (Ubuntu 8.1-0ubuntu3) 8.1.0.20180409-git
Copyright (C) 2018 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law. Type "show copying"
and "show warranty" for details.
This GDB was configured as "x86_64-linux-gnu".
Type "show configuration" for configuration details.
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>.
Find the GDB manual and other documentation resources online at:
<http://www.gnu.org/software/gdb/documentation/>.
For help, type "help".
Type "apropos word" to search for commands related to "word"...
Reading symbols from src/tcpreplay...done.
[New LWP 16760]
Core was generated by src/tcpreplay -i docker0 --pps abc tcp.pcap'.
Program terminated with signal SIGFPE, Arithmetic exception.
#0 calc_sleep_time (ctx=ctx@entry=0x5634a86aa260, pkt_ts_delta=pkt_ts_delta@entry=0x5634a86aab18, time_delta=time_delta@entry=0x5634a86aaaf8, len=len@entry=74,
sp=sp@entry=0x5634a86b9550, counter=counter@entry=2, sent_timestamp=0x5634a86aab08, start_us=1614078095685734, skip_length=0x7ffcca519888) at send_packets.c:1215
1215 COUNTER next_tx_us = (pkts_sent * 1000000) * (60 * 60) / pph;
(gdb) bt
#0 calc_sleep_time (ctx=ctx@entry=0x5634a86aa260, pkt_ts_delta=pkt_ts_delta@entry=0x5634a86aab18, time_delta=time_delta@entry=0x5634a86aaaf8, len=len@entry=74,
sp=sp@entry=0x5634a86b9550, counter=counter@entry=2, sent_timestamp=0x5634a86aab08, start_us=1614078095685734, skip_length=0x7ffcca519888) at send_packets.c:1215
#1 0x00005634a64926b8 in send_packets (ctx=ctx@entry=0x5634a86aa260, pcap=pcap@entry=0x5634a86baf90, idx=idx@entry=0) at send_packets.c:616
#2 0x00005634a6495c46 in replay_file (idx=0, ctx=0x5634a86aa260) at replay.c:182
#3 tcpr_replay_index (ctx=ctx@entry=0x5634a86aa260) at replay.c:59
#4 0x00005634a6495130 in tcpreplay_replay (ctx=0x5634a86aa260) at tcpreplay_api.c:1136
#5 0x00005634a648fd35 in main (argc=1, argv=<optimized out>) at tcpreplay.c:139
divide by 0 in send_packet.c calc_sleep_time()
COUNTER next_tx_us = (pkts_sent * 1000000) * (60 * 60) / pph;
Reactions are currently unavailable