php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #23308 PHP Interpreter dies with Bus Error (Signal 10) (HP-UX 64bit/Vendor cc)
Submitted: 2003-04-22 15:03 UTC Modified: 2003-04-28 10:23 UTC
Votes:1
Avg. Score:5.0 ± 0.0
Reproduced:1 of 1 (100.0%)
Same Version:1 (100.0%)
Same OS:1 (100.0%)
From: pavel dot may at csun dot edu Assigned:
Status: Closed Package: Reproducible crash
PHP Version: 4.3.2-RC OS: HP-UX 11i (11.11)
Private report: No CVE-ID: None
 [2003-04-22 15:03 UTC] pavel dot may at csun dot edu
Environment first:

OS - HP-UX 11.11 (11i)
C compiler: HP-UX ANSI C v B.11.11.06 with PHSS_28706 patch
PHP: 4.3.1

./configure arguments: --prefix=/opt/php-4.3.1 --enable-sigchild --with-openssl=/opt/openssl-0.9.7b --with-zlib --with-flatfile --with-mysql=/usr/MySQL-3.23.55 --disable-cgi

CFLAGS: +DD64 +z -I/usr/local/include -I/usr/include -I/usr/ccs/include -I/opt/include -g
LDFLAGS: +s +z +DD64 -L/lib/pa20_64 -L/opt/lib/pa20_64 -L/usr/local/lib -L/usr/ccs/lib -L/usr/lib

ZLib version: 1.1.4
OpenSSL version: 0.9.7b
MySQL version: 3.23.55 (binary install)

