|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #64692 Segfault with geoip extension and GeoIP API 1.5
Submitted: 2013-04-22 17:16 UTC Modified: 2014-04-28 12:25 UTC
Avg. Score:5.0 ± 0.0
Reproduced:0 of 0 (0.0%)
From: mail at daniel-berlin dot de Assigned: ohill (profile)
Status: Closed Package: geoip (PECL)
PHP Version: 5.4.14 OS: Linux
Private report: No CVE-ID: None
 [2013-04-22 17:16 UTC] mail at daniel-berlin dot de
The Geoip extension causes an immediate segfault of the corresponding apache process when compiled agains the API v1.5.0. With v1.4.8 it works without problems.

Test script:
<?php print_r(geoip_db_get_all_info());

Expected result:
Array dump

Actual result:
None (apache process segfaults)


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2013-04-22 18:26 UTC]
-Status: Open +Status: Feedback
 [2013-04-22 18:26 UTC]
Not enough information was provided for us to be able
to handle this bug. Please re-read the instructions at

If you can provide more information, feel free to add it
to this bug and change the status back to "Open".

Thank you for your interest in PHP.

Seems related to #60066

Can you check which PECL version of geoip you are using? Seems to work here with 
geoip 1.0.8 and libgeoip 1.5.0
 [2013-04-27 18:28 UTC] mail at daniel-berlin dot de
-Status: Feedback +Status: Open
 [2013-04-27 18:28 UTC] mail at daniel-berlin dot de
When I use geoip 1.0.8, GeoIP C API 1.5.0 and apache 2.2.22 -> I get a segmentation fault.
After switching back to the GeoIP C API 1.4.8 it works fine (absolutely nothing else changed).
No strange configure options or compiler flags set...

Regards, Daniel
 [2013-06-27 08:13 UTC] xoJIog at inbox dot lv
I've experienced the same problem with geoip-1.5.0 and geoip-1.5.1 working with php-fpm v.5.3.17
kernel: php-fpm[20929]: segfault at 14 ip a5037659 sp b6c56ac0 error 4 in[a502d000+31000]
kernel: grsec: From Segmentation fault occurred at 00000014 in /usr/lib/php5.3/bin/php-fpm[php-fpm:20929], parent /usr/lib/php5.3/bin/php-fpm[php-fpm:20928]
kernel: grsec: From denied resource overstep by requesting 4096 for RLIMIT_CORE against limit 0 for /usr/lib/php5.3/bin/php-fpm[php-fpm:20929], parent /usr/lib/php5.3/bin/php-fpm[php-fpm:20928]
 [2013-06-27 11:35 UTC]
-Status: Open +Status: Feedback
 [2013-06-27 11:35 UTC]
Thank you for this bug report. To properly diagnose the problem, we
need a backtrace to see what is happening behind the scenes. To
find out how to generate a backtrace, please read for *NIX and for Win32

Once you have generated a backtrace, please submit it to this bug
report and change the status back to "Open". Thank you for helping
us make PHP better.

A backtrace would help a lot here since I cannot reproduce on my setup.
 [2013-07-03 20:21 UTC] mail at daniel-berlin dot de
-Status: Feedback +Status: Open
 [2013-07-03 20:21 UTC] mail at daniel-berlin dot de
Reproducted the segfault with pecl geoip 1.0.8 and GeoIP API 1.5.1.
Both pecl extension and api built without any additional options.

Unfortunately I cannot create a coredump file (I'm inside a shared environment and coredumps are disabled).
 [2013-07-03 20:56 UTC] mail at daniel-berlin dot de
Here is a backtrace:

Core was generated by `/usr/bin/httpd -k start'.
Program terminated with signal 11, Segmentation fault.
#0  0xb7542846 in __strlen_sse2_bsf () from /usr/lib/
(gdb) bt
#0  0xb7542846 in __strlen_sse2_bsf () from /usr/lib/
#1  0xb619dcc8 in zif_geoip_database_info ()
   from /usr/local/php-5.5.0/lib/php/20121212/
#2  0xb6d7cdbc in zend_do_fcall_common_helper_SPEC () from /usr/local/php/lib/
#3  0xb6cdaf36 in execute_ex () from /usr/local/php/lib/
#4  0xb6d7acb1 in zend_execute () from /usr/local/php/lib/
#5  0xb6cabdd9 in zend_execute_scripts () from /usr/local/php/lib/
#6  0xb6c3b1b6 in php_execute_script () from /usr/local/php/lib/
#7  0xb6d7ece8 in php_handler () from /usr/local/php/lib/
#8  0x0807827d in ap_run_handler ()
#9  0x080785ef in ap_invoke_handler ()
#10 0x08085590 in ap_process_request ()
#11 0x08082aa8 in ?? ()
#12 0x0807eabd in ap_run_process_connection ()
#13 0x0808a716 in ?? ()
#14 0x0808ac13 in ?? ()
#15 0x0808acdd in ?? ()
#16 0x0808bd10 in ap_mpm_run ()
#17 0x08063fa4 in main ()
 [2014-04-28 04:03 UTC] anthon at piwik dot org
In 1.5.0, Maxmind removed support for a couple of database types.

add_assoc_string(row, "description", (char *)GeoIPDBDescription[i], 1);

if (GeoIPDBDescription[i]) {
add_assoc_string(row, "description", (char *)GeoIPDBDescription[i], 1);
 [2014-04-28 12:25 UTC]
Automatic comment from SVN on behalf of ohill
Log: Bug 64692
 [2014-04-28 12:25 UTC]
-Status: Open +Status: Closed -Assigned To: +Assigned To: ohill
 [2014-04-28 12:25 UTC]
The fix for this bug has been committed.

Snapshots of the sources are packaged every three hours; this change
will be in the next snapshot. You can grab the snapshot at

 For Windows:
Thank you for the report, and for helping us make PHP better.

PHP Copyright © 2001-2021 The PHP Group
All rights reserved.
Last updated: Sun Jan 24 00:01:23 2021 UTC