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

airodump-ng: fix hang on quit while GPSD is down or no device messages appear #2277

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

n0w1re
Copy link
Contributor

@n0w1re n0w1re commented Nov 8, 2021

When airodump-ng is exiting, the main thread waits for the gps thread to finnish when the exit flag is set.
If GPSD is not delivering any message to the connected socket, that thread hangs in a blocking recv call until some data is received, possibly indefinitely so the program doesn't exit.

Fix:

  • a select waits for available data on the socket before recv is called
  • when the select timeouts every 500ms the global exit flag is checked
  • both code paths for newer JSON based and old non-JSON based GPSD are fixed

This PR fixes #2276

@jbenden
Copy link
Collaborator

jbenden commented Nov 8, 2021

Hi, could you please rebase from master and push PR again? Changes were made to fix macOS and the PVS-Studio analyzer. Thanks!

@timg11
Copy link

timg11 commented Mar 11, 2023

I just installed Airodump-ng 1.7 rev d5cb150 in a new Ubuntu 22.10 system, and I'm seeing this issue. Has the fix-quitgpsdhang branch from 2 years ago not yet been merged? Or is the Ubuntu repository installed with sudo apt install aircrack-ng out of date?

@Mister-X-
Copy link
Collaborator

Considering the PR is still open, that means it hasn't been merged.

This needs some testing as it seem to affect more than just GPSd:

  • Testing current, and reproducing this bug
  • Testing current, without GPS, but with airserv-ng, with 1. capture only, 2. injection only, 3. capture and injection, and 4. multiple users
  • Same as above, with GPSd as well.
  • Repeat all of the above testing with this patch applied to see it fixes GPSd, and that it doesn't break other things.

If you have time to do that testing, that would greatly help us.

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

Successfully merging this pull request may close these issues.

Airodump-ng: Hangs when quitting while GPSD is down or no device messages appear
4 participants