GDB backtrace:
[149]$ /opt/langtools/bin/gdb php core
Detected 64-bit executable.
Invoking /opt/langtools/bin/gdb64.
HP gdb 3.1 for PA-RISC 2.0 (wide), HP-UX 11.00.
Copyright 1986 - 2001 Free Software Foundation, Inc.
Hewlett-Packard Wildebeest 3.1 (based on GDB) is covered by the
GNU General Public License. Type "show copying" to see the conditions to
change it and/or distribute copies. Type "show warranty" for warranty/support.
..
Core was generated by `php'.
Program terminated with signal 10, Bus error.

warning: The shared libraries were not privately mapped; setting a
breakpoint in a shared library will not work until you rerun the program.

#0  0x400000000027b138 in OnUpdateInt (entry=0x80000001000d81c8, new_value=0x8000000100000478 "-1", new_value_length=2, 
    mh_arg1=0x8c <Address 0x8c out of bounds>, mh_arg2=0x8000000100060580 "", mh_arg3=0x0, stage=1)
    at /home/users0/ccs/ulairi/sources/PHP/php-4.3.1/Zend/zend_ini.c:444
444             *p = zend_atoi(new_value, new_value_length);

(gdb) bt
#0  0x400000000027b138 in OnUpdateInt (entry=0x80000001000d81c8, new_value=0x8000000100000478 "-1", new_value_length=2, 
    mh_arg1=0x8c <Address 0x8c out of bounds>, mh_arg2=0x8000000100060580 "", mh_arg3=0x0, stage=1)
    at /home/users0/ccs/ulairi/sources/PHP/php-4.3.1/Zend/zend_ini.c:444
#1  0x40000000000c9d90 in OnUpdate_zlib_output_compression_level (entry=0x80000001000d81c8, new_value=0x8000000100000478 "-1", 
    new_value_length=2, mh_arg1=0x8c <Address 0x8c out of bounds>, mh_arg2=0x8000000100060580 "", mh_arg3=0x0, stage=1)
    at /home/users0/ccs/ulairi/sources/PHP/php-4.3.1/ext/zlib/zlib.c:170
#2  0x400000000027a290 in zend_register_ini_entries (ini_entry=0x8000000100000698, module_number=12)
    at /home/users0/ccs/ulairi/sources/PHP/php-4.3.1/Zend/zend_ini.c:157
#3  0x40000000000c9f68 in zm_startup_zlib (type=1, module_number=12)
    at /home/users0/ccs/ulairi/sources/PHP/php-4.3.1/ext/zlib/zlib.c:218
#4  0x400000000026a4e4 in zend_startup_module (module=0x8000000100000298)
    at /home/users0/ccs/ulairi/sources/PHP/php-4.3.1/Zend/zend_API.c:1008
#5  0x4000000000206ba4 in php_startup_extensions (ptr=0x800000010001dfa8, count=12)
    at /home/users0/ccs/ulairi/sources/PHP/php-4.3.1/main/main.c:986
#6  0x400000000028c354 in php_startup_internal_extensions () at main/internal_functions_cli.c:73
#7  0x40000000002073b4 in php_module_startup (sf=0x800000010001de88, additional_modules=0x0, num_additional_modules=0)
    at /home/users0/ccs/ulairi/sources/PHP/php-4.3.1/main/main.c:1151
#8  0x4000000000289b7c in main (argc=1, argv=0x800003ffff7f0ac8)
    at /home/users0/ccs/ulairi/sources/PHP/php-4.3.1/sapi/cli/php_cli.c:481
(gdb) quit


Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2003-04-22 15:57 UTC] rasmus@php.net
I assume this is a 64-bit box?  You are probably going to have to use the CVS version.  A lot of 64-bit issues were fixed since 4.3.1.  See http://snaps.php.net and grab the latest 4.3 snapshot tarball.
 [2003-04-22 16:40 UTC] pavel dot may at csun dot edu
Grabbed the latest 4.3.x-dev:

[250]$ gmake test

=====================================================================
CWD         : /home/users0/ccs/ulairi/sources/PHP/php4-STABLE-200304221930
PHP         : /home/users0/ccs/ulairi/sources/PHP/php4-STABLE-200304221930/sapi/cli/php 
PHP_SAPI    : cli
PHP_VERSION : 4.3.2-RC
ZEND_VERSION: 1.3.0
PHP_OS      : HP-UX
INI actual  : 
More .INIs  : 
Extra dirs  : 
=====================================================================
TIME START 2003-04-22 14:38:44
=====================================================================

Fatal error: Call to undefined function:  uniqid() in /home/users0/ccs/ulairi/sources/PHP/php4-STABLE-200304221930/run-tests.php on line 568
gmake: *** [test] Error 255
 [2003-04-22 20:17 UTC] rasmus@php.net
uniqid() is only available if HAVE_GETTIMEOFDAY is defined.  Did the configure check for gettimeofday() fail on you?  Check your main/php_config.h file to see if it is defined and also your config.log file to see if you can figure out why the configure check failed.

But, apart from the make test stuff, does it work?
 [2003-04-22 21:22 UTC] pavel dot may at csun dot edu
I've forced the compiler to compile to the HPPA 1.1 spec (32-bit) with bare -- directives for configure and all seems well. I'll try the full ugly thing I was trying originally in a bit.

From the gmake test:

=====================================================================
TIME END 2003-04-22 16:29:40
=====================================================================
TEST RESULT SUMMARY
---------------------------------------------------------------------
Exts skipped    :   80
Exts tested     :    8
---------------------------------------------------------------------
Number of tests :  443
Tests skipped   :  229 (51.7%)
Tests failed    :    5 ( 1.1%)
Tests passed    :  209 (47.2%)
---------------------------------------------------------------------
Time taken      :  154 seconds
=====================================================================

=====================================================================
FAILED TEST SUMMARY
---------------------------------------------------------------------
Bug #21131: fopen($filename, "a+") has broken position [ext/standard/tests/file/bug21131.phpt]
Various pow() tests [ext/standard/tests/math/pow.phpt]
Test strtoupper on non-ASCII characters [ext/standard/tests/strings/strtoupper.phpt]
strtotime() function [ext/standard/tests/time/002.phpt]
Check for mktime with out-of-range parameters [ext/standard/tests/time/003.phpt]
=====================================================================

(Posted to qa.php.net)

I was uncomfortable seeing so many tests fail for stuff that should have worked. 

If I may be so bold as to suggest a strategy here, I'd say have configure check the CFLAGS/LDFLAGS environment variables and either override them or complain bitterly (later is what I like to see, but that is a separate issue).

For reference, here's my environment:

[277]$ set | grep "FLAGS"
CFLAGS=+DA1.1 +z -I/usr/local/include -I/usr/include -I/usr/ccs/include
CPPFLAGS=+DA1.1 +z -I/usr/local/include -I/usr/include -I/usr/ccs/include
LDFLAGS=+s -L/usr/local/lib -L/usr/ccs/lib -L/usr/lib

With HP's ANSI C compiler, the architechture target is defined by the +DA1.1 or +DA2.0 or +DD64.

Unfortunately, I am still learning about Makefile, ./configure and their bretheren, so I do not have an exact patch available.
 [2003-04-22 21:26 UTC] pavel dot may at csun dot edu
Re: UniqID() and HAVE_GETTIMEOFDAY in main/php_config.h:

I'll try to recompile with a 64-bit C/LDFLAGS and see. First, 32-bit compile with all the funky configure options :) (I want to give something to the users and move on from there).
 [2003-04-22 21:45 UTC] pavel dot may at csun dot edu
Re: GetTimeOfDay and UniqID:

From the 4.3.2-RC config.log:
configure:20209: checking for gettimeofday
configure:20259: cc -o conftest +DD64 +z -I/usr/local/include -I/usr/include -I/usr/ccs/include -I/opt/include +DD64 +z -I/usr/local/include -I/usr/include -I/usr/ccs/include -I/opt/include +s +z +DD64 -L/lib/pa20_64 -L/opt/lib/pa20_64 -L/usr/local/lib -L/usr/ccs/lib -L/usr/lib -L/opt/local/appdev/software/oracle/product/8.1.7/lib64 -L/opt/local/appdev/software/oracle/product/8.1.7/lib conftes
t.c -lm -lpthread -lcl -lnsl -lnm -ldld -lm -lc -lsec >&5
cc: warning 422: Unknown option "s" ignored.
cc: "configure", line 20317: warning 573: Parameter list is inconsistent for "gettimeofday".
cc: "configure", line 20317: error 1584: Inconsistent type declaration: "gettimeofday".
cc: "configure", line 20324: warning 604: Pointers are not assignment-compatible.
cc: "configure", line 20333: warning 605: Illegal pointer combination for !=.
configure:20262: $? = 1
configure: failed program was:
| #line 20214 "configure"
| /* confdefs.h.  */
|
| #define PACKAGE_NAME ""
| #define PACKAGE_TARNAME ""
| #define PACKAGE_VERSION ""
| #define PACKAGE_STRING ""
| #define PACKAGE_BUGREPORT ""
| #define YYTEXT_POINTER 1
| #define PHP_APACHE_HAVE_CLIENT_FD 1
| #define MISSING_LOCALTIME_R_DECL 1
| #define MISSING_GMTIME_R_DECL 1
| #define MISSING_ASCTIME_R_DECL 1
| #define MISSING_CTIME_R_DECL 1
| #define MISSING_STRTOK_R_DECL 1
| #define HAVE_SENDMAIL 1
| #define HAVE_SOCKET 1
| #define HAVE_GETHOSTNAME 1
| #define HAVE_GETHOSTBYADDR 1
| #define HAVE_YP_GET_DEFAULT_DOMAIN 1
| #define HAVE_DLOPEN 1
| #define HAVE_LIBDL 1
| #define HAVE_LIBM 1
| #define HAVE_RES_SEARCH 1
| #define HAVE_INET_ATON 1
| #define HAVE_DN_SKIPNAME 1
| #define STDC_HEADERS 1
| #define HAVE_DIRENT_H 1
| #define MISSING_FCLOSE_DECL 0
| #define HAVE_SYS_TYPES_H 1
| #define HAVE_SYS_TIME_H 1
| #define HAVE_NETINET_IN_H 1
| #define HAVE_ALLOCA_H 1
| #define HAVE_ARPA_INET_H 1
| #define HAVE_ARPA_NAMESER_H 1
| #define HAVE_ASSERT_H 1
| #define HAVE_CRYPT_H 1
| #define HAVE_FCNTL_H 1
| #define HAVE_GRP_H 1
| #define HAVE_LANGINFO_H 1
| #define HAVE_LIMITS_H 1
| #define HAVE_LOCALE_H 1
| #define HAVE_MONETARY_H 1
| #define HAVE_NETDB_H 1
| #define HAVE_PWD_H 1
| #define HAVE_RESOLV_H 1
| #define HAVE_SIGNAL_H 1
| #define HAVE_STDARG_H 1
| #define HAVE_STDLIB_H 1
| #define HAVE_STRING_H 1
| #define HAVE_SYSLOG_H 1
| #define HAVE_SYSEXITS_H 1
| #define HAVE_SYS_FILE_H 1
| #define HAVE_SYS_MMAN_H 1
| #define HAVE_SYS_MOUNT_H 1
| #define HAVE_SYS_POLL_H 1
| #define HAVE_SYS_RESOURCE_H 1
| #define HAVE_SYS_SOCKET_H 1
| #define HAVE_SYS_STATVFS_H 1
| #define HAVE_SYS_VFS_H 1
| #define HAVE_SYS_WAIT_H 1
| #define HAVE_UNISTD_H 1
| #define HAVE_UTIME_H 1
| #define HAVE_SYS_UTSNAME_H 1
| #define HAVE_SYS_IPC_H 1
| #define HAVE_BROKEN_GLIBC_FOPEN_APPEND 1
| #define HAVE_TZNAME 1
| #define HAVE_STRUCT_FLOCK 1
| #define HAVE_SOCKLEN_T 1
| #define SIZEOF_LONG 8
| #define SIZEOF_INT 4
| #define HAVE_VPRINTF 1
| #define HAVE_DOPRNT 1
| #define HAVE_ALPHASORT 1
| #define HAVE_ASCTIME_R 1
| #define HAVE_CHROOT 1
| #define HAVE_CTIME_R 1
| #define HAVE_CUSERID 1
| #define HAVE_CRYPT 1
| #define HAVE_FTOK 1
| #define HAVE_GCVT 1
| #define HAVE_GETLOGIN 1
| #define HAVE_GETPROTOBYNAME 1
| #define HAVE_GETPROTOBYNUMBER 1
| #define HAVE_GETSERVBYNAME 1
| #define HAVE_GETSERVBYPORT 1
| #define HAVE_GETRUSAGE 1
| /* end confdefs.h.  */
| /* System header to define __stub macros and hopefully few prototypes,
|     which can conflict with char gettimeofday (); below.
|     Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
|     <limits.h> exists even on freestanding compilers.  */
| #ifdef __STDC__
| # include <limits.h>
| #else
| # include <assert.h>
| #endif
| /* Override any gcc2 internal prototype to avoid an error.  */
| #ifdef __cplusplus
| extern "C"
| {
| #endif
| /* We use char because int might match the return type of a gcc2
|    builtin and then its argument prototype would still apply.  */
| char gettimeofday ();
| /* The GNU C library defines this for functions which it implements
|     to always fail with ENOSYS.  Some functions are actually named
|     something starting with __ and the normal name is an alias.  */
| #if defined (__stub_gettimeofday) || defined (__stub___gettimeofday)
| choke me
| #else
| char (*f) () = gettimeofday;
| #endif
| #ifdef __cplusplus
| }
| #endif
|
| int
| main ()
| {
| return f != gettimeofday;
|   ;
|   return 0;
| }
configure:20279: result: no

Oddly enough, in 4.3.1 under 'you will compile HPPA 1.1/32bit targets' regime, config.log has:

configure:13876: checking for gettimeofday
configure:13904: cc -o conftest +DA1.1 +z -I/usr/local/include -I/usr/include -I/usr/ccs/include +DA1.1 +z -I/usr/local/include -I/usr/include -I/usr/ccs/include +s -L/usr/local/lib -L/usr/ccs/lib -L/usr/lib -L/opt/local/appdev/software/oracle/product/8.1.7/lib64
-L/opt/local/appdev/software/oracle/product/8.1.7/lib  conftest.c -lm -lcl -lpthread -lnsl -lnm -ldld -lm -lc -lcrypt -lsec 1>&5
cc: warning 422: Unknown option "s" ignored.
 [2003-04-22 21:53 UTC] rasmus@php.net
There are quite a few 64-bit fixes/changes that have gone into CVS since 4.3.1.  A lot of them by an HP engineer in Cupertino.  I'll see if I can poke him to take a look at this bug report.
 [2003-04-23 11:33 UTC] pavel dot may at csun dot edu
Most excellent. I'll see what I can find out on my end by experimenting, too.b
 [2003-04-23 18:09 UTC] pavel dot may at csun dot edu
=====================================================================
FAILED TEST SUMMARY
---------------------------------------------------------------------
OpenSSL private key functions [ext/openssl/tests/001.phpt]
Bug #21131: fopen($filename, "a+") has broken position [ext/standard/tests/file/bug21131.phpt]
Various pow() tests [ext/standard/tests/math/pow.phpt]
Test strtoupper on non-ASCII characters [ext/standard/tests/strings/strtoupper.phpt]
strtotime() function [ext/standard/tests/time/002.phpt]
Check for mktime with out-of-range parameters [ext/standard/tests/time/003.phpt]
=====================================================================

Configure parameters:

 --prefix=/opt/php-4.3.1 --bindir=/opt/php-4.3.1/bin/pa11_32 --libdir=/opt/php-4.3.1/bin/pa11_32 --sbindir=/opt/php-4.3.1/sbin/pa11_32 --enable-sigchild --with-openssl=/opt/openssl-0.9.7b/pa_1.1 --with-zlib --with-flatfile --disable-cgi --without-mysql

The bundled MySQL stuff fails rather spectacularly under my setup, if there is interest as to how (even under HPPA 1.1 32bit build rules), I'll be more then glad to respond / file a different bug.
 [2003-04-25 12:29 UTC] pavel dot may at csun dot edu
STABLE-200304241530 build attempts:

HPPA 2.0/64-bit rules yelds in a failure of the configure script to find GetTimeOfDay, which, in turns, kills 'UniqID()'. 

HPPA 1.1/32-bit rules and HPPA 2.0/64-bit rules both fail to build the bundled MySQL library.

Got a patch, applied it for the bundles MySQL fix, trying it now with HPPA 2.0/64-bit rules. 

Will try HPPA 1.1/32-bit rules afterward.
 [2003-04-25 12:46 UTC] pavel dot may at csun dot edu
With the patch for libmysql, HPPA 2.0/64-bit rules compiles (still fails with the UniqID problem, but that is a separate issue).
 [2003-04-25 18:05 UTC] pavel dot may at csun dot edu
Found the issue with GetTimeOfDay not being dected. 
The configure script's test case uses 'char gettimeofday ();' whereas (at least in FreeBSD and HP-UX) gettimeofday returns an int.
 [2003-04-25 19:07 UTC] pavel dot may at csun dot edu
Having forced the definition of GETTIMEOFDAY in main/php_config.h, the whole setup compiles (using built-in libmysql with patches from Jani), gmake test hangs right after:

PASS Testing register_shutdown_function() [tests/func/005.phpt]
 [2003-04-28 10:22 UTC] sniper@php.net
Please try using this CVS snapshot:

  http://snaps.php.net/php4-STABLE-latest.tar.gz
 
For Windows:
 
  http://snaps.php.net/win32/php4-win32-STABLE-latest.zip

Please try the latest snapshot, the configure should work now
perfectly.

 [2003-04-28 10:23 UTC] ddhill@php.net
The core problem reported has been fixed in CVS and should be present in the latest 4.3.2-RC.

The build issues reported later in this bug have been partially addressed and a new bug will be created if needed.
 
PHP Copyright © 2001-2026 The PHP Group
All rights reserved.
Last updated: Wed Oct 07 08:00:02 2026 UTC