Edit report at https://bugs.php.net/bug.php?id=50902&edit=1
ID: 50902 Updated by: der...@php.net Reported by: william at therileys dot freetcp dot com Summary: Segfault if date.timezone is not set and error_log is defined -Status: Assigned +Status: Closed Type: Bug Package: SOAP related Operating System: * PHP Version: 5.*, 6 Assigned To: derick Block user comment: N Private report: N New Comment: This bug has been fixed in SVN. Snapshots of the sources are packaged every three hours; this change will be in the next snapshot. You can grab the snapshot at http://snaps.php.net/. For Windows: http://windows.php.net/snapshots/ Thank you for the report, and for helping us make PHP better. I've fixed this about a week ago. Previous Comments: ------------------------------------------------------------------------ [2011-02-24 13:48:56] indey...@php.net (copypaste from #54087, which is marked as duplicate of this bug) Description: ------------ In case there is some problem with extension loaded from php.ini (shared dependency not available), php segfaults while trying to show error. it happens in debug+zts mode at least. Debugger output: (lldb) run Process 23067 launched: '/opt/php53/bin/php' (x86_64) (lldb) Process 23067 stopped * thread #1: tid = 0x2d03, 0x00000001000097f0 php`guess_timezone + 48 at php_date.c:843, stop reason = EXC_BAD_ACCESS (code=13, address=0x0) 840 char *env; 841 842 /* Checking configure timezone */ 843 -> if (DATEG(timezone) && (strlen(DATEG(timezone)) > 0)) { 844 return DATEG(timezone); 845 } 846 /* Check environment variable */ (lldb) frame s 3 frame #3: 0x000000010053edb1 php`php_log_err + 369 at main.c:585 582 char *error_time_str; 583 584 time(&error_time); 585 -> error_time_str = php_format_date("d-M-Y H:i:s", 11, error_time, 1 TSRMLS_CC); 586 len = spprintf(&tmp, 0, "[%s] %s%s", error_time_str, log_message, PHP_EOL); 587 #ifdef PHP_WIN32 588 php_flock(fd, 2); (lldb) print log_message (char *) log_message = 0x0000000101807a50 "PHP Warning: PHP Startup: Unable to load dynamic library '/opt/php53/lib/php/extensions/debug-zts- 20090626/gobject.so' - dlopen(/opt/php53/lib/php/extensions/debug-zts- 20090626/gobject.so, 9): Library not loaded: /opt/homebrew/Cellar/gobject- introspection/0.10.2/lib/libgirepository-1.0.1.dylib\n Referenced from: /opt/php53/lib/php/extensions/debug-zts-20090626/gobject.so\n Reason: image not found in Unknown on line 0" (lldb) bt thread #1: tid = 0x2d03, stop reason = EXC_BAD_ACCESS (code=13, address=0x0) frame #0: 0x00000001000097f0 php`guess_timezone + 48 at php_date.c:843 frame #1: 0x0000000100009c69 php`get_timezone_info + 89 at php_date.c:940 frame #2: 0x000000010000a05b php`php_format_date + 59 at php_date.c:1190 frame #3: 0x000000010053edb1 php`php_log_err + 369 at main.c:585 frame #4: 0x0000000100543b76 php`php_error_cb + 2342 at main.c:1003 frame #5: 0x00000001005f6da3 php`zend_error + 1139 at zend.c:1020 frame #6: 0x000000010053fdb5 php`php_verror + 3301 at main.c:807 frame #7: 0x000000010053ff9c php`php_error_docref0 + 364 at main.c:819 frame #8: 0x000000010040d031 php`php_load_extension + 561 at dl.c:158 frame #9: 0x0000000100554d32 php`php_load_php_extension_cb + 50 at php_ini.c:351 frame #10: 0x00000001005e8661 php`zend_llist_apply + 65 at zend_llist.c:193 frame #11: 0x0000000100554cb7 php`php_ini_register_extensions + 87 at php_ini.c:751 frame #12: 0x0000000100542f89 php`php_module_startup + 3529 at main.c:2029 frame #13: 0x000000010071b944 php`php_cli_startup + 36 at php_cli.c:402 frame #14: 0x000000010071895f php`main + 2575 at php_cli.c:776 frame #15: 0x0000000100000c64 php`start + 52 (lldb) Expected result: ---------------- Error is displayed Actual result: -------------- Segfaul ------------------------------------------------------------------------ [2010-02-03 23:19:29] j...@php.net This is bug in SOAP extension which has a funky error handler defined. ------------------------------------------------------------------------ [2010-02-03 22:33:07] j...@php.net The shortest way to reproduce: # php -n -dlog_errors=on -derror_log=./foo \ -r 'new SoapClient("http://localhost/wsdl"); ------------------------------------------------------------------------ [2010-02-03 22:23:22] william at therileys dot freetcp dot com I did another back trace just to verify the correct php version was being used and with the source code in place on the system on which I ran gdb. Please note that the back trace will say 5.2.12 (even though this is the snapshot) because I used that directory name so I did not have to rewrite the spec file to build an RPM. http://pastebin.com/f19f1446a $ /usr/local/bin/php --version PHP 5.2.13RC1-dev (cli) (built: Feb 2 2010 10:17:42) Copyright (c) 1997-2010 The PHP Group Zend Engine v2.2.0, Copyright (c) 1998-2010 Zend Technologies ------------------------------------------------------------------------ [2010-02-03 22:00:57] j...@php.net That was not the backtrace of the build with the snapshot. Please, provide the correct backtrace. ------------------------------------------------------------------------ The remainder of the comments for this report are too long. To view the rest of the comments, please view the bug report online at https://bugs.php.net/bug.php?id=50902 -- Edit this bug report at https://bugs.php.net/bug.php?id=50902&edit=1