php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #49224 Segmentation fault
Submitted: 2009-08-11 13:15 UTC Modified: 2009-10-24 01:00 UTC
Votes:3
Avg. Score:4.7 ± 0.5
Reproduced:3 of 3 (100.0%)
Same Version:1 (33.3%)
Same OS:0 (0.0%)
From: alahaye at fm2i dot com Assigned: scottmac (profile)
Status: No Feedback Package: Apache2 related
PHP Version: 5.3.0 OS: HPUX 11.31
Private report: No CVE-ID: None
 [2009-08-11 13:15 UTC] alahaye at fm2i dot com
Description:
------------
Segmentation fault on Apache when using simple script (generaly with functions like header, error_reporting, etc...

Reproduce code:
---------------
<?php

error_reporting(E_ALL);

?>

<?php
error_reporting(E_ALL);
session_start();
header("Expires: Mon, 26 Jul 1997 05:00:00 GMT");
session_cache_expire(32000);
....
?>

Expected result:
----------------
script running :-)

Actual result:
--------------
Export of GDB :

(gdb) run -X

Program received signal SIGSEGV, Segmentation fault
  si_code: 2 - SEGV_ACCERR - Invalid Permissions for object.
0x2000000076ee3340:0 in _zval_ptr_dtor (zval_ptr=0x7fffce50) at zend.h:403
403             return --pz->refcount__gc;


Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2009-08-11 13:21 UTC] alahaye at fm2i dot com
Sorry HPUX version is 11.31 64bits
 [2009-08-11 13:40 UTC] felipe@php.net
Please try using this snapshot:

  http://snaps.php.net/php5.3-latest.tar.gz
 
For Windows:

  http://windows.php.net/snapshots/


 [2009-08-12 07:58 UTC] alahaye at fm2i dot com
With Snaps during compilation:
==============================

"/websuite/build/php5.3/ext/standard/dns.c", line 501: warning #4212-mismatch between character pointer types "u_char *" and "const char *"
                                        add_next_index_stringl(entries, cp + ll 
+ 1, n, 1);
                                                                        ^

"/websuite/build/php5.3/ext/standard/dns.c", line 507: warning #4212-D: 
          mismatch between character pointer types "u_char *" and "char *"
                                add_assoc_stringl(*subarray, "txt", tp, dlen - 1
, 0);
                                                                    ^

"/websuite/build/php5.3/ext/standard/dns.c", line 813: error #2136: struct
          "__res_state" has no field "res_h_errno"
                                if (php_dns_errno(handle) == NO_DATA) {
                                    ^

"/websuite/build/php5.3/ext/standard/dns.c", line 940: warning #4232-D: 
          conversion from "u_char (*)[8192]" to a more strictly aligned type
          "HEADER *" may cause misaligned access
        hp = (HEADER *)&ans;
             ^

1 error detected in the compilation of "/websuite/build/php5.3/ext/standard/dns.
c".
*** Error exit code 1
 [2009-08-12 08:12 UTC] scottmac@php.net
Can you grab a copy of the __res_state struct from resolv.h, I'm curious to what you have there.

Also what version of Bind is installed?
 [2009-08-12 08:42 UTC] alahaye at fm2i dot com
Hi, here the structure in /usr/lib/resolv.h

Version of file is 

 *	@(#)B.11.31_LRresolv.h	8.1 (Berkeley) 6/2/93
 *	$Id: resolv.h,v 8.10 1996/11/18 09:08:49 vixie Exp $

No field "res_h_errno"

struct __res_state {
	int	retrans;	 	/* retransmition time interval */
	int	retry;			/* number of times to retransmit */
        unsigned int options;           /* option flags - see below. */
	int	nscount;		/* number of name servers */
#ifdef IPV6
	union {
           struct sockaddr_in6
                   *nsaddr_list6;
           struct sockaddr_in
                nsaddr_list[MAXNS];     /* address of name server */
	} nsaddr_list;
#define nsaddr  nsaddr_list.nsaddr_list[0]    /* for backward compatibility */
#else
        struct sockaddr_in
                nsaddr_list[MAXNS];     /* address of name server */
#define nsaddr  nsaddr_list[0]
#endif
	u_short	id;			/* current message id */
	char	defdname[256];		/* default domain (deprecated) */
	char	*dnsrch[MAXDNSRCH+1];	/* components of domain to search */
	unsigned int pfcode;		/* RES_PRF_ flags - see below. */
	u_char ndots:4;		        /* threshold for initial abs. query */
	u_char nsort:4;		        /* number of elements in sort_list[] */
	char	unused[3];
#ifdef IPV6
	union {
              struct in6_addr 
		*sort_list6;
              struct {
                struct in_addr  addr;
                uint32_t        mask;
              } sort_list[MAXRESOLVSORT];
	  } sort_list;
#else
        struct {
              struct in_addr  addr;
              uint32_t        mask;
            } sort_list[MAXRESOLVSORT];
#endif

} ;
 [2009-08-12 09:12 UTC] scottmac@php.net
Is there any chance to get an account on this box to do some testing?

I can provide an SSH key.
 [2009-08-12 09:24 UTC] alahaye at fm2i dot com
unfortunatly no... it's on a local network, no VPN or DMZ access.
 [2009-08-12 09:37 UTC] alahaye at fm2i dot com
Bind version is 9.3.2. For me it's very strange because last compilation about PHP 5.3.0 stable was successfull and not with the snap.
 [2009-08-12 10:36 UTC] scottmac@php.net
Can you mail me your config.log and your resolv.h file.


 [2009-08-14 12:11 UTC] alahaye at fm2i dot com
Hi, did you receive my files ?
 [2009-09-12 14:28 UTC] jani@php.net
Scott, what's the status with this?
 [2009-09-28 13:13 UTC] neko at nekochan dot net
The compilation issue in dns.c also occurs under IRIX 6.5.30:

cc-1565 c99: ERROR File = /opt/build/php-5.3.1RC1/ext/standard/dns.c, 
Line = 813
  The struct "__res_state" has no field "res_h_errno".

                                if (php_dns_errno(handle) == NO_DATA) {
                                    ^

1 error detected in the compilation of "/opt/build/php-
5.3.1RC1/ext/standard/dns.c".
 [2009-10-16 02:10 UTC] svn@php.net
Automatic comment from SVN on behalf of scottmac
Revision: http://svn.php.net/viewvc/?view=revision&revision=289691
Log: Part fix for bug #49224
 [2009-10-16 02:11 UTC] scottmac@php.net
Please try using this snapshot:

  http://snaps.php.net/php5.3-latest.tar.gz
 
For Windows:

  http://windows.php.net/snapshots/

Just fixed the DNS issue in a snapshot, can you try this again to 
reproduce the original issue.
 [2009-10-24 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-2024 The PHP Group
All rights reserved.
Last updated: Thu Nov 21 15:01:30 2024 UTC