php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #54087 Segfault on startup, DATEG(timezone) not initialized
Submitted: 2011-02-24 12:21 UTC Modified: 2011-02-24 13:19 UTC
From: indeyets@php.net Assigned:
Status: Duplicate Package: Date/time related
PHP Version: 5.3SVN-2011-02-24 (SVN) OS: Mac OS X
Private report: No CVE-ID: None
View Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
If you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: indeyets@php.net
New email:
PHP Version: OS:

 

 [2011-02-24 12:21 UTC] indeyets@php.net
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:
--------------
Segfault

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2011-02-24 13:19 UTC] aharvey@php.net
-Status: Open +Status: Duplicate
 [2011-02-24 13:19 UTC] aharvey@php.net
Duplicate of bug #50902.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Thu Oct 31 23:01:28 2024 UTC