Bug 4013 - After connection signal 'changed' to LOCATION_GPS_DEVICE object application has been doing constant polling for 127.0.0.1 address
: After connection signal 'changed' to LOCATION_GPS_DEVICE object application ...
Status: RESOLVED FIXED
Product: Location
General
: 4.1.1 (4.2008.30-2)
: All Linux
: Medium normal (vote)
: 5.0-alpha
Assigned To: unassigned
: location-framework-bugs
:
: use-time
:
: 2602
  Show dependency tree
 
Reported: 2009-01-17 16:27 UTC by Vlad Vasiliev
Modified: 2009-03-02 13:35 UTC (History)
4 users (show)

See Also:


Attachments
Source of testing program (299.38 KB, application/octet-stream)
2009-01-17 16:29 UTC, Vlad Vasiliev
Details
Armel binary of testing program (16.24 KB, application/octet-stream)
2009-01-17 16:29 UTC, Vlad Vasiliev
Details


Note

You need to log in before you can comment on or make changes to this bug.


Description Vlad Vasiliev (reporter) 2009-01-17 16:27:32 UTC
SOFTWARE VERSION:
4.2008.30-2

I have problem with my program OMWeather. After start plugin OMweather 
Hildon Desktop to do constant polling for 127.0.0.1 address, even
when the screen is blanked.  This will drain battery within a day
even if device is otherwise idle. 

I  modified the program 'hello-world-application' for the testing of this
problem.
You can download it here:
http://omweather.garage.maemo.org/down/hello-world-app-test-gps-connection_2.2.tar.gz
http://omweather.garage.maemo.org/down/hello-world-app-test-gps-connection_2.2_armel.deb


This program after running  connects the signal 'changed'  to an object
LOCATION_GPS_DEVICE

After starting application with strace:

strace hello-world 

I have observed  next strings in xterm:

....
ioctl(5, FIONREAD, [0])                 = 0
gettimeofday({1232199813, 671569}, NULL) = 0
poll([{fd=4, events=POLLIN}, {fd=5, events=POLLIN}, {fd=3, events=POLLIN}], 3,
995) = 0 (Timeout)
gettimeofday({1232199814, 667937}, NULL) = 0
connect(6, {sa_family=AF_INET, sin_port=htons(2947),
sin_addr=inet_addr("127.0.0.1")}, 16) = -1 ECONNREFUSED (Connection refused)
ioctl(5, FIONREAD, [0])                 = 0
gettimeofday({1232199814, 671843}, NULL) = 0
poll([{fd=4, events=POLLIN}, {fd=5, events=POLLIN}, {fd=3, events=POLLIN}], 3,
997) = 0 (Timeout)
gettimeofday({1232199815, 667937}, NULL) = 0
connect(6, {sa_family=AF_INET, sin_port=htons(2947),
sin_addr=inet_addr("127.0.0.1")}, 16) = -1 ECONNREFUSED (Connection refused)
ioctl(5, FIONREAD, [0])                 = 0
gettimeofday({1232199815, 671874}, NULL) = 0
poll([{fd=4, events=POLLIN}, {fd=5, events=POLLIN}, {fd=3, events=POLLIN}], 3,
997) = 0 (Timeout)
gettimeofday({1232199816, 670623}, NULL) = 0
connect(6, {sa_family=AF_INET, sin_port=htons(2947),
sin_addr=inet_addr("127.0.0.1")}, 16) = -1 ECONNREFUSED (Connection refused)
....

After pressed button "Press this button for connect/disconnect" (application
makes  'g_signal_handler_disconnect' in this moment).
I have stopped seeing those reports.


I think location-gps library has some problem with signal 'changed' in  the
LOCATION_GPS_DEVICE object.

REPRODUCIBILITY:
always
Comment 1 Vlad Vasiliev (reporter) 2009-01-17 16:29:15 UTC
Created an attachment (id=1105) [details]
Source of testing program
Comment 2 Vlad Vasiliev (reporter) 2009-01-17 16:29:44 UTC
Created an attachment (id=1106) [details]
Armel binary of testing program
Comment 3 Vlad Vasiliev (reporter) 2009-01-17 17:33:12 UTC
I'm sorry in early message I have confused   LOCATION_TYPE_GPS_DEVICE  and
LOCATION_GPS_DEVICE. I have meant LOCATION_TYPE_GPS_DEVICE.
Comment 4 Eero Tamminen nokia 2009-01-19 10:54:45 UTC
When I noticed this kind of an issue earlier, it occured also with the Foreca
weather applet *and* at least earlier the issue seemed to persist even after
disabling the applet from the Desktop (at least until next reboot or manual
Desktop restart).

Vlad mentioned in private email that applet/application works better with this
approach:
"Liblocation library has  LocationGPSDControl object. There are three signals
on this object: error, gpsd_running and gpsd_stopped. I am going to control
'run' and 'stop' signals and connect or disconnect signal 'changed' to object
LOCATION_TYPE_GPS_DEVICE on depending from those signals."

Vlad, do you think this is a bug for the Liblocation library code or its
documentation which doesn't tell how the API should be used properly?
Comment 5 Vlad Vasiliev (reporter) 2009-01-19 14:20:30 UTC
I think this is the error in  the liblocation libarary. Object
LOCATION_TYPE_GPS_DEVICE itself should make the checking of possibility the 
connecting to gpsd using  LocationGPSDControl object    (IMHO).
Comment 6 Quim Gil nokia 2009-01-30 15:53:56 UTC
(In reply to comment #5)
> I think this is the error in  the liblocation libarary. Object
> LOCATION_TYPE_GPS_DEVICE itself should make the checking of possibility the 
> connecting to gpsd using  LocationGPSDControl object    (IMHO).

Fixed in Fremantle and thanks for the finding.