Skip to content
This repository has been archived by the owner on Jun 1, 2022. It is now read-only.

Valgrind memcheck errors triggered by GeoIP #60

Closed
yurivict opened this issue May 1, 2015 · 3 comments
Closed

Valgrind memcheck errors triggered by GeoIP #60

yurivict opened this issue May 1, 2015 · 3 comments

Comments

@yurivict
Copy link

yurivict commented May 1, 2015

==75111== 1 errors in context 1 of 1:
==75111== Conditional jump or move depends on uninitialised value(s)
==75111==    at 0x4E446C6: ??? (in /usr/local/lib/libGeoIP.so.1.6.5)
==75111==    by 0x4E44A5E: _GeoIP_seek_record_gl (in /usr/local/lib/libGeoIP.so.1.6.5)
==75111==    by 0x4E4550D: GeoIP_country_code_by_name_gl (in /usr/local/lib/libGeoIP.so.1.6.5)
==75111==    by 0x4E47960: GeoIP_country_code_by_name (in /usr/local/lib/libGeoIP.so.1.6.5)
@oschwald
Copy link
Member

oschwald commented May 1, 2015

Do you have the calling code that can reproduce this, including the initialization of the database struct?

@yurivict
Copy link
Author

yurivict commented May 1, 2015

#include "GeoIP.h"
#include <stdio.h>

int main() {
  GeoIP *gi = GeoIP_open("/usr/local/share/GeoIP/GeoIP.dat", GEOIP_STANDARD | GEOIP_CHECK_CACHE);
  const char* cc = GeoIP_country_code_by_name(gi, "8.8.8.8");
  printf("cc=%s\n", cc);
}

autarch added a commit that referenced this issue Jul 27, 2015
This fixes a warning from valgrind reported in GH #60.
@oschwald
Copy link
Member

This was fixed in #60.

oschwald added a commit that referenced this issue Jul 28, 2015
1.6.6

* Replaced usage of deprecated fileno, read, and lseek on Visual Studio 2005+
  with their ISO C++ conformant replacements. (Fix by ClaudiuHKS. GitHub #55.)
* A warning about using a double as a float was fixed. (Fix by ClaudiuHKS.
  GitHub #56.)
* Fixed segfault when doing a lookup on an empty database. (Fix by NesoK.
  GitHub #62.)
* Fixed a memcheck error from valgrind in the `_check_mtime`
  function. (Reported by yurivct. GitHub #60.)
* Fixed `_check_mtime` to check the return value of `gettimeofday` rather than
  just assuming it worked.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Development

No branches or pull requests

2 participants