bugGPSD - Bugs: bug #43088, gps_sock_mainloop() does not...

 
 

bug #43088: gps_sock_mainloop() does not handle a closed socket correctly

Submitted by:  Daniel Willmann <asdfuser>
Submitted on:  Wed 27 Aug 2014 04:49:44 PM UTC  
 
Category: NoneSeverity: 3 - Normal
Item Group: NoneStatus: Fixed
Privacy: PublicAssigned to: Eric S. Raymond <esr>
Open/Closed: Closed

Add a New Comment(Rich Markup)
   

You are not logged in

Please log in, so followups can be emailed to you.

 

Wed 27 Aug 2014 04:49:44 PM UTC, original submission:

The gps_sock_mainloop() implementation does not check the return value of gps_read(). This is a problem as gps_read() will return -1 if the socket was closed, the socket will remain readable and this leads to the client consuming 99% CPU.

Ways to reproduce:

  • start gpsd
  • start gpxlogger localhost
  • quit gpsd

Expected result:

  • gpslogger should quit
  • gpslogger should not consume large amounts of CPU

I have attached a patch that checks the return value of gps_read() and exits the mainloop if there is an error.

The patch has passed scons testregress and manually running splint found no
issues (running scons splint causes a "Parse Error: Non-function declaration:
SOCK_STREAM : int." - even without my patch applied).

Daniel Willmann <asdfuser>

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach File(s):
   
   
Comment:
   

Attached Files
file #31984:  0001-Exit-from-gps_sock_mainloop-if-connection-to-gpsd-is.patch added by asdfuser (1KiB - text/x-patch - [PATCH 1/1] Exit from gps_sock_mainloop() if connection to gpsd is lost)

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -unavailable- added by esr (Updated the item)
  • -unavailable- added by asdfuser
  • -unavailable- added by asdfuser (Submitted the item)
  •  

    Do you think this task is very important?
    If so, you can click here to add your encouragement to it.
    This task has 0 encouragements so far.

    Only logged-in users can vote.

     

    Please enter the title of George Orwell's famous dystopian book (it's a date):

     

     

    Follow 5 latest changes.

    Date Changed By Updated Field Previous Value => Replaced By
    Sun 22 Feb 2015 05:04:52 PM UTCesrOpen/ClosedOpen=>Closed
    Thu 28 Aug 2014 10:38:58 AM UTCesrStatusNone=>Fixed
      Assigned toNone=>esr
    Wed 27 Aug 2014 04:50:53 PM UTCasdfuserCarbon-Copy-=>Added -unavailable-
    Wed 27 Aug 2014 04:49:44 PM UTCasdfuserAttached File-=>Added 0001-Exit-from-gps_sock_mainloop-if-connection-to-gpsd-is.patch, #31984

    Back to the top


    Powered by Savane 3.1-cleanup1