php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #40193 Function names missing in error messages on Sparc
Submitted: 2007-01-22 11:37 UTC Modified: 2007-03-27 01:00 UTC
From: andrey@php.net Assigned:
Status: No Feedback Package: Filesystem function related
PHP Version: 6CVS-2007-03-19 (CVS) OS: Debian Linux/Sparc
Private report: No CVE-ID: None
Have you experienced this issue?
Rate the importance of this bug to you:

 [2007-01-22 11:37 UTC] andrey@php.net
Description:
------------
Just php -v on Sparc crashed php (this is HEAD).
gcc 4.1

Reproduce code:
---------------
php -v

Expected result:
----------------
no crash

Actual result:
--------------
andrey@sparc:~/dev/6$ gdb ./php
GNU gdb 6.4.90-debian
Copyright (C) 2006 Free Software Foundation, Inc.
GDB is free software, covered by the GNU General Public License, and you are
welcome to change it and/or distribute copies of it under certain conditions.
Type "show copying" to see the conditions.
There is absolutely no warranty for GDB.  Type "show warranty" for details.
This GDB was configured as "sparc-linux-gnu"...Using host libthread_db library "/lib/libthread_db.so.1".

(gdb) run -v
Starting program: /home/andrey/dev/php6.0-200701212330/php -v
warning: Lowest section in /usr/lib/libicudata.so.36 is .hash at 000000b4
[Thread debugging using libthread_db enabled]
[New Thread 16384 (LWP 3856)]

Program received signal SIGBUS, Bus error.
[Switching to Thread 16384 (LWP 3856)]
0x00315678 in _zend_mm_alloc_int (heap=0x507588, size=5, __zend_filename=0x4c9b38 "/home/andrey/dev/6/Zend/zend_operators.c", __zend_lineno=2392, __zend_orig_filename=0x0,
    __zend_orig_lineno=0) at /home/andrey/dev/6/Zend/zend_alloc.c:1499
1499            ZEND_MM_SET_DEBUG_INFO(best_fit, size, 1, 1);
(gdb) bt
#0  0x00315678 in _zend_mm_alloc_int (heap=0x507588, size=5, __zend_filename=0x4c9b38 "/home/andrey/dev/6/Zend/zend_operators.c", __zend_lineno=2392, __zend_orig_filename=0x0,
    __zend_orig_lineno=0) at /home/andrey/dev/6/Zend/zend_alloc.c:1499
#1  0x00316f78 in _emalloc (size=5, __zend_filename=0x4c9b38 "/home/andrey/dev/6/Zend/zend_operators.c", __zend_lineno=2392, __zend_orig_filename=0x0, __zend_orig_lineno=0)
    at /home/andrey/dev/6/Zend/zend_alloc.c:1864
#2  0x0034f7d0 in zend_str_tolower_dup (source=0x50e108 "TRUE", length=4) at /home/andrey/dev/6/Zend/zend_operators.c:2392
#3  0x0034fd3c in zend_u_str_case_fold (type=6 '\006', source=
/build/buildd/gdb-6.4.90.dfsg/gdb/regcache.c:175: internal-error: register_size: Assertion `regnum >= 0 && regnum < (NUM_REGS + NUM_PSEUDO_REGS)' failed.
A problem internal to GDB has been detected,
further debugging may prove unreliable.
Quit this debugging session? (y or n) n

/build/buildd/gdb-6.4.90.dfsg/gdb/regcache.c:175: internal-error: register_size: Assertion `regnum >= 0 && regnum < (NUM_REGS + NUM_PSEUDO_REGS)' failed.
A problem internal to GDB has been detected,
further debugging may prove unreliable.
Create a core file of GDB? (y or n) n
) at /home/andrey/dev/6/Zend/zend_operators.c:2479
#4  0x003325ec in zend_u_register_constant (type=6 '\006', c=0xffca35f8, tsrm_ls=0x506060) at /home/andrey/dev/6/Zend/zend_constants.c:383
#5  0x003329e0 in zend_register_constant (c=0xffca35f8, tsrm_ls=0x506060) at /home/andrey/dev/6/Zend/zend_constants.c:425
#6  0x00331468 in zend_register_standard_constants (tsrm_ls=0x506060) at /home/andrey/dev/6/Zend/zend_constants.c:143
#7  0x00357378 in zend_startup (utility_functions=0xffca3724, extensions=0x0, start_builtin_functions=1) at /home/andrey/dev/6/Zend/zend.c:1105
#8  0x002a61b0 in php_module_startup (sf=0x503b84, additional_modules=0x0, num_additional_modules=0) at /home/andrey/dev/6/main/main.c:1598
#9  0x0042d07c in main (argc=2, argv=0xffca3a84) at /home/andrey/dev/6/sapi/cli/php_cli.c:709


Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2007-01-22 11:49 UTC] tony2001@php.net
It is known to crash on Solaris/SPARC when built with GCC 4.1, but NOT with GCC 3.x.
I'd be grateful if you find the reason, but it looks like it's a problem of newer versions of GCC on SPARC.
 [2007-01-22 14:52 UTC] andrey@php.net
