[OpenSIPS-Users] mmgeoip module load error

Kobi Eshun kobi at sightspeed.com
Wed Mar 4 20:46:34 CET 2009


Next thing to do is figure out which GeoIP library is getting linked  
into your test program (and also mmgeoip.so). Please do a 'locate  
libGeoIP' and send me the output. Cheers,
--
kobi


On Mar 4, 2009, at 11:41 AM, Jeff Pyle wrote:

> Hi Kobi,
>
> The sample program did not compile correctly.  Here's the output  
> from my
> system:
>
> [root at glacier tmp]# gcc -LGeoIP example.c
> /tmp/cc0cvj9s.o: In function `main':
> example.c:(.text+0x19): undefined reference to `GeoIP_new'
> example.c:(.text+0x2f): undefined reference to  
> `GeoIP_country_code_by_name'
> collect2: ld returned 1 exit status
>
> So, even I can figure out there's something wrong with the API.  I  
> went into
> the directory I had for its source and did the following:
>
> make distclean
> ./configure
> make
> make check
> make install
>
> I verified that /etc/ld.so.conf contains /usr/local/lib, which it  
> does.  I
> ran ldconfig for good measure:
>
> [root at glacier GeoIP-1.4.6]# cat /etc/ld.so.conf
> include ld.so.conf.d/*.conf
> /usr/local/lib
> [root at glacier GeoIP-1.4.6]# ldconfig
>
> Back to the MaxMind example, which still fails.
>
> [root at glacier GeoIP-1.4.6]# cd /tmp
> [root at glacier tmp]# gcc -LGeoIP example.c
> /tmp/cc4e26wm.o: In function `main':
> example.c:(.text+0x19): undefined reference to `GeoIP_new'
> example.c:(.text+0x2f): undefined reference to  
> `GeoIP_country_code_by_name'
> collect2: ld returned 1 exit status
>
>
> This clearly isn't a problem with the mmgeoip.so module in Opensips,  
> but if
> you have any suggestions for me on the API, I'd certainly appreciate  
> it.
>
>
> Thanks,
> Jeff
>
>
>
>
>
> On 3/4/09 2:03 PM, "Kobi Eshun" <kobi at sightspeed.com> wrote:
>
>> Yes, please do remove the *.o and *.so files from the module  
>> directory
>> and do a 'make' again. If you want, you can just send me the entire
>> output from the make command, captured thus:
>>
>> $ make 1>/tmp/make.log 2>&1
>>
>> RE verifying the status of the MM C api, try compiling and running  
>> the
>> simple example program described here:
>>
>> <http://www.maxmind.com/geoip/api/c.shtml>
>>
>> Cheers,
>> --
>> kobi
>>
>>
>> On Mar 4, 2009, at 10:38 AM, Jeff Pyle wrote:
>>
>>> Unfortunately I'm more of a network guy and less of a programmer, so
>>> forgive
>>> me if I don't completely understand the details of your discovery.
>>>
>>> But, I do understand the generalities.  If I remove the binary files
>>> from
>>> the modules/mmgeoip directory and build the modules again, will  
>>> those
>>> commands and their output give you what you're looking for?  Is  
>>> there
>>> anything I can do to check for the existence or status of the MM C  
>>> API
>>> files?  (To install that I uncompressed the archive, did a
>>> configure, make,
>>> make test, and make install according to its instructions.)
>>>
>>>
>>> - Jeff
>>>
>>>
>>>
>>> On 3/4/09 1:26 PM, "Kobi Eshun" <kobi at sightspeed.com> wrote:
>>>
>>>> Very odd. Your object module is missing *all* of the MaxMind  
>>>> symbols,
>>>> not just the entry point the link loader complained about (see
>>>> attached symbol dumps from your and my modules).
>>>>
>>>> Next step is to look at the relevant commands and output of the  
>>>> build
>>>> sequence for your module. May I have that, please? Cheers,
>>>> --
>>>> kobi
>>>>
>>>>
>>>> On Mar 4, 2009, at 6:44 AM, Jeff Pyle wrote:
>>>>
>>>>> Hi Kobi,
>>>>>
>>>>> Absolutely.  You'll find it attached.  Thanks for your help.
>>>>>
>>>>>
>>>>> - Jeff
>>>>>
>>>>>
>>>>>
>>>>> On 3/4/09 12:25 AM, "Kobi Eshun" <kobi at sightspeed.com> wrote:
>>>>>
>>>>>> Looks good. The next thing to do is look at your mmgeoip object
>>>>>> module
>>>>>> itself, if that's an option. Would you mind zipping that up and
>>>>>> sending to me, please?
>>>>>> --
>>>>>> kobi
>>>>>>
>>>>>>
>>>>>> On Mar 3, 2009, at 5:24 PM, Jeff Pyle wrote:
>>>>>>
>>>>>>> Hi Kobi,
>>>>>>>
>>>>>>> Here's the output:
>>>>>>>
>>>>>>> linux-gate.so.1 =>  (0x00c75000)
>>>>>>> libdl.so.2 => /lib/libdl.so.2 (0x00110000)
>>>>>>> libresolv.so.2 => /lib/libresolv.so.2 (0x00d95000)
>>>>>>> libc.so.6 => /lib/i686/nosegneg/libc.so.6 (0x00571000)
>>>>>>> /lib/ld-linux.so.2 (0x001c1000)
>>>>>>>
>>>>>>> This is on a CentOS 5.2 box, running a 2.6.18-92.1.22.el5xen
>>>>>>> kernel.
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>> - Jeff
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>> On 3/3/09 7:32 PM, "Kobi Eshun" <kobi at sightspeed.com> wrote:
>>>>>>>
>>>>>>>> Hi, Jeff.
>>>>>>>>
>>>>>>>> Trying to eliminate possibilities ... can you please try
>>>>>>>> something
>>>>>>>> like
>>>>>>>>
>>>>>>>> ldd /usr/local/lib/opensips/modules/mmgeoip.so
>>>>>>>>
>>>>>>>> if you're using a linux box, or the equivalent on your machine,
>>>>>>>> and
>>>>>>>> send me the output, please? Thanks,
>>>>>>>> --
>>>>>>>> kobi
>>>>>>>>
>>>>>>>>
>>>>>>>> On Mar 3, 2009, at 4:18 PM, Jeff Pyle wrote:
>>>>>>>>
>>>>>>>>> Sergio and Kobi,
>>>>>>>>>
>>>>>>>>> Here's exactly what I did:  I removed mmgeoip from the exclude
>>>>>>>>> list
>>>>>>>>> in the
>>>>>>>>> Makefile for a current revision of 1.5, and tried recompile  
>>>>>>>>> the
>>>>>>>>> modules.  I
>>>>>>>>> saw an error about GeoIP.h (I think) not being found.  Then I
>>>>>>>>> downloaded the
>>>>>>>>> C API from the MaxMind website, compiled and installed it.   
>>>>>>>>> With
>>>>>>>>> this, the
>>>>>>>>> mmgeoip module in Opensips compiled correctly without any
>>>>>>>>> errors.
>>>>>>>>> And
>>>>>>>>> finally, a "make install" to install it.
>>>>>>>>>
>>>>>>>>> Then I added the module config to opensips.cfg:
>>>>>>>>>
>>>>>>>>> loadmodule "mmgeoip.so"
>>>>>>>>> modparam("mmgeoip", "mmgeoip_city_db_path",
>>>>>>>>> "/usr/local/etc/opensips/geolite/GeoLiteCity.dat")
>>>>>>>>>
>>>>>>>>> Starting Opensips gave me the error.
>>>>>>>>>
>>>>>>>>> Does anything stand out I may have done incorrectly?
>>>>>>>>>
>>>>>>>>>
>>>>>>>>> Thanks,
>>>>>>>>> Jeff
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>
>>>>>>>>> On 3/3/09 6:44 PM, "Kobi Eshun" <kobi at sightspeed.com> wrote:
>>>>>>>>>
>>>>>>>>>> Sounds like you have a library version mismatch -- did you
>>>>>>>>>> compile
>>>>>>>>>> mmgeoip.so yourself, or are you using some pre-compiled
>>>>>>>>>> distribution?
>>>>>>>>>> Cheers,
>>>>>>>>>> --
>>>>>>>>>> kobi
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>> On Mar 3, 2009, at 1:56 PM, Jeff Pyle wrote:
>>>>>>>>>>
>>>>>>>>>>> Hello,
>>>>>>>>>>>
>>>>>>>>>>> mmgeoip looks like a very interesting module.  I compiled  
>>>>>>>>>>> and
>>>>>>>>>>> installed the
>>>>>>>>>>> C API, which allowed the Opensips module to compile.  I
>>>>>>>>>>> downloaded
>>>>>>>>>>> the
>>>>>>>>>>> GeoLite binary data file and referenced it after loading
>>>>>>>>>>> mmgeoip.so in
>>>>>>>>>>> opensips.cfg.
>>>>>>>>>>>
>>>>>>>>>>> Loading opensips fails with this error:
>>>>>>>>>>> ERROR:core:sr_load_module: could not open module
>>>>>>>>>>> </usr/local/lib/opensips/modules/mmgeoip.so>:
>>>>>>>>>>> /usr/local/lib/opensips/modules/mmgeoip.so: undefined  
>>>>>>>>>>> symbol:
>>>>>>>>>>> GeoIP_time_zone_by_country_and_region
>>>>>>>>>>>
>>>>>>>>>>> I realize this is brand new code.  Having said that, has
>>>>>>>>>>> anyone
>>>>>>>>>>> encountered
>>>>>>>>>>> this before?
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>> Regards,
>>>>>>>>>>> Jeff
>>>>>>>
>>>>>>
>>>>>
>>>>> <mmgeoip.so.bz2>
>>>>
>>>
>>
>




More information about the Users mailing list