Thread: [Geoip-general] GeoIP_db_avail segfault
Brought to you by:
tjmather
From: Djihed A. <dji...@go...> - 2007-03-31 03:37:56
|
Hi, I'm trying to update the Tcl extension for GeoIP [1], the latest code is available here http://svn.arablug.org/tclgeoip/ In particular, the generic/geoiptcl.c file. I'm trying to resolve an issue I have had for long with GeoIP_db_avail. The function segfaults if called first before opening a database. It doesn't segfault if I load a database first, then call it. Is this a known issue? any pointers? I can supply memory dump/valgrind output if needed. Djihed [1] http://www.maxmind.com/app/tcl |
From: <tjm...@ma...> - 2007-04-02 05:54:54
|
I believe the segfault is due to the fact that GeoIPDBFileName is not initialized yet. If you call _GeoIP_setup_dbfilename before calling GeoIP_db_avail, that should resolve the issue? -TJ ----- Original message ----- From: "Djihed Afifi" <dji...@go...> To: Geo...@li... Date: Sat, 31 Mar 2007 04:37:55 +0100 Subject: [Geoip-general] GeoIP_db_avail segfault Hi, I'm trying to update the Tcl extension for GeoIP [1], the latest code is available here http://svn.arablug.org/tclgeoip/ In particular, the generic/geoiptcl.c file. I'm trying to resolve an issue I have had for long with GeoIP_db_avail. The function segfaults if called first before opening a database. It doesn't segfault if I load a database first, then call it. Is this a known issue? any pointers? I can supply memory dump/valgrind output if needed. Djihed [1] http://www.maxmind.com/app/tcl ------------------------------------------------------------------------- Take Surveys. Earn Cash. Influence the Future of IT Join SourceForge.net's Techsay panel and you'll get the chance to share your opinions on IT & business topics through brief surveys-and earn cash http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV _______________________________________________ Geoip-general mailing list Geo...@li... https://lists.sourceforge.net/lists/listinfo/geoip-general |
From: Djihed A. <dji...@go...> - 2007-04-03 17:09:52
|
That solved it, thank you. Shouldn't _GeoIP_setup_dbfilename be in GeoIP.h ? As I'm developing it I'm looking at GeoIP.h, is there another place for documentation on developing against the C API? Djihed في ن، 02-04-2007 عند 01:54 -0400 ، كتب tjm...@ma...: > I believe the segfault is due to the > fact that GeoIPDBFileName is not initialized > yet. If you call _GeoIP_setup_dbfilename > before calling GeoIP_db_avail, that should > resolve the issue? > > -TJ > > > > ----- Original message ----- > From: "Djihed Afifi" <dji...@go...> > To: Geo...@li... > Date: Sat, 31 Mar 2007 04:37:55 +0100 > Subject: [Geoip-general] GeoIP_db_avail segfault > > Hi, > > I'm trying to update the Tcl extension for GeoIP [1], the latest code > is available here > http://svn.arablug.org/tclgeoip/ > > In particular, the generic/geoiptcl.c file. > > I'm trying to resolve an issue I have had for long with > GeoIP_db_avail. The function segfaults if called first before opening > a database. It doesn't segfault if I load a database first, then call > it. > > Is this a known issue? any pointers? > > I can supply memory dump/valgrind output if needed. > > Djihed > > [1] http://www.maxmind.com/app/tcl > > ------------------------------------------------------------------------- > Take Surveys. Earn Cash. Influence the Future of IT > Join SourceForge.net's Techsay panel and you'll get the chance to share > your > opinions on IT & business topics through brief surveys-and earn cash > http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV > _______________________________________________ > Geoip-general mailing list > Geo...@li... > https://lists.sourceforge.net/lists/listinfo/geoip-general -- Have a project you would like to be translated to Arabic? Let us know: http://wiki.arabeyes.org/Translation_requests Blog: http://djihed.com |
From: <tjm...@ma...> - 2007-04-04 05:35:31
|
I have fixed this in the C API in SourceForce CVS, by calling _GeoIP_setup_dbfilename in GeoIP_db_avail - that way _GeoIP_setup_dbfilename (which may change in future releases) doesn't have to be exposed to the caller. --- GeoIP.c 8 Feb 2007 23:33:14 -0000 1.66 +++ GeoIP.c 4 Apr 2007 05:31:22 -0000 @@ -242,6 +242,7 @@ int GeoIP_db_avail(int type) { if (type < 0 || type >= NUM_DB_TYPES) { return 0; } + _GeoIP_setup_dbfilename(); filePath = GeoIPDBFileName[type]; if (NULL == filePath) { return 0; There isn't any documentation besides what is in the source code and example files in the test/ directory. -TJ ----- Original message ----- From: "Djihed Afifi" <dji...@go...> To: tjm...@ma... Cc: Geo...@li... Date: Tue, 03 Apr 2007 18:09:43 +0100 Subject: Re: [Geoip-general] GeoIP_db_avail segfault That solved it, thank you. Shouldn't _GeoIP_setup_dbfilename be in GeoIP.h ? As I'm developing it I'm looking at GeoIP.h, is there another place for documentation on developing against the C API? Djihed في ن، 02-04-2007 عند 01:54 -0400 ، كتب tjm...@ma...: > I believe the segfault is due to the > fact that GeoIPDBFileName is not initialized > yet. If you call _GeoIP_setup_dbfilename > before calling GeoIP_db_avail, that should > resolve the issue? > > -TJ > > > > ----- Original message ----- > From: "Djihed Afifi" <dji...@go...> > To: Geo...@li... > Date: Sat, 31 Mar 2007 04:37:55 +0100 > Subject: [Geoip-general] GeoIP_db_avail segfault > > Hi, > > I'm trying to update the Tcl extension for GeoIP [1], the latest code > is available here > http://svn.arablug.org/tclgeoip/ > > In particular, the generic/geoiptcl.c file. > > I'm trying to resolve an issue I have had for long with > GeoIP_db_avail. The function segfaults if called first before opening > a database. It doesn't segfault if I load a database first, then call > it. > > Is this a known issue? any pointers? > > I can supply memory dump/valgrind output if needed. > > Djihed > > [1] http://www.maxmind.com/app/tcl > > ------------------------------------------------------------------------- > Take Surveys. Earn Cash. Influence the Future of IT > Join SourceForge.net's Techsay panel and you'll get the chance to share > your > opinions on IT & business topics through brief surveys-and earn cash > http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV > _______________________________________________ > Geoip-general mailing list > Geo...@li... > https://lists.sourceforge.net/lists/listinfo/geoip-general -- Have a project you would like to be translated to Arabic? Let us know: http://wiki.arabeyes.org/Translation_requests Blog: http://djihed.com |