[tor-bugs] #9244 [BridgeDB]: bridgedb's GeoIP module (v0.2.6, the latest) causes python to segfault

Tor Bug Tracker & Wiki blackhole at torproject.org
Thu Jul 11 23:18:11 UTC 2013


#9244: bridgedb's GeoIP module (v0.2.6, the latest) causes python to segfault
---------------------------+------------------------------------------------
 Reporter:  isis           |          Owner:  isis
     Type:  defect         |         Status:  new 
 Priority:  normal         |      Milestone:      
Component:  BridgeDB       |        Version:      
 Keywords:  geoip,maxmind  |         Parent:      
   Points:                 |   Actualpoints:      
---------------------------+------------------------------------------------
 Perhaps we should look for another geoip API. The one that BridgeDB is
 currently using is for MaxMind, and, if I recall correctly, they changed
 their API somewhat recently and I think there is now a 'pygeoip2' module
 to correspond to the new API.

 This should be looked into at some point, especially because the latest
 version of the current pygeoip module we are using (the one where we do
 'import GeoIP' -- the namespace is a bit convoluded) has a reproducible
 segmentation fault:

 {{{
 In [17]: geoip.region_by_addr('24.5.85.80')
 Invalid database type GeoIP Country Edition, expected GeoIP Region
 Edition, Rev 1
 Segmentation fault
 (bridgedb)∃!isisⒶwintermute:(feature/9199-improved-logging-
 rebased1-merged1 *>)~/code/torproject/bridgedb ∴ ipython
 WARNING: Attempting to work in a virtualenv. If you encounter problems,
 please install IPython inside the virtualenv.

 In [1]: import GeoIP

 In [2]: GeoIP.__
 GeoIP.__class__         GeoIP.__hash__          GeoIP.__repr__
 GeoIP.__delattr__       GeoIP.__init__          GeoIP.__setattr__
 GeoIP.__dict__          GeoIP.__name__          GeoIP.__sizeof__
 GeoIP.__doc__           GeoIP.__new__           GeoIP.__str__
 GeoIP.__file__          GeoIP.__package__       GeoIP.__subclasshook__
 GeoIP.__format__        GeoIP.__reduce__
 GeoIP.__getattribute__  GeoIP.__reduce_ex__

 In [2]: geoip = GeoIP.new(Ge
 GeneratorExit  GeoIP

 In [2]: geoip = GeoIP.new(GeoIP.
 GeoIP.GEOIP_CHARSET_ISO_8859_1  GeoIP.country_codes
 GeoIP.GEOIP_CHARSET_UTF8        GeoIP.country_continents
 GeoIP.GEOIP_CHECK_CACHE         GeoIP.country_names
 GeoIP.GEOIP_INDEX_CACHE         GeoIP.error
 GeoIP.GEOIP_MEMORY_CACHE        GeoIP.new
 GeoIP.GEOIP_STANDARD            GeoIP.open

 In [2]: geoip = GeoIP.new(GeoIP.GEOIP_STANDARD)

 In [3]: geoip.re
 geoip.record_by_addr  geoip.region_by_addr
 geoip.record_by_name  geoip.region_by_name

 In [3]: geoip.regio
 geoip.region_by_addr  geoip.region_by_name

 In [3]: geoip.region_by_addr('24.5.85.80')
 Invalid database type GeoIP Country Edition, expected GeoIP Region
 Edition, Rev 1
 Segmentation fault
 (bridgedb)∃!isisⒶwintermute:(feature/9199-improved-logging-
 rebased1-merged1 *>)~/code/torproject/bridgedb ∴
 }}}

-- 
Ticket URL: <https://trac.torproject.org/projects/tor/ticket/9244>
Tor Bug Tracker & Wiki <https://trac.torproject.org/>
The Tor Project: anonymity online


More information about the tor-bugs mailing list