Downgraded to 3.4, now builds and starts without problems, but the errors are in bad condition - the function name is printed. Endiannees problem?
andrey@sparc:~/dev/6$ sapi/cli/php -r 'file_get_contents("nofile.txt");'

Warning: (nofile.txt): failed to open stream: No such file or directory in Command line code on line 1


The problem lies somewhere here :
function.v is not NULL, but function_name_is_string is false. Otherwise function.s points to the right string, which is "file_get_contents"

	/* if we still have memory then format the origin */
	if (function.v) {
		if (function_name_is_string) {
			origin_len = spprintf(&origin, 0, "%v%s%s(%s)", class_name, space, function.s, params);
		} else {
			origin_len = spprintf(&origin, 0, "%v%s%v(%s)", class_name, space, function, params);
		}
	} else {
		origin_len = spprintf(&origin, 0, "%s", stage);
	}

Tony, please contact me if you need more information.
 [2007-01-22 16:25 UTC] tony2001@php.net
PHP6 on Solaris is not my high priority at the moment.
I'm using GCC 3.4.2 and PHP5.2.x, which works just fine here.
 [2007-01-29 21:24 UTC] tony2001@php.net
Looks like some GCC problem reproducible only on Solaris.

 [2007-01-30 10:27 UTC] andrey@php.net
Actually I am using Debian/SPARC, thus it seems like GCC problem on SPARC (gcc 4.1, 3.4 works well)
 [2007-02-19 18:30 UTC] tony2001@php.net
Please try using this CVS snapshot:

  http://snaps.php.net/php5.2-latest.tar.gz
 
For Windows:
 
  http://snaps.php.net/win32/php5.2-win32-latest.zip

This should be fixed now.
 [2007-02-27 01:00 UTC] php-bugs at lists dot php dot net
No feedback was provided for this bug for over a week, so it is
being suspended automatically. If you are able to provide the
information that was originally requested, please do so and change
the status of the bug back to "Open".
 [2007-03-19 16:54 UTC] andrey@php.net
Still fails, PHP6 is php6.0-200703191330, fresh from snaps

andrey@sparc:~/dev/php6_head$ sapi/cli/php -r 'file_get_contents("nofile.txt");'

Warning: (nofile.txt): failed to open stream: No such file or directory in Command line code on line 1
andrey@sparc:~/dev/php6_head$ sapi/cli/php -v
PHP 6.0.0-dev (cli) (built: Mar 19 2007 15:40:33) (DEBUG)
Copyright (c) 1997-2007 The PHP Group
Zend Engine v3.0.0-dev, Copyright (c) 1998-2007 Zend Technologies
 [2007-03-19 16:57 UTC] tony2001@php.net
Any chance to use GCC 4.1.2 ?
 [2007-03-19 19:17 UTC] andrey@php.net
Last time I checked with gcc4, PHP was crashing on start-up. Has this been fixed?
 [2007-03-19 19:24 UTC] tony2001@php.net
Yes.
 [2007-03-27 01:00 UTC] php-bugs at lists dot php dot net
No feedback was provided for this bug for over a week, so it is
being suspended automatically. If you are able to provide the
information that was originally requested, please do so and change
the status of the bug back to "Open".
 
PHP Copyright © 2001-2019 The PHP Group
All rights reserved.
Last updated: Wed Nov 13 14:01:29 2019 UTC