Bug #54087 [Opn->Dup]: Segfault on startup, DATEG(timezone) not initialized

From: Date: Thu, 24 Feb 2011 12:19:31 +0000
Subject: Bug #54087 [Opn->Dup]: Segfault on startup, DATEG(timezone) not initialized
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-158994@lists.php.net to get a copy of this message
Edit report at http://bugs.php.net/bug.php?id=54087&edit=1

 ID:                 54087
 Updated by:         aharvey@php.net
 Reported by:        indeyets@php.net
 Summary:            Segfault on startup, DATEG(timezone) not initialized
-Status:             Open
+Status:             Duplicate
 Type:               Bug
 Package:            Date/time related
 Operating System:   Mac OS X
 PHP Version:        5.3SVN-2011-02-24 (SVN)
 Block user comment: N
 Private report:     N

 New Comment:

Duplicate of bug #50902.


Previous Comments:
------------------------------------------------------------------------
[2011-02-24 12:21:15] 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


------------------------------------------------------------------------



-- 
Edit this bug report at http://bugs.php.net/bug.php?id=54087&edit=1


Thread (2 messages)

« previous php.bugs (#158994) next »