Skip to content

GitLab

  • Menu
Projects Groups Snippets
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in
  • BridgeDB BridgeDB
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 24
    • Issues 24
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 2
    • Merge requests 2
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Monitor
    • Monitor
    • Incidents
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Repository
  • Wiki
    • Wiki
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • The Tor Project
  • Anti-censorship
  • BridgeDBBridgeDB
  • Issues
  • #9244
Closed
Open
Created Jul 11, 2013 by Isis Lovecruft@isis

bridgedb's GeoIP module (v0.2.6, the latest) causes python to segfault

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 ∴
Assignee
Assign to
Time tracking