Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug] Infinite loop in tcprewrite at get.c:569 #827

Closed
TimChan2001 opened this issue Sep 23, 2023 · 3 comments · Fixed by #842
Closed

[Bug] Infinite loop in tcprewrite at get.c:569 #827

TimChan2001 opened this issue Sep 23, 2023 · 3 comments · Fixed by #842
Assignees
Labels

Comments

@TimChan2001
Copy link

TimChan2001 commented Sep 23, 2023

Describe the bug
Tcprewrite gets stuck in an infinite loop at the while loop at get.c:569.

To Reproduce
Steps to reproduce the behavior:

  1. export CC=clang && export CFLAGS="-fsanitize=address -g"
  2. ./autogen.sh && ./configure --disable-shared --disable-local-libopts && make clean && make -j8
  3. ./src/tcprewrite -o /dev/null -i POC
    The POC file can be downloaded in POC

Expected behavior
The program continues to run for over a week without termination.
image

System (please complete the following information):

  • OS: Ubuntu
  • OS version: 16.04, 64 bit
  • Tcpreplay Version: 4.4.4

Additional context
After debugging with GDB and adding debug outputs, it seems the program is unable to exit the while loop at get.c:569.

@TimChan2001 TimChan2001 changed the title [Bug] Possible infinite loop in tcprewrite [Bug] Infinite loop in tcprewrite Sep 24, 2023
@TimChan2001 TimChan2001 changed the title [Bug] Infinite loop in tcprewrite [Bug] Infinite loop in tcprewrite at get.c:569 Sep 24, 2023
GabrielGanne added a commit to GabrielGanne/tcpreplay that referenced this issue Jan 21, 2024
@GabrielGanne
Copy link
Contributor

Hi @TimChan2001
I have proposed a small fix for the issue you raised.
I should have tested on the same env you described but got an different error with your pcap first:

Fatal Error: Unable to open input pcap file: unsupported pcap savefile version 60418.4

I had to rewrite it to first and then reproduced the issue.
The fix seems straightforward enough, I expect it will work for you.
BR,

GabrielGanne added a commit to GabrielGanne/tcpreplay that referenced this issue Jan 21, 2024
@fklassen
Copy link
Member

fklassen commented Jun 1, 2024

Not merged yet - reopening

@fklassen fklassen reopened this Jun 1, 2024
fklassen added a commit that referenced this issue Jun 1, 2024
…aging

Bug #827 PR #842 IPv6 extension header -  staging
@fklassen fklassen self-assigned this Jun 1, 2024
@fklassen fklassen added the bug label Jun 1, 2024
@fklassen
Copy link
Member

fklassen commented Jun 1, 2024

fixed in PRs #842 and #859

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
Status: Done
Development

Successfully merging a pull request may close this issue.

3 participants