Re: [PHP-DEV] 64bit PHP on solaris

2003-03-15 Thread Chris Field
For my own education, is there a reason they were passed as void* to
begin with? 

On Fri, 2003-03-14 at 23:43, James Devenish wrote: 
 In message [EMAIL PROTECTED]
 on Fri, Mar 14, 2003 at 05:22:11PM +, Wez Furlong wrote:
  Please coordinate with me on streams issues; if some 64bit oses
  declare descriptors as longs rather than ints, then we could have a
  bigger job on our hands (similar to the mess with socket types under
  win32).
 
 Regardless of any potential disasters with _php_stream_cast, there are
 at least a few unsubtle storage-type conflicts. In my case, fds are
 stored as ints but PHP casts them to pointers.
 
 In message [EMAIL PROTECTED]
 on Fri, Mar 14, 2003 at 11:00:50AM -0500, David Hill wrote:
  Sorry but I don't commit what I don't understand, and the three streams
  files needed some more understanding on my part. In those areas the php5
  head differs quite a bit from the 4_3 stream.
 
 Regardless of what you personally understand (and what I personally
 understand), my point would be that the problems are simply unfixed
 by *anyone*.
 
 Even so, I don't know what would be hard for anyone to understand about
 my patches (and no-one has asked me in the past). If you think there
 simply too many of them, most of them are probably whitespace
 disagreements between what you committed and what the PHP style appears
 to be. The basis of all my streams patches is like this (from the old
 streams.c):
 
 Index: main/streams.c
 ===
 RCS file: /repository/php4/main/Attic/streams.c,v
 retrieving revision 1.125.2.37
 diff -u -u -r1.125.2.37 streams.c
 -- main/streams.c 6 Mar 2003 20:58:19 -   1.125.2.37
 +++ main/streams.c8 Mar 2003 10:48:16 -
 @@ -1532,7 +1532,7 @@
   }
   if (ret) {
   fflush(data-file);
 - *ret = (void*)fd;
 + *(int*)ret = fd;
   }
   return SUCCESS;
   default:
 
 What have I done? Well, someone's taking fd (declared as an 'int', which
 may be 32 bits on some systems), casting it a void* (a 64-bit value on
 some systems) and then stuffing that into storage space which, although
 it might not be obvious, happens to be only 32 bits wide. My patch takes
 fd (the 'int') and stuffs it into 'int' storage. Now that's not to say
 that the destination IS actually an 'int' but merely that I am keeping
 the int at its original width rather than casting it up. It's not a
 'perfect solution', but it's not a 'perfect problem', either.


-- 

Chris Field [EMAIL PROTECTED]

-- 
PHP Development Mailing List http://www.php.net/
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP-DEV] 64bit PHP on solaris

2003-03-13 Thread Chris Field
We have been attempting to run php on a brand new sun v880, and have had
a number of problems.  

first file_get_contents  readfile both core dump with bus errors b/c
the file descriptors are typed as int's when they should be longs
(steams.c lines 1020/1156)

second, and far stranger is when you open a file with the mode 'a' it
opens it the does a seek using SEEK_CUR which leaves the file pointer at
the beginning of the file, shouldn't that bee a SEEK_END?  Altering that
results in expected functionality, will it break anything else?

third, and even stranger, is in php_spn_common_handler it calls:
zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, ss|ll, s11, 
len1, s22, len2, start, len)

the va_list has the correct values for the length of the two strings
passed in, however the lengths are never assigned into len1 and len2, as
it seems they should be.  Any ideas about why this is, I am kind of at a
loss, in the mean time I simply set the lengths of the two strings in
php_spn_common_handler after the parse_parameters function returns which
fixes it.


-- 
Chris Field
[EMAIL PROTECTED]
Affinity Solutions Inc.
386 Park Avenue South
Suite 1209
New York, NY 10016
(212) 685-8748 ext. 32


signature.asc
Description: This is a digitally signed message part


Re: [PHP-DEV] 64bit PHP on solaris

2003-03-13 Thread Chris Field
I am working off a checkout from about three days ago...



On Thu, 2003-03-13 at 11:21, Wez Furlong wrote:
 Make sure that you are using the latest stable snapshot from
 http://snaps.php.net; a number of 64bit issues have already been addressed.
 
 --Wez.
 
 On Thu, 13 Mar 2003, Chris Field wrote:
 
  We have been attempting to run php on a brand new sun v880, and have had
  a number of problems.
 
  first file_get_contents  readfile both core dump with bus errors b/c
  the file descriptors are typed as int's when they should be longs
  (steams.c lines 1020/1156)
 
  second, and far stranger is when you open a file with the mode 'a' it
  opens it the does a seek using SEEK_CUR which leaves the file pointer at
  the beginning of the file, shouldn't that bee a SEEK_END?  Altering that
  results in expected functionality, will it break anything else?
 
  third, and even stranger, is in php_spn_common_handler it calls:
  zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, ss|ll, s11,
  len1, s22, len2, start, len)
 
  the va_list has the correct values for the length of the two strings
  passed in, however the lengths are never assigned into len1 and len2, as
  it seems they should be.  Any ideas about why this is, I am kind of at a
  loss, in the mean time I simply set the lengths of the two strings in
  php_spn_common_handler after the parse_parameters function returns which
  fixes it.
 
 
  --
  Chris Field
  [EMAIL PROTECTED]
  Affinity Solutions Inc.
  386 Park Avenue South
  Suite 1209
  New York, NY 10016
  (212) 685-8748 ext. 32
 
-- 
Chris Field
[EMAIL PROTECTED]
Affinity Solutions Inc.
386 Park Avenue South
Suite 1209
New York, NY 10016
(212) 685-8748 ext. 32


signature.asc
Description: This is a digitally signed message part