Re: apc 3.0.10 dumping core Sol 2.8
| From: | James M. Luedke | Date: | Fri, 24 Mar 2006 18:52:15 +0000 |
| Subject: | Re: apc 3.0.10 dumping core Sol 2.8 | ||
| References: | 1 2 | Groups: | php.pecl.dev |
| Request: | Send a blank email to pecl-dev+get-3664@lists.php.net to get a copy of this message | ||
Hi:
I think i found a small bug in APC.
Here is the first change that I made
diff apc_globals.h apc_globals.h.orig 64c64
< long slam_defense; /* Probability of a process not caching an uncached file */---
There was a type mis-match in the INI entry slam_defense. php_apc.c defined it as OnUpdateInt but apc_globals.h had it defined as zend_bool. Though it did get rid or my initial core on startup, sadly I still had problems with the new version of apc after this small fix. It looked as though a memcpy was failing someplace in apc_compile.c. I looked at it briefly but did not have the time to dive in. Using ipcs i could see that my shm segment was getting created and had the permissions set correctly, however trying to memcpy(dst, src, sizeof(src[0])); was failing in one of the apc_copy_* functions... (I will write in later with the exact function and some gdb info) I am guessing somehow permissions got screwed up or something. Any how, I will try to look at this again today. Perhaps someone who knows a little more about APC than i can enlighten me. also I received the message bellow from David Begley, who ran into problems with APC 3.0.10 on Solaris running a non-FastCGI version of php... Any how David, try the change I made and let me know if this fixes your problem, or if you also get the shm problem I am now seeing. On a side note the mailing list sign up form at http://pecl.php.net/support.php is not working. I had to send my sign up message via ezmlm email. -James --- David J N Begley wrote: Greetings - I was reading the php-dev mailing list archives when I happened across your message here: http://marc.theaimsgroup.com/?l=php-dev&m=114264729420018&w=2 Thought you may be interested in a related data point. I was originally compiling PHP on our target platform (Solaris 9) using the "Companion Software CD" compiler (GCC 2.95.3); yes, it has some "issues" so I was using "-mcpu=supersparc" with Apache, APC and PHP in order to minimise problems (I can crash Apache 2.2 when compiled with "-mcpu=ultrasparc" and the above compiler). That was fine with APC 3.0.8, but from 3.0.9 I found that even using "-mcpu=supersparc" was too much - PHP (when using APC) would fail to start (SIGBUS), so whatever is causing your problem on 3.0.10 was probably introduced in 3.0.9. In any case, I found that by switching to Sun's new "GCC for SPARC Systems" 4.0.2, I am able to use "-mcpu=ultrasparc -xtarget=ultra2" for Apache, APC and PHP, and everything "just works" (no more SIGBUS, SIGSEGV, etc.). So yes, something in APC has probably changed - but I still suspect the main culprit is probably the compiler. For reference, I am using: - Solaris 9 on UltraSPARC-IIi (that's "two-eye") - Sun's GCC for SPARC Systems 4.0.2 (was GCC 2.95.3, Companion Software CD) - Apache 2.2.0 - PHP 5.1.2 - APC 3.0.10 (both 3.0.8 and 3.0.9 prior to that) Hope this helps... --- Rasmus Lerdorf wrote:zend_bool slam_defense; /* Probability of a process not caching an uncached file */
More appropriate for pecl-dev, moving there. Any chance you coould test against Apache instead of fastcgi to rule out/confirm whether it is related to fastcgi? -Rasmus James M Luedke wrote:Hi:I am upgrading my APC to 3.0.10 from 3.0.8 and have run into a strange core at startup. At first glance it seems as though it's pukeing setting home INI entry in OnUpdateInt. Spent about an hour pokeing around to make sure i wasnt doing anything stupid. My build env. seems stable, as it's the same env i built 3.0.8 on. Figured I would check to see if anyone else has seen such an event, and can suggest a fix before i get neck deep into this.I have attached some gdb info in hopes it will assist. -James #0 0x001ba4dc in OnUpdateInt (entry=0x7ad738, new_value=0x7591a0 "90", new_value_length=2, mh_arg1=0x31, mh_arg2=0xfeee0240, mh_arg3=0x0, stage=1)at /php-4.3.11-fastcgi/Zend/zend_ini.c:472 #1 0x001b9dd4 in zend_register_ini_entries (ini_entry=0xfeedfff0, module_number=22) at /php-4.3.11-fastcgi/Zend/zend_ini.c:174 #2 0xfeec4b78 in zm_startup_apc (type=1, module_number=22) at /APC-3.0.10/php_apc.c:184 #3 0x00134e88 in php_dl (file=0xfeee01ac, type=1, return_value=0xffbef778) at /php-4.3.11-fastcgi/ext/standard/dl.c:238 #4 0x00189094 in php_load_function_extension_cb (arg=0x74c1b0) at /php-4.3.11-fastcgi/main/php_ini.c:219 #5 0x001a8660 in zend_llist_apply (l=0x74c1a8, func=0x189080 <php_load_function_extension_cb>) at /php-4.3.11-fastcgi/Zend/zend_llist.c:189 #6 0x0018957c in php_ini_delayed_modules_startup () at /php-4.3.11-fastcgi/main/php_ini.c:502 #7 0x00183e30 in php_module_startup (sf=0x0, additional_modules=0x0, num_additional_modules=0) at /php-4.3.11-fastcgi/main/main.c:1233 #8 0x001d0bf4 in main (argc=5, argv=0xffbefbdc) at /php-4.3.11-fastcgi/sapi/cgi/cgi_main.c:1167 (gdb) f 1 #1 0x001b9dd4 in zend_register_ini_entries (ini_entry=0xfeedfff0, module_number=22) at /php-4.3.11-fastcgi/Zend/zend_ini.c:174 174 if (!hashed_ini_entry->on_modify(gdb) print *ini_entry $1 = {module_number = 22, modifyable = 4, name = 0xfeecdb90 "apc.slam_defense", name_length = 17, on_modify = 0x1ba4cc <OnUpdateInt>, mh_arg1 = 0x31, mh_arg2 = 0xfeee0240, mh_arg3 = 0x0, value = 0xfeecdc40 "0", value_length = 1, orig_value = 0x0, orig_value_length = 0, modified = 0, displayer = 0x1ba28c <zend_ini_boolean_displayer_cb>} (gdb) list169 if (zend_hash_add(directives, p->name, p->name_length, p, sizeof(zend_ini_entry), (void **) &hashed_ini_entry)==FAILURE) { 170 zend_unregister_ini_entries(module_number TSRMLS_CC); 171 return FAILURE; 172 } 173 if ((zend_get_configuration_directive(p->name, p->name_length, &default_value))==SUCCESS) { 174 if (!hashed_ini_entry->on_modify 175 || hashed_ini_entry->on_modify(hashed_ini_entry, default_value.value.str.val, default_value.value.str.len, hashed_ini_entry->mh_arg1, hashed_ini_entry->mh_arg2, hashed_ini_entry->mh_arg3, ZEND_INI_STAGE_STARTUP TSRMLS_CC)==SUCCESS) {176 hashed_ini_entry->value = default_value.value.str.val; 177 hashed_ini_entry->value_length = default_value.value.str.len; 178 }(gdb) f 0 #0 0x001ba4dc in OnUpdateInt (entry=0x7ad738, new_value=0x7591a0 "90", new_value_length=2, mh_arg1=0x31, mh_arg2=0xfeee0240, mh_arg3=0x0, stage=1)at /php-4.3.11-fastcgi/Zend/zend_ini.c:472 472 *p = zend_atoi(new_value, new_value_length);(gdb) list467 base = (char *) ts_resource(*((int *) mh_arg2)); 468 #endif469470 p = (long *) (base+(size_t) mh_arg1);471472 *p = zend_atoi(new_value, new_value_length); 473 return SUCCESS; 474 }475 476 (gdb) print new_value_length $3 = 2