Re: [PHP-DEV] tsrm_ls

2006-04-13 Thread Kamesh Jayachandran

Hi Richard,
I think LS=LIST
CC=Comma(,) Call (, tsrm_ls)
DC = Comma(,) Declare(, void ***tsrm_ls)

With regards
Kamesh Jayachandran

Richard Lynch wrote:

I'm trying to grok PHP Source, and I suspect I've missed some
Beginner guide somewhere.

I'm looking at the TSRM*_* data types in the header files, and have
backtracked as far as 'tsrm_ls' and then...  I'm not finding a place
where that is defined.

I've grepped php-src for it, and only see it used, not defined.

I also grepped /usr/include and /usr/local/include, thinking maybe
it's a standard OS thing.

I know TSRM is thread-safe-resource-manager, but the LS_DC LS_CC etc
system isn't getting into my brain... L for Long? S for string?

What am I missing?

TIA!  (Hoping to do something useful someday...)

  


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



Re: [PHP-DEV] Known Security Risks in PHP

2005-11-09 Thread Kamesh Jayachandran
Hi,

Stefan's http://www.hardened-php.net/advisories.15.html might be what
you look at.

With regards
Kamesh Jayachandran
On Thu, 10 Nov 2005 10:02:55 +0530, R, Rajesh (STSD)
[EMAIL PROTECTED] said:
 
 Hello there,
 
 Is there a specific web resource for known 
 SSRT's(Security risks) in PHP ??
 
 Any pointers would be helpful.
 
 
 Thanks,
 Rajesh R
 
 --
 PHP Internals - PHP Runtime Development Mailing List
 To unsubscribe, visit: http://www.php.net/unsub.php
 

-- 
http://www.fastmail.fm - mmm... Fastmail...

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



[PHP-DEV] change of variable name from tzname to formal_tzname

2005-10-07 Thread Kamesh Jayachandran
Hi Derick,
From Yesterday(06/10/2005) onwards NetWare php-5.1 autotests were
failing because of a segfault from tests/lang/023.phpt which makes one
mktime call.
When delved for the cause it seems that In NetWare LibC SDK's time.h
tzname is expanded to ___tzname() this cause the C preprocessor to
change the tzname to vague ___tzname function call in
php_date_parse_tzfile().
Changing the variable name tzname to formal_tzname or anything more
pleasing in php_date_parse_tzfile should fix it.

http://puggy.symonds.net/~kameshj/php_date.c.patch

Can you check in this?

With regards
Kamesh Jayachandran

-- 
http://www.fastmail.fm - And now for something completely differentÂ…

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



[PHP-DEV] php build fails on php5_1

2005-09-26 Thread Kamesh Jayachandran
This seems to fix
http://puggy.symonds.net/~kameshj/ext_pdo_sqlite_sqlite_statement.c.patch
with regards
Kamesh Jayachandran

-- 
http://www.fastmail.fm - Accessible with your email software
  or over the web

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



[PHP-DEV] what happened to php-5.0.* snaps in http://snaps.php.net

2005-09-15 Thread Kamesh Jayachandran
Hi All,
I could not see the latest snaps of php-5.0.6-dev on
http://snaps.php.net. 
But still could I could get
http://snaps.php.net/php5-STABLE-latest.tar.bz2.

With regards
Kamesh Jayachandran

-- 
http://www.fastmail.fm - A fast, anti-spam email service.

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



Re: [PHP-DEV] what happened to php-5.0.* snaps in http://snaps.php.nett

2005-09-15 Thread Kamesh Jayachandran
Thanks Zeev and Jani for the clarification.
As long as http://snaps.php.net/php5-STABLE-latest.tar.bz2 is available,
I have no issues about what is shown in the web.

With regards
Kamesh Jayachandran
On Thu, 15 Sep 2005 18:17:33 +0300, Zeev Suraski [EMAIL PROTECTED] said:
 Jani,
 
 5_0 is not dead meat right now anymore than 4_4 is.  It's going to be
 used 
 for quite a while still.
 If you had something to do with the removal of the snaps, please revert.
 
 Thanks,
 
 Zeev
 
 At 18:04 15/09/2005, Jani Taskinen wrote:
 
  PHP_5_0 branch is dead meat. Just use PHP_5_1.
 
  --Jani
 
 On Thu, 15 Sep 2005, Kamesh Jayachandran wrote:
 
 
 Hi All,
 I could not see the latest snaps of php-5.0.6-dev on
 http://snaps.php.net.
 But still could I could get
 http://snaps.php.net/php5-STABLE-latest.tar.bz2.
 
 With regards
 Kamesh Jayachandran
 
 
 --
 Donate @ http://pecl.php.net/wishlist.php/sniper
 Disclaimer: Donating money may make me happier and friendlier for a 
 limited period!
 
 --
 PHP Internals - PHP Runtime Development Mailing List
 To unsubscribe, visit: http://www.php.net/unsub.php
 
 -- 
 PHP Internals - PHP Runtime Development Mailing List
 To unsubscribe, visit: http://www.php.net/unsub.php
 

-- 
http://www.fastmail.fm - One of many happy users:
  http://www.fastmail.fm/docs/quotes.html

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



Re: [PHP-DEV] 5.0.6-dev build failure

2005-09-12 Thread Kamesh Jayachandran
Hi All,
Got the root cause of the issue.
$stat parse.y parse.c
  File: `parse.y'
  Size: 32554   Blocks: 64 IO Block: 4096   regular file
Device: 302h/770d   Inode: 740467  Links: 1
Access: (0644/-rw-r--r--)  Uid: ( 1003/phpbuild)   Gid: (  100/   users)
Access: 2005-09-12 12:15:35.847812080 +0530
Modify: 2005-09-07 22:07:47.0 +0530
Change: 2005-09-12 11:32:33.844336272 +0530
  File: `parse.c'
  Size: 143484  Blocks: 288IO Block: 4096   regular file
Device: 302h/770d   Inode: 740465  Links: 1
Access: (0644/-rw-r--r--)  Uid: ( 1003/phpbuild)   Gid: (  100/   users)
Access: 2005-09-12 11:32:39.345499968 +0530
Modify: 2004-07-12 23:14:40.0 +0530
Change: 2005-09-12 11:32:33.841336728 +0530

parse.c(2004-07-12) is older than parse.y (2005-09-07)
touch on parse.c helps in going ahead with the build.(As I could not see
the difference between the 2 parse.y files).

Can someone do something needful in this regard.

With regards
Kamesh Jayachandran
On Thu, 08 Sep 2005 17:01:48 +0530, Kamesh Jayachandran
[EMAIL PROTECTED] said:
 Keep getting the,
 /root/kamesh/work/php5_0/php-src/ext/sqlite/libsqlite/src/parse.y:3.13-19:
 parse error, unexpected {...}
 make: ***
 [/root/kamesh/work/php5_0/php-src/ext/sqlite/libsqlite/src/parse.c]
 Error 1
 
 Can someone look at it.
 
 With regards
 Kamesh Jayachandran
 
 -- 
 http://www.fastmail.fm - Does exactly what it says on the tin
 
 -- 
 PHP Internals - PHP Runtime Development Mailing List
 To unsubscribe, visit: http://www.php.net/unsub.php
 

-- 
http://www.fastmail.fm - A fast, anti-spam email service.

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



Re: [PHP-DEV] 5.0.6-dev build failure

2005-09-12 Thread Kamesh Jayachandran
Hi All,
Seems like Hartmut Holzgraefe had fixed the same issue for 5.1 tree on
May 30th 2005.
Can I reapply the same to 5.0 tree.

Adding http://ductape.net/~kameshj/Makefile.frag to ext/sqlite/
http://ductape.net/~kameshj/sqliteconfig.m4.patch

With regards
Kamesh Jayachandran

On Mon, 12 Sep 2005 12:18:27 +0530, Kamesh Jayachandran
[EMAIL PROTECTED] said:
 Hi All,
 Got the root cause of the issue.
 $stat parse.y parse.c
   File: `parse.y'
   Size: 32554   Blocks: 64 IO Block: 4096   regular file
 Device: 302h/770d   Inode: 740467  Links: 1
 Access: (0644/-rw-r--r--)  Uid: ( 1003/phpbuild)   Gid: (  100/   users)
 Access: 2005-09-12 12:15:35.847812080 +0530
 Modify: 2005-09-07 22:07:47.0 +0530
 Change: 2005-09-12 11:32:33.844336272 +0530
   File: `parse.c'
   Size: 143484  Blocks: 288IO Block: 4096   regular file
 Device: 302h/770d   Inode: 740465  Links: 1
 Access: (0644/-rw-r--r--)  Uid: ( 1003/phpbuild)   Gid: (  100/   users)
 Access: 2005-09-12 11:32:39.345499968 +0530
 Modify: 2004-07-12 23:14:40.0 +0530
 Change: 2005-09-12 11:32:33.841336728 +0530
 
 parse.c(2004-07-12) is older than parse.y (2005-09-07)
 touch on parse.c helps in going ahead with the build.(As I could not see
 the difference between the 2 parse.y files).
 
 Can someone do something needful in this regard.
 
 With regards
 Kamesh Jayachandran
 On Thu, 08 Sep 2005 17:01:48 +0530, Kamesh Jayachandran
 [EMAIL PROTECTED] said:
  Keep getting the,
  /root/kamesh/work/php5_0/php-src/ext/sqlite/libsqlite/src/parse.y:3.13-19:
  parse error, unexpected {...}
  make: ***
  [/root/kamesh/work/php5_0/php-src/ext/sqlite/libsqlite/src/parse.c]
  Error 1
  
  Can someone look at it.
  
  With regards
  Kamesh Jayachandran
  
  -- 
  http://www.fastmail.fm - Does exactly what it says on the tin
  
  -- 
  PHP Internals - PHP Runtime Development Mailing List
  To unsubscribe, visit: http://www.php.net/unsub.php
  
 
 -- 
 http://www.fastmail.fm - A fast, anti-spam email service.
 

-- 
http://www.fastmail.fm - Access all of your messages and folders
  wherever you are

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



[PHP-DEV] 5.0.6-dev build failure

2005-09-08 Thread Kamesh Jayachandran
Keep getting the,
/root/kamesh/work/php5_0/php-src/ext/sqlite/libsqlite/src/parse.y:3.13-19:
parse error, unexpected {...}
make: ***
[/root/kamesh/work/php5_0/php-src/ext/sqlite/libsqlite/src/parse.c]
Error 1

Can someone look at it.

With regards
Kamesh Jayachandran

-- 
http://www.fastmail.fm - Does exactly what it says on the tin

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



[PHP-DEV] Re: realpath is not available in all LibCs

2005-08-16 Thread Kamesh Jayachandran
Thanks sara for responding.
Will write a snippet to address this and get back to you.

With regards
Kamesh Jayachandran
On Thu, 11 Aug 2005 07:52:56 -0700, Sara Golemon [EMAIL PROTECTED]
said:
  Version PHP 5.1
  file main/php_init.c
  function int php_init_config() uses realpath.
  In NetWare our earlier releases of LibC SDK has no realpath
  implementation.
 
  I could see the following lines in TSRM/tsrm_virtual_cwd.c
 
  #ifndef HAVE_REALPATH
  #define realpath(x,y) strcpy(y,x)
  #endif
 
  Why not this be in TSRM/tsrm_virtual_cwd.h so that it will work in all
  the cases.
 
  Can I go ahead and checkin this?
 
 I have two concerns with this solution (both here and in TSRM).
 
 (1) Security:  Both internally with checks such as open_basedir and in 
 userspace when evaluating URL parameters (an all too common practice).
 
 (2) Functionality: require_once()/include_once() could be fooled into 
 including the same file twice.
 
 Granted #2 requires specific circumstances and #1 can be worked around
 for 
 tightly managed systems running no external packages.
 
 How about a more expensive, but more closely aproximating substitute to 
 satisfy all of these?
 
 /* psuedo-code */
 #ifndef HAVE_REALPATH
 realpath(...) {
 itterate path from root:
   if symlink, resolve
   if dir, append next portion of remaining path
   otherwise, ergh...whatever realpath() would do in this situation...
 loop
 }
 #endif 
 

-- 
http://www.fastmail.fm - IMAP accessible web-mail

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



[PHP-DEV] realpath is not available in all LibCs

2005-08-11 Thread Kamesh Jayachandran
Hi,
Version PHP 5.1
file main/php_init.c
function int php_init_config() uses realpath. 
In NetWare our earlier releases of LibC SDK has no realpath
implementation.

I could see the following lines in TSRM/tsrm_virtual_cwd.c

#ifndef HAVE_REALPATH
#define realpath(x,y) strcpy(y,x)
#endif

Why not this be in TSRM/tsrm_virtual_cwd.h so that it will work in all
the cases.

Can I go ahead and checkin this?

With regards
Kamesh Jayachandran

-- 
http://www.fastmail.fm - Does exactly what it says on the tin

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



Re: [PHP-DEV] Any reasons for not making exif and sockets extensions dynamically loadable.

2005-08-06 Thread Kamesh Jayachandran
Hi Jani,
In NetWare all extensions/sapis need the php5lib(Core php shared
library) which won't be available for these binaries to be linked
without the following lines(in PHP_SHARED_MODULE of acinclude.m4 we set
MODULE_SHARED_LIBADD),

PHP_SUBST(SOCKETS_SHARED_LIBADD)
PHP_SUBST(EXIF_SHARED_LIBADD)

Can i checkin this?

With regards
Kamesh Jayachandran

On Fri, 5 Aug 2005 23:58:39 +0300 (EEST), Jani Taskinen
[EMAIL PROTECTED] said:
 On Fri, 5 Aug 2005, Kamesh Jayachandran wrote:
 
  Hi All,
  I could not build exif and sockets extension as a shared extension(Our
  php set up is like windows PHPTS).
 
  With the current config.m4 I get link failure stating that php5lib not
  found.
 
  PHP_SUBST(SOCKETS_SHARED_LIBADD)
  PHP_SUBST(EXIF_SHARED_LIBADD) in the corresponging config.m4 files would
  do the needful.
 
  Neither of the extensions in questions use any external
  libraries so those lines are unnecessary.
 
  --Jani
 

-- 
http://www.fastmail.fm - IMAP accessible web-mail

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



[PHP-DEV] Any reasons for not making exif and sockets extensions dynamically loadable.

2005-08-05 Thread Kamesh Jayachandran
Hi All,
I could not build exif and sockets extension as a shared extension(Our
php set up is like windows PHPTS).

With the current config.m4 I get link failure stating that php5lib not
found.

PHP_SUBST(SOCKETS_SHARED_LIBADD)
PHP_SUBST(EXIF_SHARED_LIBADD) in the corresponging config.m4 files would
do the needful.

Patch is available at,
http://puggy.symonds.net/~kameshj/sockets.config.m4.patch
http://puggy.symonds.net/~kameshj/exif.config.m4.patch

Can I checkin this?

With regards
Kamesh Jayachandran

-- 
http://www.fastmail.fm - The professional email service

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



Re: [PHP-DEV] HEAD compile failure in pdo extension

2005-07-29 Thread Kamesh Jayachandran
Hi Joe,
It fixes it.

Thanks.
With regards
Kamesh Jayachandran
On Fri, 29 Jul 2005 09:20:04 +0100, Joe Orton [EMAIL PROTECTED]
said:
 On Thu, Jul 28, 2005 at 03:46:09PM +0530, Kamesh Jayachandran wrote:
  In file included from
  /root/kamesh/work/php-src/ext/pdo_sqlite/pdo_sqlite.c:31:
  /root/kamesh/work/php-src/ext/pdo_sqlite/php_pdo_sqlite_int.h:24:21:
  sqlite3.h: No such file or directory
 
 Same here with VPATH builds, this seems to fix it:
 
 Index: ext/pdo_sqlite/config.m4
 ===
 RCS file: /repository/php-src/ext/pdo_sqlite/config.m4,v
 retrieving revision 1.24
 diff -u -r1.24 config.m4
 --- ext/pdo_sqlite/config.m427 Jul 2005 11:53:00 -  1.24
 +++ ext/pdo_sqlite/config.m429 Jul 2005 08:18:43 -
 @@ -90,7 +90,7 @@
AC_DEFINE(SQLITE_PTR_SZ, SIZEOF_CHAR_P, [Size of a pointer])
PDO_SQLITE_VERSION=`cat $ext_srcdir/sqlite/VERSION`
PDO_SQLITE_VERSION_NUMBER=`echo $PDO_SQLITE_VERSION | $AWK -F.
'{printf(%d%03d%03d, $1, $2, $3)}'`
 -  sed -e s/--VERS--/$PDO_SQLITE_VERSION/ -e
 s/--VERSION-NUMBER--/$PDO_SQLITE_VERSION_NUMBER/
 $abs_srcdir/sqlite/src/sqlite.h.in  $abs_srcdir/sqlite/src/sqlite3.h
 +  sed -e s/--VERS--/$PDO_SQLITE_VERSION/ -e
 s/--VERSION-NUMBER--/$PDO_SQLITE_VERSION_NUMBER/
 $ext_srcdir/sqlite/src/sqlite.h.in  $ext_builddir/sqlite/src/sqlite3.h
  
touch $ext_srcdir/sqlite/src/parse.c
$ext_srcdir/sqlite/src/parse.h
  
 
 -- 
 PHP Internals - PHP Runtime Development Mailing List
 To unsubscribe, visit: http://www.php.net/unsub.php
 

-- 
http://www.fastmail.fm - Same, same, but differentÂ…

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



[PHP-DEV] HEAD compile failure in pdo extension

2005-07-28 Thread Kamesh Jayachandran
In file included from
/root/kamesh/work/php-src/ext/pdo_sqlite/pdo_sqlite.c:31:
/root/kamesh/work/php-src/ext/pdo_sqlite/php_pdo_sqlite_int.h:24:21:
sqlite3.h: No such file or directory
In file included from
/root/kamesh/work/php-src/ext/pdo_sqlite/pdo_sqlite.c:31:
/root/kamesh/work/php-src/ext/pdo_sqlite/php_pdo_sqlite_int.h:50: syntax
error before sqlite3
/root/kamesh/work/php-src/ext/pdo_sqlite/php_pdo_sqlite_int.h:53: syntax
error before '}' token
/root/kamesh/work/php-src/ext/pdo_sqlite/php_pdo_sqlite_int.h:56: syntax
error before pdo_sqlite_db_handle
/root/kamesh/work/php-src/ext/pdo_sqlite/php_pdo_sqlite_int.h:58: syntax
error before ':' token
/root/kamesh/work/php-src/ext/pdo_sqlite/php_pdo_sqlite_int.h:59: syntax
error before ':' token

With regards
Kamesh Jayachandran

-- 
http://www.fastmail.fm - The way an email service should be

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



Re: [PHP-DEV] HAVE_INT32_T check in ext/date/lib/timelib_structs.h(php 5.1)

2005-06-30 Thread Kamesh Jayachandran
Thanks Derick.
Still have one small issue with it for NetWare.
We decided to use autoconf based build for PHP-5.1 so we don't want to
use config.nw.h(Soon will delete it from the source tree)
This patch takes cares of it.
http://www.ductape.net/~kameshj/ext_date_config.m4.patch

With regards
Kamesh Jayachandran

On Wed, 29 Jun 2005 21:09:31 +0200 (CEST), Derick Rethans
[EMAIL PROTECTED] said:
 On Wed, 29 Jun 2005, Kamesh Jayachandran wrote:
 
  #include php_config.h this at the start of the file(ofcourse after the
  guard) solves the problem.
 
 Should be fixed in CVS, please test.
 
 regards,
 Derick
 
 -- 
 Derick Rethans
 http://derickrethans.nl | http://ez.no | http://xdebug.org

-- 
http://www.fastmail.fm - Access your email from home and the web

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



Re: [PHP-DEV] HAVE_INT32_T check in ext/date/lib/timelib_structs.h(php 5.1)

2005-06-30 Thread Kamesh Jayachandran
Thanks.
That was so fast.

With regards
Kamesh Jayachandran
On Thu, 30 Jun 2005 08:41:11 +0200 (CEST), Derick Rethans
[EMAIL PROTECTED] said:
 On Thu, 30 Jun 2005, Kamesh Jayachandran wrote:
 
  Still have one small issue with it for NetWare.
  We decided to use autoconf based build for PHP-5.1 so we don't want to
  use config.nw.h(Soon will delete it from the source tree)
  This patch takes cares of it.
  http://www.ductape.net/~kameshj/ext_date_config.m4.patch
 
 Committed.
 
 Derick
 
 -- 
 Derick Rethans
 http://derickrethans.nl | http://ez.no | http://xdebug.org

-- 
http://www.fastmail.fm - Email service worth paying for. Try it for free

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



[PHP-DEV] [PATCH]check for makedev in ext/posix(5.1 tree) (Build failure in NetWare)

2005-06-30 Thread Kamesh Jayachandran
Hi Derick,
In NetWare there does not exist a function by name makedev.
The following patch checks for the existence of makedev and calls only
if it exists.

http://www.ductape.net/~kameshj/ext_posix_makedev.patch

Please apply the same.

Thanks in advance
With regards
Kamesh Jayachandran

-- 
http://www.fastmail.fm - I mean, what is it about a decent email service?

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



Re: [PHP-DEV] [PATCH]check for makedev in ext/posix(5.1 tree) (Build failure in NetWare)

2005-06-30 Thread Kamesh Jayachandran
Hi Derick,
Our LibC implementation of mknod as of today allows creation of regular
file, regular dir and fifo only. 
It does not support Character and Block device creation. 
The documentation of NetWare LibC mandates dev argument to mknod to be
0.(Which currently the case with php_dev=0).
May be when makdev is implemented this code will automatically take care
of the new functionality without any change in the code with just the
change in new set of LibC headers.

With regards
Kamesh Jayachandran


On Thu, 30 Jun 2005 11:41:57 +0200 (CEST), Derick Rethans
[EMAIL PROTECTED] said:
 On Thu, 30 Jun 2005, Kamesh Jayachandran wrote:
 
  Hi Derick,
  In NetWare there does not exist a function by name makedev.
  The following patch checks for the existence of makedev and calls only
  if it exists.
  
  http://www.ductape.net/~kameshj/ext_posix_makedev.patch
 
 I see you're just commenting it out with an #ifdef, shouldn't there be 
 some sort of fallback? Does having mknod() on Netware still make sense 
 then?
 
 Derick
 
 -- 
 Derick Rethans
 http://derickrethans.nl | http://ez.no | http://xdebug.org

-- 
http://www.fastmail.fm - A fast, anti-spam email service.

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



Re: [PHP-DEV] [PATCH]check for makedev in ext/posix(5.1 tree) (Build failure in NetWare)

2005-06-30 Thread Kamesh Jayachandran
That is so nice Derick.

With regards
Kamesh Jayachandran
On Thu, 30 Jun 2005 12:00:30 +0200 (CEST), Derick Rethans
[EMAIL PROTECTED] said:
 On Thu, 30 Jun 2005, Kamesh Jayachandran wrote:
 
  Hi Derick,
  Our LibC implementation of mknod as of today allows creation of regular
  file, regular dir and fifo only. 
  It does not support Character and Block device creation. 
  The documentation of NetWare LibC mandates dev argument to mknod to be
  0.(Which currently the case with php_dev=0).
  May be when makdev is implemented this code will automatically take care
  of the new functionality without any change in the code with just the
  change in new set of LibC headers.
 
 Ok, I'll add a warning then if a Char or Block device is requested, 
 but makedev is not available.
 
 Derick
 -- 
 Derick Rethans
 http://derickrethans.nl | http://ez.no | http://xdebug.org

-- 
http://www.fastmail.fm - Access all of your messages and folders
  wherever you are

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



[PHP-DEV] HAVE_INT32_T check in ext/date/lib/timelib_structs.h(php 5.1)

2005-06-29 Thread Kamesh Jayachandran
Hi Derick,
Who will define HAVE_INT32_T?
I could see ./configure detects it and defines it in main/php_config.h.
But How ext/date/lib/timelib_structs.h know about this?
I could not see ext/date/lib/timelib_structs.h including
main/php_config.h.
#ifndef HAVE_INT32_T
# if SIZEOF_INT == 4
typedef int int32_t;
# elif SIZEOF_LONG == 4
typedef long int int32_t;
# endif
#endif

My NetWare build is breaking because stdio.h which is included after the
above code block also tries to define int32_t which causes a compilation
error.

#include php_config.h this at the start of the file(ofcourse after the
guard) solves the problem.

P.S in Zend/zend_strtod.c also we have similar code(checking for
HAVE_INT32_T) there it works because we include
zend_strtod.h-zend.hzend_config.h-mail/php_config.h), here we don't
have anything of that sort.

Please do the needful.
With regards
Kamesh Jayachandran

-- 
http://www.fastmail.fm - A fast, anti-spam email service.

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



[PHP-DEV] PATCH for NetWare specific Screen switches

2005-06-29 Thread Kamesh Jayachandran
Hi Jani,
Some time in October end 2004 I was asking for allocating 2 switches for
NetWare php cli to handle NetWare specific screen issues.
Subject of the original eMail is 
Can someone allocate 2 command line switches for php cli on NetWare?

I got a good suggestion from the community to write an extension that on
its RINIT checks for ini settings autodestroy and noscreen defined
through -d option to the cli.
I have implemented the same. I wanted to check in this to both 5.0 and
5.1 tree.
Patch to configure.in,
http://www.ductape.net/~kameshj/configure.in.patch.5.0
http://www.ductape.net/~kameshj/configure.in.patch.5.1

Please place the following implementation files under ext/netware for
both php5.0 and php5.1
http://www.ductape.net/~kameshj/php_netware.c
http://www.ductape.net/~kameshj/php_netware.h

I originally thought not to put it under ext/netware but under
php-src/netware as it is not a general purpose extension.
I could not do it as I could not linker error stating
php_netware_module_ptr not found which is defined in
ext/netware/php_netware.h.

PHP_NEW_EXTENSION(netware, php_netware.c) in configure.in solves all the
problem.

Please do the needful.

With regards
Kamesh Jayachandran

-- 
http://www.fastmail.fm - A fast, anti-spam email service.

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



[PHP-DEV] PATCH for cross compilation to NetWare(cli with shared dependency to phpts like shared lib)

2005-06-13 Thread Kamesh Jayachandran
Hi Jani,
Thanks for applying my patch on ext/mysql/config.m4 on HEAD. Please do
the same on 5.0 tree.
I have one more patch here.
Our php cli is like Windows one with a shared dependency to php5ts like
nlm.(We call it as php5lib).
Patch to sapi/cli/config.m4 and configure.in achieves our purpose.
Can you apply the patches both to 5.0 and 5.1?

Find the patches at,
http://www.ductape.net/~kameshj/cliconfig.m4.patch.5.0
http://www.ductape.net/~kameshj/cliconfig.m4.patch.5.1
http://www.ductape.net/~kameshj/configure.in.patch.5.0
http://www.ductape.net/~kameshj/configure.in.patch.5.1

Thanks again
With regards
Kamesh Jayachandran

-- 
http://www.fastmail.fm - Email service worth paying for. Try it for free

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



[PHP-DEV] PATCH to cross compile mysql extension for NetWare

2005-06-09 Thread Kamesh Jayachandran
Hi Jani,
NetWare mysqlclient library is shipped as libmysql.nlm(Old 8.3
limitation).
This patch replaces all the instances of myqlclient with $libname,
$libname a variable set as mysql for NetWare
$libname a variable set as mysqlclient for others

Please apply this patch.

Find patches at, 
http://ductape.net/~kameshj/mysql.config.m4.patch.5.0
http://ductape.net/~kameshj/mysql.config.m4.patch.5.1

With regards
Kamesh Jayachandran

-- 
http://www.fastmail.fm - Or how I learned to stop worrying and
  love email again

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



Re: [PHP-DEV] Re: References Problem Patch

2005-05-31 Thread Kamesh Jayachandran
Hi All,
I am not getting exactly what is the issue in refcount with reference
variable. One liner will be great for me to understand.

Anyway php-5 is not free of such refcount issues. One example is given
below. This code is a reduced form of xoops content Management
application's one activity which causes double free error.

excerpts_of_my_mail_to_list_48_days_back
?php
class MyTextSanitizer
{
var $smileys=array()
function MyTextSanitizer() {}
function getSmileys()
{
return $this-smileys;
}
}
$myts = new MyTextSanitizer();
$smiles = $myts-getSmileys(); //calling by ref alone causes improper
?

The opcodes for the above script 
ZEND_FETCH_CLASS
ZEND_NEW (Increases the refcount of smileys array from 1 to 2.
zend_declare class made it 1 from 0)
ZEND_JMP_NO_CTOR (Not executed)
ZEND_INIT_CTOR_CALL (No change in smileys refcount)
ZEND_DO_FCALL_BY_NAME(No change in smileys refcount)
ZEND_FETCH_W(No change in smileys refcount)
ZEND_ASSIGN(No change in smileys refcount)
ZEND_FETCH_R(No change in smileys refcount)
ZEND_INIT_METHOD_CALL(No change in smileys refcount)
ZEND_DO_FCALL_BY_NAME(Increases the refcount of smileys array from 2 to
3)
ZEND_FETCH_W(No change in smileys refcount)
ZEND_ASSIGN_REF(Increases the refcount of smileys array from 3 to 1.
_get_zval_ptr_ptr on opline-op2 makes it 3 to 2.
zend_assign_to_variable_reference(opline-result,
get_zval_ptr_ptr(opline-op1, EX(Ts), BP_VAR_W), value_ptr_ptr, EX(Ts)
TSRMLS_CC); decreases it from 2 to 1)
ZEND_RETURN
ZEND_HANDLE_EXCEPTION
object destructor reduces the refcount from 1 to 0 and destroys the
$smileys. zend_destroy_class now attempts to destroy it again. This
causes a segfault.


With regards
Kamesh Jayachandran
/excerpts_of_my_mail_to_list_48_days_back


On Mon, 30 May 2005 18:25:31 +0300 (EEST), Jani Taskinen
[EMAIL PROTECTED] said:
 
  Switching to PHP 5 (.1) here is not an option yet either.
  (and nobody can guarantee this same bug doesn't exist in it).
 
  Regarding the magnitude: It's pretty damn high, if you look at how
  many bug reports we've got about reference issues and large (huge)
  codebases. (where finding the short reproducing script is
  impossible)
 
  --Jani
 
 
 On Mon, 30 May 2005, Zeev Suraski wrote:
 
  At 17:10 30/05/2005, Derick Rethans wrote:
  Not fixing it is *not* an option. You fix something that's broken - you
  don't leave it broken. That's called responsibility. And no, switching
  to PHP 5 is not an option either.
 
  Sorry Derick, but you saying that not fixing it and/or that switching to 
  PHP 5 
  are not valid options doesn't mean that they're not valid options.  I think 
  that with the rarity of this issue and even higher rarity of it actually 
  causing problems, taking this approach is extremely valid.  Breaking binary 
  compatibility inside a 'PHP version family' on the other hand is not an 
  option, we've decided not to do this 3 or 4 years ago, and I don't see any 
  reason to break this decision at all.
 
  I for one think that (a) providing info and workarounds, and (b) pointing 
  people to use PHP 5 is a completely acceptable solution to a problem of 
  this 
  magnitude, when compared to the cost of fixing it.  Let's see what others 
  think.
 
  Zeev
 
 
 
 -- 
 PHP Internals - PHP Runtime Development Mailing List
 To unsubscribe, visit: http://www.php.net/unsub.php
 

-- 
http://www.fastmail.fm - IMAP accessible web-mail

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



Re: [PHP-DEV] refcount problems created by openssl_public_encrypt(symbol table corruption and double free)

2005-05-26 Thread Kamesh Jayachandran
Thanks Wez for pointing out.
New patch is available at,
http://puggy.symonds.net/~kameshj/openssl.c.patch.5.0
convert_to_string_ex is needed but not on val but on tmpzp.(Got lost
while manually copying the changes from my NetWare build environment to
Linux).

With regards
Kamesh Jayachandran
On Wed, 25 May 2005 15:20:25 -0400, Wez Furlong [EMAIL PROTECTED]
said:
 The patch doesn't look quite right.
 
 -   convert_to_string_ex(val);
 +   zval tmpz;
 +   zval *tmpzp;
 +   tmpz = *(*val);
 +   zval_copy_ctor(tmpz);
 +   tmpz.refcount=1;
 +   tmpzp = tmpz;
 
 I think that this is a place where convert_to_string(val) should be
 used instead.
 
 -   in = BIO_new_mem_buf(Z_STRVAL_PP(val),
 Z_STRLEN_PP(val));
 +   in = BIO_new_mem_buf(Z_STRVAL_PP(tmpzp),
 Z_STRLEN_PP(tmpzp));
 
 If you still need to use zval* instead of zval**, you can use
 Z_STRVAL_P(tmpzp) instead of taking the address and using
 Z_STRVAL_PP().
 
 Can you check your patch again using convert_to_string() instead?
 
 --Wez.
 
 On 5/25/05, Kamesh Jayachandran [EMAIL PROTECTED] wrote:
  Hi Wez  Jani,
  Following snippet causes double free of memory, corrupts the symbol
  table.
  ?php
  $pk=false;//As openssl_get_publickey($nonsense) can give false
  openssl_public_encrypt(Test,$encrypted,$pk);
  $pk=false;
  ?
  
  The culprit is php_openssl_evp_from_zval which is called by
  openssl_public_encrypt.
  openssl_public_encrypt reduces the refcount of $pk from 2 to 1.
  zend_ptr_stack_clear_multiple reduces it again to 0 as a normal cleanup
  upon return from openssl_public_encrypt.
  And hence zval associated with $pk is getting freed.
  But symbol table still refers to freed pointer.
  
  The patch for 5.0 Tree is available at,
  http://puggy.symonds.net/~kameshj/openssl.c.patch.5.0
  
  With regards
  Kamesh Jayachandran
  
  --
  PHP Internals - PHP Runtime Development Mailing List
  To unsubscribe, visit: http://www.php.net/unsub.php
  
 

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



[PHP-DEV] refcount problems created by openssl_public_encrypt(symbol table corruption and double free)

2005-05-25 Thread Kamesh Jayachandran
Hi Wez  Jani,
Following snippet causes double free of memory, corrupts the symbol
table.
?php
$pk=false;//As openssl_get_publickey($nonsense) can give false
openssl_public_encrypt(Test,$encrypted,$pk);
$pk=false;
?

The culprit is php_openssl_evp_from_zval which is called by
openssl_public_encrypt.
openssl_public_encrypt reduces the refcount of $pk from 2 to 1. 
zend_ptr_stack_clear_multiple reduces it again to 0 as a normal cleanup
upon return from openssl_public_encrypt.
And hence zval associated with $pk is getting freed.
But symbol table still refers to freed pointer.

The patch for 5.0 Tree is available at,
http://puggy.symonds.net/~kameshj/openssl.c.patch.5.0

With regards
Kamesh Jayachandran

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



[PHP-DEV] segfault in html_entity_decode

2005-05-11 Thread Kamesh Jayachandran
Hi Derick and Joe,
html_entity_decode('ensp;thinsp;lsquo;dagger;prime;frasl;euro;',
ENT_QUOTES, 'UTF-8'); (same testcase bug #29119) is causing Segfault in
NetWare.

The cause of the segfault seems to be the size of ent_uni_338_402. Which
I persume should be of size 402-338+1=65

It used to be 63 in size till 1.97.2.5.

Bug fix 28067 by Derick seemed to have increased the size by 65 but with
wrong comment ending.
It resulted in the code as follows,
/* 376 (0x0178) CautionNo end comment/Caution
  Yuml, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 
NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
/* 400 (0x0190)*/ 
NULL, NULL, fnof

Later Joe Orton fixed the above improper comment by extending the
comment to 3 more lines.
/* 376 (0x0178) CautionNo end comment/Caution
  Yuml, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 
NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
/* 400 (0x0190)*/ 
hence the array ent_uni_338_402 got truncated greatly to the size of 41
bytes.

This causes a seg fault while php_unescape_html_entities access from
ent_uni_338_402 with the index 402-338=64


With regards
Kamesh Jayachandran

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



[PHP-DEV] Re: segfault in html_entity_decode

2005-05-11 Thread Kamesh Jayachandran
Hi Joe,
The array should be as follows,
static entity_table_t ent_uni_338_402[] = {
/* 338 (0x0152) */
OElig, oelig, NULL, NULL, NULL, NULL,
NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
/* 352 (0x0160) */
Scaron, scaron, NULL, NULL, NULL, NULL, NULL, NULL,
NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
/* 376 (0x0178) */
Yuml, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 
/* 400 (0x0190)*/
NULL, NULL, fnof
};

Thanks
With regards
Kamesh Jayachandran
On Wed, 11 May 2005 12:58:21 +0100, Joe Orton [EMAIL PROTECTED]
said:
 On Wed, May 11, 2005 at 04:18:40AM -0700, Kamesh Jayachandran wrote:
  Hi Derick and Joe,
  html_entity_decode('ensp;thinsp;lsquo;dagger;prime;frasl;euro;',
  ENT_QUOTES, 'UTF-8'); (same testcase bug #29119) is causing Segfault in
  NetWare.
  
  The cause of the segfault seems to be the size of ent_uni_338_402. Which
  I persume should be of size 402-338+1=65
  
  It used to be 63 in size till 1.97.2.5.
  
  Bug fix 28067 by Derick seemed to have increased the size by 65 but with
  wrong comment ending.
  It resulted in the code as follows,
  /* 376 (0x0178) CautionNo end comment/Caution
Yuml, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 
  NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
  NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
  /* 400 (0x0190)*/ 
  NULL, NULL, fnof
  
  Later Joe Orton fixed the above improper comment by extending the
  comment to 3 more lines.
 
 The comment already extended for the full three lines since it wasn't
 terminated earlier.  But I guess *that* was the mistake made in the
 merge from the 4.3, and it was supposed to match the 4.3 code as below,
 does this fix the segfault for you?
 
 Index: html.c
 ===
 RCS file: /repository/php-src/ext/standard/html.c,v
 retrieving revision 1.107
 diff -u -r1.107 html.c
 --- html.c  1 May 2005 19:48:55 -   1.107
 +++ html.c  11 May 2005 11:56:29 -
 @@ -115,11 +115,11 @@
   Scaron, scaron, NULL, NULL, NULL, NULL, NULL, NULL,
   NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
   NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
 -   /* 376 (0x0178)
 +   /* 376 (0x0178) */
   Yuml, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
   NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
   NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, */
 -   /* 400 (0x0190)*/
 +   /* 400 (0x0190) */
   NULL, NULL, fnof
  };
  

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



[PHP-DEV] PATCH for possible segfault with mb_ereg_replace

2005-05-02 Thread Kamesh Jayachandran
Hi Moriyoshi,
Function _php_mb_regex_ereg_replace_exec in php_mbregex.c returns
RETVAL_STRINGL((char *)out_buf.c, out_buf.len - 1, 0); //At the end of
the function
0 as the 3rd argument to RETVAL_STRINGL Macro does not duplicate the
content and sets a retval zval same as out_buf.c.

out_buf.c is allocated using malloc/realloc family not emalloc/erealloc.

While zval_ptr_dtor is called on mb_reg_replace's retval, calls
efree(which it should not.). Hence in the macro REMOVE_POINTER_FROM_LIST
p-pLast-pNext = p-pNext; \
line causes a seg fault.(As p-pLast is null or some strange pointer not
within the control of the running program)

Patch for 5.0 tree is available here
http://puggy.symonds.net/~kameshj/php_mbregex.c.patch


With regards
Kamesh Jayachandran

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



[PHP-DEV] php-5.0.-dev build failure

2005-04-29 Thread Kamesh Jayachandran
Hi Dmitry,
I just did cvs upd in my php-5.0-dev workarea which brought your changes
in ext/standard/basic_functions.c version  1.673.2.16.
After that I get a compile error saying that 
/root/kamesh/work/php5_0/php-src/ext/standard/basic_functions.c:1911:
`IS_CALLABLE_CHECK_NO_ACCESS' undeclared (first use in this function)

I could not see this IS_CALLABLE_CHECK_NO_ACCESS getting defined
anywhere.

Can you look in to this.

With regards
Kamesh Jayachandran

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



Re: [PHP-DEV] Patch to build shared extensions for Netware

2005-04-28 Thread Kamesh Jayachandran
Atlast identified the cause of ./configure on cross build failing. 
The cause was autoconf versions. 
In my dev environment I have autoconf version 2.57 whereas snaps.php.net
has autoconf 2.13. 
Fixed NetWare TSRM/threads.m4 to make configure work out of
snaps.php.net release.

With regards
Kamesh Jayachandran
On Tue, 26 Apr 2005 07:16:27 -0700, Kamesh Jayachandran
[EMAIL PROTECTED] said:
 Thanks Jani.
 
 Would be great if you can tell me how configure scripts are generated by
 snapshot.
 Somehow I keep getting the following error while doing a cross compile
 on configure that I got from snaps.php.net.
 
 configure: error: can only configure for one host and one target at a
 time
 I build configure by simple invocation of ./buildconf from my workarea
 the resulting ./configure cross compiles perfectly fine. Even ./snapshot
 ran on workarea also generates a proper configure files that allows me
 to cross compile.
 
 May be if you can suggest whom to contact regarding this is also would
 be great.
 
 With regards
 Kamesh Jayachandran
 On Tue, 26 Apr 2005 11:21:10 +0300 (EEST), Jani Taskinen
 [EMAIL PROTECTED] said:
  
   Patch applied.
  
   --Jani
  
  
  On Fri, 22 Apr 2005, Kamesh Jayachandran wrote:
  
   Hi Jani,
   Please apply this patch which enables to build NetWare PHP extensions
   using gcc cross compiler.
  
   For 5.0
   http://puggy.symonds.net/~kameshj/acinclude.m4.patch.5.0
  
   For 5.1
   http://puggy.symonds.net/~kameshj/acinclude.m4.patch.5.1
  
   With regards
   Kamesh Jayachandran
  
  
  
  -- 
  Donate @ http://pecl.php.net/wishlist.php/sniper
 
 -- 
 PHP Internals - PHP Runtime Development Mailing List
 To unsubscribe, visit: http://www.php.net/unsub.php
 

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



Re: [PHP-DEV] Patch to build shared extensions for Netware

2005-04-26 Thread Kamesh Jayachandran
Thanks Jani.

Would be great if you can tell me how configure scripts are generated by
snapshot.
Somehow I keep getting the following error while doing a cross compile
on configure that I got from snaps.php.net.

configure: error: can only configure for one host and one target at a
time
I build configure by simple invocation of ./buildconf from my workarea
the resulting ./configure cross compiles perfectly fine. Even ./snapshot
ran on workarea also generates a proper configure files that allows me
to cross compile.

May be if you can suggest whom to contact regarding this is also would
be great.

With regards
Kamesh Jayachandran
On Tue, 26 Apr 2005 11:21:10 +0300 (EEST), Jani Taskinen
[EMAIL PROTECTED] said:
 
  Patch applied.
 
  --Jani
 
 
 On Fri, 22 Apr 2005, Kamesh Jayachandran wrote:
 
  Hi Jani,
  Please apply this patch which enables to build NetWare PHP extensions
  using gcc cross compiler.
 
  For 5.0
  http://puggy.symonds.net/~kameshj/acinclude.m4.patch.5.0
 
  For 5.1
  http://puggy.symonds.net/~kameshj/acinclude.m4.patch.5.1
 
  With regards
  Kamesh Jayachandran
 
 
 
 -- 
 Donate @ http://pecl.php.net/wishlist.php/sniper

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



[PHP-DEV] Patch to build shared extensions for Netware

2005-04-22 Thread Kamesh Jayachandran
Hi Jani,
Please apply this patch which enables to build NetWare PHP extensions
using gcc cross compiler.

For 5.0
http://puggy.symonds.net/~kameshj/acinclude.m4.patch.5.0

For 5.1
http://puggy.symonds.net/~kameshj/acinclude.m4.patch.5.1

With regards
Kamesh Jayachandran

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



[PHP-DEV] PATCH for EXEEXT to configure scripts

2005-04-18 Thread Kamesh Jayachandran
Hi Jani,
Can you apply this patch for changing the extension of final cli binary?
For 5.0
http://www.ductape.net/~kameshj/configure.in.5.0.patch
http://www.ductape.net/~kameshj/sapicliconfig.m4.5.0.patch

For 5.1
http://www.ductape.net/~kameshj/configure.in.5.1.patch
http://www.ductape.net/~kameshj/sapicliconfig.m4.5.1.patch

This patch is for netware but it can be for any non-darwin system,
provided that windows build calls ./configure with EXEEXT=exe.

With regards
Kamesh Jayachandran

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



[PHP-DEV] zend version in php-5.0.4 release 2.0.4-dev?

2005-04-13 Thread Kamesh Jayachandran
Hi All,
I could see a 
#define ZEND_VERSION 2.0.4-dev in zend.h that got released along with
php-5.0.4 should it not be 
#define ZEND_VERSION 2.0.4

With regards
Kamesh Jayachandran

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



Re: [PHP-DEV] refcount and hence double free issue

2005-04-13 Thread Kamesh Jayachandran
?php
class MyTextSanitizer
{
var $smileys=array()
function MyTextSanitizer() {}
function getSmileys()
{
return $this-smileys;
}
}
$myts = new MyTextSanitizer();
$smiles = $myts-getSmileys(); //calling by ref alone causes improper
?

The opcodes for the above script 
ZEND_FETCH_CLASS
ZEND_NEW (Increases the refcount of smileys array from 1 to 2.
zend_declare class made it 1 from 0)
ZEND_JMP_NO_CTOR (Not executed)
ZEND_INIT_CTOR_CALL (No change in smileys refcount)
ZEND_DO_FCALL_BY_NAME(No change in smileys refcount)
ZEND_FETCH_W(No change in smileys refcount)
ZEND_ASSIGN(No change in smileys refcount)
ZEND_FETCH_R(No change in smileys refcount)
ZEND_INIT_METHOD_CALL(No change in smileys refcount)
ZEND_DO_FCALL_BY_NAME(Increases the refcount of smileys array from 2 to
3)
ZEND_FETCH_W(No change in smileys refcount)
ZEND_ASSIGN_REF(Increases the refcount of smileys array from 3 to 1.
_get_zval_ptr_ptr on opline-op2 makes it 3 to 2.
zend_assign_to_variable_reference(opline-result,
get_zval_ptr_ptr(opline-op1, EX(Ts), BP_VAR_W), value_ptr_ptr, EX(Ts)
TSRMLS_CC); decreases it from 2 to 1)
ZEND_RETURN
ZEND_HANDLE_EXCEPTION
object destructor reduces the refcount from 1 to 0 and destroys the
$smileys. zend_destroy_class now attempts to destroy it again. This
causes a segfault.


With regards
Kamesh Jayachandran

On Wed, 06 Apr 2005 00:18:35 -0700, Kamesh Jayachandran
[EMAIL PROTECTED] said:
 It happens in php-5.0.4 also.
 
 With regards
 Kamesh Jayachandran
 On Wed, 6 Apr 2005 09:16:34 +0200 (CEST), Derick Rethans
 [EMAIL PROTECTED] said:
  On Wed, 6 Apr 2005, Kamesh Jayachandran wrote:
  
   Hi All,
   I have come across a double free because of improper refcount
   manipulation.
   ?php
   class MyTextSanitizer
   {
   var $smileys=array()
   function MyTextSanitizer() {}
   function getSmileys()
   {
   return $this-smileys;
   }
   }
   $myts = new MyTextSanitizer();
   $smiles = $myts-getSmileys(); //calling by ref alone causes improper
   refcount 
   $smiles = $myts-getSmileys(); //this does not cause improper refcount 
   ?
  
  This fact is known, Marcus and I have a working patch for this - but 
  it'll break binairy compat for PHP 4.4 - stay tuned for this.
  
  regards,
  Derick
  
  -- 
  Derick Rethans
  http://derickrethans.nl | http://ez.no | http://xdebug.org
 
 -- 
 PHP Internals - PHP Runtime Development Mailing List
 To unsubscribe, visit: http://www.php.net/unsub.php
 

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



[PHP-DEV] refcount and hence double free issue

2005-04-06 Thread Kamesh Jayachandran
Hi All,
I have come across a double free because of improper refcount
manipulation.
?php
class MyTextSanitizer
{
var $smileys=array()
function MyTextSanitizer() {}
function getSmileys()
{
return $this-smileys;
}
}
$myts = new MyTextSanitizer();
$smiles = $myts-getSmileys(); //calling by ref alone causes improper
refcount 
$smiles = $myts-getSmileys(); //this does not cause improper refcount 
?

What is happening is class_entry-default_properties and
object-properties are sharing the same zval** as the data($smileys)
against their keys with incrementing the refcount.
In the execution of the script refcount of $smileys is changing from 
1-2, 
2-3, 
3-2, 
2-3, 
3-2, 
2-1, ---when it is 1 zend_objects_free_object_storage calls
zend_hash_destroy of object-properties which calls _zval_ptr_dtor on
each of its data($smiley) frees it if the refcount ==1
1-0 --destroy_zend_class also calls
zend_hash_destroy(ce-default_properties) by the time
$smiley-refcount=0 and storage is already freed which is accessed by
_zval_ptr_dtor to decrement the refcount which causes a segfault with a
huge script.

Anyway will see who and all increment/decrement the refcount and see
where to increment it or not to decrement it.

With regards
Kamesh Jayachandran

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



Re: [PHP-DEV] refcount and hence double free issue

2005-04-06 Thread Kamesh Jayachandran
It happens in php-5.0.4 also.

With regards
Kamesh Jayachandran
On Wed, 6 Apr 2005 09:16:34 +0200 (CEST), Derick Rethans
[EMAIL PROTECTED] said:
 On Wed, 6 Apr 2005, Kamesh Jayachandran wrote:
 
  Hi All,
  I have come across a double free because of improper refcount
  manipulation.
  ?php
  class MyTextSanitizer
  {
  var $smileys=array()
  function MyTextSanitizer() {}
  function getSmileys()
  {
  return $this-smileys;
  }
  }
  $myts = new MyTextSanitizer();
  $smiles = $myts-getSmileys(); //calling by ref alone causes improper
  refcount 
  $smiles = $myts-getSmileys(); //this does not cause improper refcount 
  ?
 
 This fact is known, Marcus and I have a working patch for this - but 
 it'll break binairy compat for PHP 4.4 - stay tuned for this.
 
 regards,
 Derick
 
 -- 
 Derick Rethans
 http://derickrethans.nl | http://ez.no | http://xdebug.org

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



[PHP-DEV] ./configure on a cross compile environment

2005-04-06 Thread Kamesh Jayachandran
Hi All,
Few weeks back I have checked in the configure.in and few m4 patches so
that NetWare cross compile goes through. I tested the same by checking
out a sources from php5_0 tree and ./buildconf and ./configure with
approproiate --host and --target switches.

When I do the same with whatever the ./configure script comes with
php-5.0.4 I get the error.

./configure --disable-all --enable-ftp --enable-session --enable-bcmath
--enable-calendar --enable-maintainer-zts --host i386-pc-netware
--target i386-pc-netware --build i686-pc-linux-gnu --program-suffix=nlm 
CFLAGS=-nostdinc -fpack-struct -DNETWARE
-I/usr/nwsdk/libc_api.2004.09.07/include/ -Xlinker --nlm-kernelspace
-Xlinker --nlm-screenname=PHP
CC=/usr/cross-gcc/opt/cross/bin/i586-netware-gcc
CFLAGS=-nostdinc -fpack-struct -DNETWARE
-I/usr/nwsdk/libc_api.2004.09.07/include/ -Xlinker --nlm-kernelspace
-Xlinker --nlm-screenname=PHP

Error message follows

configure: warning: CFLAGS=-nostdinc -fpack-struct -DNETWARE
-I/usr/nwsdk/libc_api.2004.09.07/include/ -Xlinker --nlm-kernelspace
-Xlinker --nlm-screenname=PHP: invalid host type
CC=/usr/cross-gcc/opt/cross/bin/i586-netware-gcc
configure: warning: CC=/usr/cross-gcc/opt/cross/bin/i586-netware-gcc:
invalid host type
configure: error: can only configure for one host and one target at a
time

How the ./configure is built while doing the releases?
Even the ./buildconf --force on a released packages dis not help.

With regards
Kamesh Jayachandran

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



Re: Re[2]: [PHP-DEV] Fix for 30818, 28839, 32229, 30513

2005-03-28 Thread Kamesh Jayachandran
Hi Jani,
Thanks for commiting the patch. 
But I feel you can do the same on PHP-5.0.4-dev tree also.

With regards
Kamesh Jayachandran
On Sat, 26 Mar 2005 04:45:58 +0200 (EET), Jani Taskinen
[EMAIL PROTECTED] said:
 On Sun, 20 Mar 2005, Kamesh Jayachandran wrote:
 
  Hi Andi,
  I could not see this change in CVS both in 5_0_4-dev tree and HEAD.
 
  Can someone apply my patch?
 
Done.
 
--Jani
 
  With regards
  Kamesh Jayachandran
 
  On Fri, 18 Mar 2005 13:56:25 -0800, Andi Gutmans [EMAIL PROTECTED] said:
  Yeah it might make sense to move that to a function. But for some reason
  I
  already see that zend_execute_API.c contains this code in HEAD. Did
  someone
  apply and I missed the commit msg?
 
  Kamesh, can you please verify if it exists in your source tree?
  Good catch btw.
 
  Andi
 
  At 01:46 PM 3/18/2005 +0200, val khokhlov wrote:
  Hello Kamesh,
 
  Friday, March 18, 2005, 1:15:53 PM, you wrote:
 
  KJ Yes I got this fix from pass_two only. It duplicates pass_two 
  especially
  KJ the while loop.
 you see, i also use this part of pass_two() code in my ext. maybe,
  it'd be a good idea to find one place for this jump addr calculation, so 
  it
  won't be duplicated? (although, it's likely a question to zend developers)
 
 
  --
  Best regards,
   valmailto:[EMAIL PROTECTED]
 
  --
  PHP Internals - PHP Runtime Development Mailing List
  To unsubscribe, visit: http://www.php.net/unsub.php
 
 
 

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



Re: [PHP-DEV] php streams - generating the http header

2005-03-22 Thread Kamesh Jayachandran
Hi,
Have a look at main/SAPI.c for the function sapi_header_op
PHP_FUNCTION(header)in ext/standard/head.c

With reagrds
Kamesh Jayachandran

On Tue, 22 Mar 2005 18:55:58 +0530, Arjun Jain [EMAIL PROTECTED]
said:
 Hi everyone,
 
 Back Again :). I tried searching around, but all in vain. 
 
 My question is that how do i use the php stream to generate 
 my custom header and then write to it the corresponding file?
 I could get that php_stream *stream need to be created and then 
 php_stream_write needs to be used to write to it. But how 
 do I open the stream?
 
 Basically I want to write a file to the browser, say a .png file 
 from my extension. I can not use the header() function of php. 
 And even if i use it, how do i send the png file to the browser.
 I would prefer not using the header() funcion and write my own
 header.
 
 Any pointers please? Thanking you in advance.
 
 Regards,
 aj
 http://arjun.notlong.com
 
 -- 
 PHP Internals - PHP Runtime Development Mailing List
 To unsubscribe, visit: http://www.php.net/unsub.php
 

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



Re: [PHP-DEV] PHP auto global variables inside C extension

2005-03-21 Thread Kamesh Jayachandran
SG(rfc1867_uploaded_files) will have a list of filenames uploaded.
With regards
Kamesh Jayachandran
On Tue, 22 Mar 2005 12:32:44 +0530, Arjun Jain [EMAIL PROTECTED]
said:
 Hi everyone,
 
 I was wondering if there was any way in which the PHP auto global 
 variables could be used inside the C extension code? Where does php 
 store all the global variables?
 
 Well what I am trying to do is put the uploaded file in a custom 
 database. But for that I require all the four paramaters, viz
 |$_FILES['userfile']['name'], ||$_FILES['userfile']['type'], 
 ||$_FILES['userfile']['size'] and| |$_FILES['userfile']['tmp_name']|.
 
 So, instead of  the user having to pass all this from php as function 
 arguments, is there no way i can get these directly? Inside the 
 extension code?
 Thanking you in advance.
 
 Regards
 aj
 http://arjun.notlong.com
 
 -- 
 PHP Internals - PHP Runtime Development Mailing List
 To unsubscribe, visit: http://www.php.net/unsub.php
 

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



Re: Re[2]: [PHP-DEV] Fix for 30818, 28839, 32229, 30513

2005-03-20 Thread Kamesh Jayachandran
Hi Andi,
I could not see this change in CVS both in 5_0_4-dev tree and HEAD.

Can someone apply my patch?

With regards
Kamesh Jayachandran

On Fri, 18 Mar 2005 13:56:25 -0800, Andi Gutmans [EMAIL PROTECTED] said:
 Yeah it might make sense to move that to a function. But for some reason
 I 
 already see that zend_execute_API.c contains this code in HEAD. Did
 someone 
 apply and I missed the commit msg?
 
 Kamesh, can you please verify if it exists in your source tree?
 Good catch btw.
 
 Andi
 
 At 01:46 PM 3/18/2005 +0200, val khokhlov wrote:
 Hello Kamesh,
 
 Friday, March 18, 2005, 1:15:53 PM, you wrote:
 
 KJ Yes I got this fix from pass_two only. It duplicates pass_two especially
 KJ the while loop.
 you see, i also use this part of pass_two() code in my ext. maybe,
 it'd be a good idea to find one place for this jump addr calculation, so it
 won't be duplicated? (although, it's likely a question to zend developers)
 
 
 --
 Best regards,
   valmailto:[EMAIL PROTECTED]
 
 --
 PHP Internals - PHP Runtime Development Mailing List
 To unsubscribe, visit: http://www.php.net/unsub.php
 

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



[PHP-DEV] Fix for 30818, 28839, 32229, 30513

2005-03-18 Thread Kamesh Jayachandran
Hi,
In case of interactive mode the 
for ZEND_JMP
op1.u.jmp_addr is not evaluated, it still has the relative diff from the
current opcode.

for ZEND_JMP, ZEND_JMPNZ, ZEND_JMPZ_EX, ZEND_JMPNZ_EX
op2.u.jmp_addr is not evaluated, it still has the relative diff from the
current opcode.

This normally happens from pass_two.
I am attaching the patch which does this jmp_addr evaluation. This patch
is against php-5.0.4-dev-RC[2].

http://puggy.symonds.net/~kameshj/zend_execute_API.c.patch

Can someone apply this patch?

With regards
Kamesh Jayachandran

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



Re: [PHP-DEV] Fix for 30818, 28839, 32229, 30513

2005-03-18 Thread Kamesh Jayachandran
Hi Val,
Yes I got this fix from pass_two only. It duplicates pass_two especially
the while loop.

With regards
Kamesh Jayachandran

On Fri, 18 Mar 2005 13:05:46 +0200, val khokhlov [EMAIL PROTECTED]
said:
 Hello Kamesh,
 
 Friday, March 18, 2005, 12:46:44 PM, you wrote:
 
 KJ This normally happens from pass_two.
 KJ I am attaching the patch which does this jmp_addr evaluation. This
 patch
 KJ is against php-5.0.4-dev-RC[2].
  your code will duplicate some lines pass_two(), won't it?
 or execute_new_code() is called only in very special cases, when
 pass_two()
 might not be called?
 
 
 -- 
 Best regards,
  valmailto:[EMAIL PROTECTED]
 

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



Re: [PHP-DEV] Patch to TSRM to configure properly in cross compilation environment.(Especially NetWare)

2005-02-25 Thread Kamesh Jayachandran
Thanks Jani.

With regards
Kamesh Jayachandran
On Thu, 24 Feb 2005 21:30:03 +0200 (EET), Jani Taskinen
[EMAIL PROTECTED] said:
 On Thu, 24 Feb 2005, Kamesh Jayachandran wrote:
 
  Hi Jani,
  PTHREADS_CHECK_COMPILE macro fails with pthreads_working=no for cross
  compilation environment.
  As I am aware NetWare has proper support for PTHREADS this patch sets
  pthreads_working=yes for NetWare alone.
 
  Find the patch at
  http://puggy.symonds.net/~kameshj/threads.m4.patch
  Please apply the same along with my earlier patch on configure.in.
 
  Committed too, but I changed the '$host_alias' to '$target_alias'
  since the former is not the one you're compiling for.. :)
 
  --Jani
 

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



[PHP-DEV] Patch to TSRM to configure properly in cross compilation environment.(Especially NetWare)

2005-02-24 Thread Kamesh Jayachandran
Hi Jani,
PTHREADS_CHECK_COMPILE macro fails with pthreads_working=no for cross
compilation environment. 
As I am aware NetWare has proper support for PTHREADS this patch sets
pthreads_working=yes for NetWare alone.

Find the patch at 
http://puggy.symonds.net/~kameshj/threads.m4.patch
Please apply the same along with my earlier patch on configure.in.


With regards
Kamesh Jayachandran

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




[PHP-DEV] patch for cross compilation to Netware

2005-02-23 Thread Kamesh Jayachandran
Hi,
Thanks for committing the earlier patch.
win32/sendmail.c needs to be compiled for Netware as it don't have
sendmail binary as Unices do.
This patch adds sendmail.c to NetWare build.
http://puggy.symonds.net/~kameshj/configure.in.patch

With regards
Kamesh Jayachandran

With regards
Kamesh Jayachandran

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



[PHP-DEV] Patch for not to run some tests while cross compiling

2005-02-22 Thread Kamesh Jayachandran
Hi All,
I am working for NetWare port of PHP. I am trying to use the autoconf
based build system to build the binaries meant to run for NetWare with
build system being Linux.(Cross compilation).

While running ./configure with corresponding options I got errors
stating cannot run tests while cross compiling.. I have a fix for this
located at,
http://puggy.symonds.net/~kameshj/Zend.m4.patch
Can someone review it and apply the patch?

With regards
Kamesh Jayachandran

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



Re: [PHP-DEV] Patch for not to run some tests while cross compiling

2005-02-22 Thread Kamesh Jayachandran
Hi Jani,
Thanks for commiting the patch. But it does not work.
The last param to AC_TRY_RUN need to be a non empty shell construct for
cross compilation to go through(empty construct won't help).

Please apply my new patch against the current HEAD(Now instead of echo
the patch do test 1)
http://puggy.symonds.net/~kameshj/Zend.m4.patch

With regards
Kamesh Jayachandran

On Tue, 22 Feb 2005 15:53:41 +0200 (EET), Jani Taskinen
[EMAIL PROTECTED] said:
 On Tue, 22 Feb 2005, Kamesh Jayachandran wrote:
 
  Hi All,
  I am working for NetWare port of PHP. I am trying to use the autoconf
  based build system to build the binaries meant to run for NetWare with
  build system being Linux.(Cross compilation).
 
  While running ./configure with corresponding options I got errors
  stating cannot run tests while cross compiling.. I have a fix for this
  located at,
  http://puggy.symonds.net/~kameshj/Zend.m4.patch
  Can someone review it and apply the patch?
 
  Committed, without the echo though as that is superfluous.
 
  --Jani
 

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



Re: [PHP-DEV] Segmentation fault in html_entity_decode

2005-01-12 Thread Kamesh Jayachandran
Hi Moriyoshi,

My mistake. I Thought you would have fixed these 2 in one commit and
diffed the latest with earlier one version and found only one fix. Now
things work fine.

With regards
Kamesh Jayachandran


On Wed, 12 Jan 2005 17:27:06 +0900, Moriyoshi Koizumi
[EMAIL PROTECTED] said:
 
 On 2005/01/12, at 16:31, Kamesh Jayachandran wrote:
 
  Hi Moriyoshi,
  Still ent_uni_8592_9002's actual size is 410 but accessed with a index
  410.
 
 Huh? I'm confident about it :) It's certainly 411.
 

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



[PHP-DEV] php-src/tests/lang/038.phpt fails on php-5.0.3

2005-01-11 Thread Kamesh Jayachandran
Hi All,
php-src/tests/lang/038.phpt(Convert warnings to exceptions) this
testcase used to succeed in php-5.0.2 and old but not on php-5.0.3.
Seems that exception_object-getTrace() now returns an array of size 3
with first 2 entries corresponding to Error2Exception and last one
corresponding to fopen. Earlier this used to return array of size 2.
Changing the 
var_dump($trace[1]['function']);
to 
var_dump($trace[2]['function']); will make the testcase go through.
Still I am interested in knowing the reason behind three entries in
getTrace() return value.

With regards
Kamesh Jayachandran

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



[PHP-DEV] Segmentation fault in html_entity_decode

2005-01-10 Thread Kamesh Jayachandran
Hi All,
The following script causes a segmentation fault in NetWare but not on
Windows or Linux versions of php-5.0.3
?php
html_entity_decode('ensp;', ENT_QUOTES, 'UTF-8');
?

I can not attribute to NetWare instead I could see the defect in our
ext/standard/html.c
The cause seems to be the following arrays are accessed with a index
that is beyond their size 
1)ent_uni_spacing(Actual size is 22 but accessed with a index 22)
2)ent_uni_8592_9002(Actual size is 410 but accessed with a index 410.
From the name it seems that 9002 is a valid index so we need to add one
more NULL at the end)
Either we should add one more entry to the ent_uni_spacing array or
reduce our endchar in entity_map
You can see the index with which this arrays are accessed by putting a
printf(k - entity_map[j].basechar = %d\n, k - entity_map[j].basechar);
in a for loop which is around line 898 in html.c version 1.97.2.1. 


With regards
Kamesh Jayachandran

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



[PHP-DEV] vsprintf returns int not char*

2005-01-04 Thread Kamesh Jayachandran
Hi Derick,
in php-src/main/php_sprintf.c
PHPAPI int
php_sprintf (char*s, const char* format, ...)
{
  va_list args;
  char *ret; //ret should be of type integer as vsprintf returns int
  rather than char*

  va_start (args, format);
  s[0] = '\0';
  ret = vsprintf (s, format, args);
  va_end (args);
  if (!ret) //This check should be if(ret  0) as ret will have the
  number of characters printed to s  
//If an output error is encountered, a negative  value  is returned.
return -1;
  return strlen (s);
}
ret should be of type integer as vsprintf returns int rather than char*.
if (!ret) should be if(ret  0)


With regards
Kamesh Jayachandran

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



Re: [PHP-DEV] ftp_get_resp ftp_get_conv functions

2004-12-16 Thread Kamesh Jayachandran
Hi Jesse,
2500*4096 = 10M on ftpbuf would be too much for the user who is not
interested in this functionality. 
It should be allocating the memory dynamically instead of hardcoding the
size to 2500. 
This need to happen only when requested, may be some option argument to
ftp_connect whether to track the ftp conversation.

With regards
Kamesh Jayachandran
On Wed, 15 Dec 2004 21:47:09 -0700, Binam, Jesse
[EMAIL PROTECTED] said:
 The attached diff adds 2 ftp functions. I read the
 README.SUBMITTING_PATCH and went thru all the steps, but there are no
 tests for ftp, and I didn't understand how to update the docs. So if
 someone would like to help me with that, great.
 
 Basically, I modifed ftpbuf_t adding a 2 dimensional array (array of
 strings) to store the conversation, and an int that indicates the next
 element in first dimension the array. I modified ftp_putcmd and
 ftp_getresp to add what gets sent/recvd in the conversation. And lastly
 I added ftp_get_resp which returns the 3 digit return code from the
 server of the last command sent, and ftp_get_conv (which I would not be
 opposed to changing the name of, that's just what I came up with) that
 returns the ftp conversation as an array. Both functions must be called
 before ftp_close (or ftp_quit) because it frees the resource.
 
 The array I defined is 2500x4096. 4096 was already there as the
 FTP_BUFSIZE, 2500 maybe a little excesive but in my environment it could
 get that bad. :/ So I was thinking that maybe I should add a optional
 flag on ftp_connect on where or not to trace the conversation? Thoughts?
 
 Jess

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


[PHP-DEV] info needed regarding compiled in extensions

2004-12-13 Thread Kamesh Jayachandran
Hi All,
I could see a difference in extensions that are compiled in by default
between Windows and Linux versions of php-5.0.2.
Simple ./configure on Linux.
Installed PHP using php-5.0.2-Installer.exe
I could see the following.
Both Windows and Linux has the following extensions compiled in by
default.
ctype, dom, iconv, libxml, pcre, session, SimpleXML, SPL, SQLite,
standard, tokenizer, xml
Windows has but Linux do not have the following extensions compiled in
by default.
bcmath, calendar, com_dotnet, ftp, odbc, wddx, zlib
Linux has but Windows do not have the following extensions compiled in
by default.
mysql, posix

Is there any standard that exists that states what extension should go
compiled in by default for a particular version of PHP?

With regards
Kamesh Jayachandran

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



Re: [PHP-DEV] Memory leak per request in apache2filter PHP+ZTS(reposting third time)

2004-12-06 Thread Kamesh Jayachandran
Can Someone respond to this?
 
With regards
Kamesh Jayachandran

On Thu, 02 Dec 2004 06:27:32 -0800, Kamesh Jayachandran
[EMAIL PROTECTED] said:
 Can Someone respond to this?
 
 With regards
 Kamesh Jayachandran
 On Mon, 29 Nov 2004 23:56:13 -0800, Kamesh Jayachandran
 [EMAIL PROTECTED] said:
  Hi All,
  I could see a leak of 60 bytes for the following script.
  ?php
  //echo hi;
  ?
  While investigation I found that 
  SG(request_info).path_translated = safe_strdup(f-r-filename); 
  //in sapi/apache2filter/sapi_apache2.c:php_apache_request_ctor
  is not getting freed.
  
  Can I free the same in php_apache_request_dtor?
  
  I could see the above safe_strdup in sapi_apache2.c,v 1.108 on
  2003/04/10 11:28:54 by stas.
  
  With regards
  Kamesh Jayachandran
  
  -- 
  PHP Internals - PHP Runtime Development Mailing List
  To unsubscribe, visit: http://www.php.net/unsub.php
  

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



Re: [PHP-DEV] Memory leak per request in apache2filter PHP+ZTS

2004-12-02 Thread Kamesh Jayachandran
Can Someone respond to this?

With regards
Kamesh Jayachandran
On Mon, 29 Nov 2004 23:56:13 -0800, Kamesh Jayachandran
[EMAIL PROTECTED] said:
 Hi All,
 I could see a leak of 60 bytes for the following script.
 ?php
 //echo hi;
 ?
 While investigation I found that 
   SG(request_info).path_translated = safe_strdup(f-r-filename); 
 //in sapi/apache2filter/sapi_apache2.c:php_apache_request_ctor
 is not getting freed.
 
 Can I free the same in php_apache_request_dtor?
 
 I could see the above safe_strdup in sapi_apache2.c,v 1.108 on
 2003/04/10 11:28:54 by stas.
 
 With regards
 Kamesh Jayachandran
 
 -- 
 PHP Internals - PHP Runtime Development Mailing List
 To unsubscribe, visit: http://www.php.net/unsub.php
 

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



[PHP-DEV] [PATCH] one more possible seg fault in openssl

2004-10-27 Thread Kamesh Jayachandran
Hi Wez,
?php
$dn = array(
   countryName = UK,
   stateOrProvinceName = Somerset,
   localityName = Glastonbury,
   organizationName = The Brain Room Limited,
   organizationalUnitName = PHP Documentation Team,
   commonName = Wez Furlong,
   emailAddress = [EMAIL PROTECTED]
);
// Non-existent or null private key
$csr = openssl_csr_new($dn, $privkey1);
?
will also cause the double free of privkey and hence potential seg
fault.
openssl_csr_new tries to create a fresh private key and adds to the
resource list and fails to req.priv_key to null so the dispose function
frees the private key generated. Later when the php_request_shutdown is
called it agains frees the EG(regular_list) this causes the seg fault.

Patch is available at,
http://puggy.symonds.net/~kameshj/openssl.c.patch

With regards
Kamesh Jayachandran

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



[PHP-DEV] Re: Why module shutdown function is not called for openssl extension?

2004-10-26 Thread Kamesh Jayachandran
Hi Wez,

zend_module_entry openssl_module_entry = {
STANDARD_MODULE_HEADER,
openssl,
openssl_functions,
PHP_MINIT(openssl),
NULL, //supposed to be module shutdown function but marked as
NULL even though we have MSHUTDOWN function defined.
NULL,
NULL,
PHP_MINFO(openssl),
NO_VERSION_YET,
STANDARD_MODULE_PROPERTIES
};

My patch for making the req.priv_key not to get dispopsed is available
here.
http://puggy.symonds.net/~kameshj/openssl.c.patch

With regards
Kamesh Jayachandran
On Mon, 25 Oct 2004 16:49:17 +0100, Wez Furlong [EMAIL PROTECTED]
said:
 Kamesh Jayachandran wrote:
  During the failure openssl_csr_new is not setting req.priv_key to NULL
  this causes dispose function to free the req.priv_key.
 
  Can I go ahead and set req.priv_key = NULL when php_openssl_make_REQ
  returns failure and we_made_the_key == 0?
 
 Please send me a diff
 
  I have seen shutdown function is set to NULL even though it is defined.
 
 Which one?  Where?
 
 --Wez
 

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



Re: [PHP-DEV] Re: Why module shutdown function is not called for openssl extension?

2004-10-26 Thread Kamesh Jayachandran
Thanks for applying my patches.

When will it be applied to PHP4.3 and 5.0 tree?

With regards
Kamesh Jayachandran
On Tue, 26 Oct 2004 10:34:19 +0100, Wez Furlong [EMAIL PROTECTED]
said:
 Heh, looks like it's never ever been enabled since ext/openssl was born.
 
 I committed your patch; the associated bug number was 29418.
 
 Thanks :)
 
 --Wez.
 
 
 On Mon, 25 Oct 2004 23:17:19 -0700, Kamesh Jayachandran
 [EMAIL PROTECTED] wrote:
  Hi Wez,
  
  zend_module_entry openssl_module_entry = {
  STANDARD_MODULE_HEADER,
  openssl,
  openssl_functions,
  PHP_MINIT(openssl),
  NULL, //supposed to be module shutdown function but marked as
  NULL even though we have MSHUTDOWN function defined.
  NULL,
  NULL,
  PHP_MINFO(openssl),
  NO_VERSION_YET,
  STANDARD_MODULE_PROPERTIES
  };
  
  My patch for making the req.priv_key not to get dispopsed is available
  here.
  http://puggy.symonds.net/~kameshj/openssl.c.patch
  
  With regards
  Kamesh Jayachandran
  On Mon, 25 Oct 2004 16:49:17 +0100, Wez Furlong [EMAIL PROTECTED]
  said:
  
  
   Kamesh Jayachandran wrote:
During the failure openssl_csr_new is not setting req.priv_key to NULL
this causes dispose function to free the req.priv_key.
  
Can I go ahead and set req.priv_key = NULL when php_openssl_make_REQ
returns failure and we_made_the_key == 0?
  
   Please send me a diff
  
I have seen shutdown function is set to NULL even though it is defined.
  
   Which one?  Where?
  
   --Wez
  
  
  --
  PHP Internals - PHP Runtime Development Mailing List
  To unsubscribe, visit: http://www.php.net/unsub.php
  
 

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



[PHP-DEV] Can someone allocate 2 command line switches for php cli on NetWare?

2004-10-26 Thread Kamesh Jayachandran
Hi All,
I need two cli switches to handle some special cases to NetWare specific
php invocation.
In linux and windows where shell and command prompt far live the php
interpreter invoked from them.
Both shell and command prompt will capture the output of the child php
interpreter.
In NetWare OS, php cli for that matter most programs are not invoked
from environments like shell/command prompt.
They are invoked directly from System Console which is in some sense
similar to init of Linux.
This makes the program to have their own Screen. 
Upon exit of the program the screen will close and the user can not see
the output anymore.
To solve this issue we have 'pressanykey' prompt under ifdef for NetWare
in php cli code before calling exit..

This introduces another problem of scripts to always wait for user to
press any key before closing the screen.

So we need a command line switch to conditionally prompting for user's
attention 'pressanykey'.

Another command line switch we need is to conditionally open or not to
open the screen at all.

Currently I could see g, j, k, o, p, t,u, x, y not being used.

Can I make use of any two of them?

With regards
Kamesh Jayachandran

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



Re: [PHP-DEV] Can someone allocate 2 command line switches for php cli on NetWare?

2004-10-26 Thread Kamesh Jayachandran
Hi Wez,
We have bash ported to NetWare which is new addition to our Netware
distro.
But still people tend to use System Console to run their programs.
Basically this is the requirements from some of Netware customers to use
php interpreter for running some cron jobs which does not need any
pressanykey(No interactivity with the user).

For other regular scripts invoked manually by user needs sort of
interactivity before closing the screen.

Regarding the pressanykey we can use NetWare system defaults to have
prompt functionality upon exit without having any code to have
pressanykey code.

Still we need to have switches to have this interactivity or not(Based
on usage regular/cron)
We need one more switch to determine whether to have output in the
Logger screen(System wide log console) or Interpreter screen.

With regards
Kamesh Jayachandran


On Tue, 26 Oct 2004 15:01:34 +0100, Wez Furlong [EMAIL PROTECTED]
said:
 Doesn't netware have a standard wait or pause utility for this kind of
 thing?
 
 It feels like PHP is the wrong place to add this kind of option; why
 should every application that runs on netware include code to open a
 screen?  Why should every application that runs on netware include
 press-any-key code?
 
 Surely it is better to port a real shell and put the netware code in
 there instead?
 
 --Wez.
 
 
 On Tue, 26 Oct 2004 06:18:21 -0700, Kamesh Jayachandran
 [EMAIL PROTECTED] wrote:
  Hi All,
  I need two cli switches to handle some special cases to NetWare specific
  php invocation.
  In linux and windows where shell and command prompt far live the php
  interpreter invoked from them.
  Both shell and command prompt will capture the output of the child php
  interpreter.
  In NetWare OS, php cli for that matter most programs are not invoked
  from environments like shell/command prompt.
  They are invoked directly from System Console which is in some sense
  similar to init of Linux.
  This makes the program to have their own Screen.
  Upon exit of the program the screen will close and the user can not see
  the output anymore.
  To solve this issue we have 'pressanykey' prompt under ifdef for NetWare
  in php cli code before calling exit..
  
  This introduces another problem of scripts to always wait for user to
  press any key before closing the screen.
  
  So we need a command line switch to conditionally prompting for user's
  attention 'pressanykey'.
  
  Another command line switch we need is to conditionally open or not to
  open the screen at all.
  
  Currently I could see g, j, k, o, p, t,u, x, y not being used.
  
  Can I make use of any two of them?
  
  With regards
  Kamesh Jayachandran
  
  --
  PHP Internals - PHP Runtime Development Mailing List
  To unsubscribe, visit: http://www.php.net/unsub.php
  
 

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



Re: [PHP-DEV] Can someone allocate 2 command line switches for php cli on NetWare?

2004-10-26 Thread Kamesh Jayachandran
Shane,

This solution seems interesting.

I will give a try.

With regards
Kamesh Jayachandran
On Tue, 26 Oct 2004 08:24:03 -0700, Shane Caraveo [EMAIL PROTECTED]
said:
 Here is my suggestion,
 Rather than taking two switches, php should grow a generic switch for 
 this kind of use:
 
 php -o param:value;param:value;
 
 This allows custom mods to php a way to introduce new options that are 
 not part of the general php distribution, without the need to land grab 
 the limited switches.  There is also the potential for someone to 
 develop an extension to allow a php script to handle some alternative 
 switches.
 
 Regards,
 Shane
 
 Kamesh Jayachandran wrote:
  Still we need to have switches to have this interactivity or not(Based
  on usage regular/cron)
  We need one more switch to determine whether to have output in the
  Logger screen(System wide log console) or Interpreter screen.

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



Re: [PHP-DEV] Can someone allocate 2 command line switches for php cli on NetWare?

2004-10-26 Thread Kamesh Jayachandran
Wez,

Seems interesting but the bit invasive to the scripts they already have.
They have to change call my custome ext/netware function I will try this
solution too.

Thanks
With regards
Kamesh Jayachandran
On Tue, 26 Oct 2004 15:57:47 +0100, Wez Furlong [EMAIL PROTECTED]
said:
 How about moving this kind of functionality into ext/netware and
 having a couple of functions that manipulate the netware
 screens/interactivity stuff?
 
 Then the scripts themselves can control exactly what is needed; this
 feels better to me, as it is more in line with other systems.
 
 --Wez
 
 On Tue, 26 Oct 2004 07:31:16 -0700, Kamesh Jayachandran
 [EMAIL PROTECTED] wrote:
  Hi Wez,
  We have bash ported to NetWare which is new addition to our Netware
  distro.
  But still people tend to use System Console to run their programs.
  Basically this is the requirements from some of Netware customers to use
  php interpreter for running some cron jobs which does not need any
  pressanykey(No interactivity with the user).
  
  For other regular scripts invoked manually by user needs sort of
  interactivity before closing the screen.
  
  Regarding the pressanykey we can use NetWare system defaults to have
  prompt functionality upon exit without having any code to have
  pressanykey code.
  
  Still we need to have switches to have this interactivity or not(Based
  on usage regular/cron)
  We need one more switch to determine whether to have output in the
  Logger screen(System wide log console) or Interpreter screen.
  
  With regards
  Kamesh Jayachandran
  
  On Tue, 26 Oct 2004 15:01:34 +0100, Wez Furlong [EMAIL PROTECTED]
  said:
  
  
   Doesn't netware have a standard wait or pause utility for this kind of
   thing?
  
   It feels like PHP is the wrong place to add this kind of option; why
   should every application that runs on netware include code to open a
   screen?  Why should every application that runs on netware include
   press-any-key code?
  
   Surely it is better to port a real shell and put the netware code in
   there instead?
  
   --Wez.
  
  
   On Tue, 26 Oct 2004 06:18:21 -0700, Kamesh Jayachandran
   [EMAIL PROTECTED] wrote:
Hi All,
I need two cli switches to handle some special cases to NetWare specific
php invocation.
In linux and windows where shell and command prompt far live the php
interpreter invoked from them.
Both shell and command prompt will capture the output of the child php
interpreter.
In NetWare OS, php cli for that matter most programs are not invoked
from environments like shell/command prompt.
They are invoked directly from System Console which is in some sense
similar to init of Linux.
This makes the program to have their own Screen.
Upon exit of the program the screen will close and the user can not see
the output anymore.
To solve this issue we have 'pressanykey' prompt under ifdef for NetWare
in php cli code before calling exit..
   
This introduces another problem of scripts to always wait for user to
press any key before closing the screen.
   
So we need a command line switch to conditionally prompting for user's
attention 'pressanykey'.
   
Another command line switch we need is to conditionally open or not to
open the screen at all.
   
Currently I could see g, j, k, o, p, t,u, x, y not being used.
   
Can I make use of any two of them?
   
With regards
Kamesh Jayachandran
   
--
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php
   
   
 

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



Re: [PHP-DEV] Can someone allocate 2 command line switches for php cli on NetWare?

2004-10-26 Thread Kamesh Jayachandran
Seems a better option I will give it a try.

With regards
Kamesh Jayachandran

On Tue, 26 Oct 2004 18:40:33 -0700, Andi Gutmans [EMAIL PROTECTED] said:
 I suggest to go with Wez's recommendation of adding ext/netware.
 You can use -d to change INI values at the command line which can be 
 accessed from the extension.
 I don't think there's a need for -o
 
 Andi
 
 At 08:24 AM 10/26/2004 -0700, Shane Caraveo wrote:
 Here is my suggestion,
 Rather than taking two switches, php should grow a generic switch for this 
 kind of use:
 
 php -o param:value;param:value;
 
 This allows custom mods to php a way to introduce new options that are not 
 part of the general php distribution, without the need to land grab the 
 limited switches.  There is also the potential for someone to develop an 
 extension to allow a php script to handle some alternative switches.
 
 Regards,
 Shane
 
 Kamesh Jayachandran wrote:
 Still we need to have switches to have this interactivity or not(Based
 on usage regular/cron)
 We need one more switch to determine whether to have output in the
 Logger screen(System wide log console) or Interpreter screen.
 
 --
 PHP Internals - PHP Runtime Development Mailing List
 To unsubscribe, visit: http://www.php.net/unsub.php
 

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



[PHP-DEV] Why module shutdown function is not called for openssl extension?

2004-10-25 Thread Kamesh Jayachandran
Hi All,

I have identified a defect in openssl extension code. Even though it is
not critical and not likely to happen. Let me explain the scenario.
?php
$dn = array(
countryName = TestCountry,
stateOrProvinceName = TestSrate,
localityName = TestLocality,
organizationName = Test Organisation,
organizationalUnitName = Test organisational Unit,
commonName = Test common name,
emailAddress = [EMAIL PROTECTED]
);
$privkey = openssl_pkey_new();
$csr = openssl_csr_new($dn, $privkey);
?
The above scenario causes a segfault in NetWare but not on Linux. I did
not try on windows.

openssl_csr_new will fail because maxlength of countryName is 2
characters.
During the failure openssl_csr_new is not setting req.priv_key to NULL
this causes dispose function to free the req.priv_key.
As a part of php_request_shutdown $privkey is again freed(second time).
This causes a seg fault in NetWare.

Can I go ahead and set req.priv_key = NULL when php_openssl_make_REQ
returns failure and we_made_the_key == 0?


I have seen shutdown function is set to NULL even though it is defined.

With regards
Kamesh Jayachandran

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



[PHP-DEV] Why zend_static_allocator.c does not iclude stdlib.h?

2004-10-19 Thread Kamesh Jayachandran
Hi All,
I could see zend_static_Allocator.c inside ZendEngine2.
I could not see this file is getting compiled in PHP-5.0.0/PHP-5.1-dev. 
What is the use of this file? How to run ./configure to add this to my
Makefile?
Or is it meant for future use?
Why I am concerned about it is, in its current state it cannot be
compiled as It don't have NULL defined, i.e it does not include
stdlib.h.
If I dig the file's history I could see stdlib.h was included till
version 1.6 of the file.
On version 1.7 stdlib.h has been commented out by phanto around 2 years
and 2 months back.
The log message says make win32 debug output more verbose.
Can I include stdlib.h?

With regards
Kamesh Jayachandran

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



Re: [PHP-DEV] why to call php_output_activate(TSRMLS_C) from php_module_startup(reposting first time)(bug #30397)

2004-10-18 Thread Kamesh Jayachandran
Can someone respoond to this.

With regards
Kamesh Jayachandran
On Thu, 07 Oct 2004 23:10:24 -0700, Kamesh Jayachandran
[EMAIL PROTECTED] said:
 Hi All,
 I could see php_output_activate(TSRMLS_C) getting called from
 php_module_startup immedeately after php_output_startup.
 
 Why is this needed? As each SAPI modules call
 php_output_activate(TSRMLS_C) explicitly as a part of request startup.
 
 Why am I concerned about this?
 
 Ans: php_output_activate(TSRMLS_C) sets
 OG(php_body_write) = php_ub_body_write;
 which causes calls to php_printf to use php_ub_body_write which depends
 on SG(request_info) which is null while php_printf is invoked as part of
 apache startup error(Like Invalid extension/ Non existent extension)
 logging.
 
 This causes segmentation fault.
 
 This change seems to have been introduced in version 1.371 of
 main/main.c by Zeev(3 years and 3 months ago).
 The comment says,
 Fix a major thread safety bug in the output mechanism
 @- Fixed a major memory corruption bug in the thread safe version (Zeev) 
 
 
 Can I remove a call to php_output_activate(TSRMLS_C) from
 php_module_startup?
 
 PS:What is the use of display_startup_errors? What does display mean
 with respect to startup as it might not have any associated request
 context?
 
 With regards
 Kamesh Jayachandran
 
 -- 
 PHP Internals - PHP Runtime Development Mailing List
 To unsubscribe, visit: http://www.php.net/unsub.php
 

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



[PHP-DEV] why to call php_output_activate(TSRMLS_C) from php_module_startup

2004-10-08 Thread Kamesh Jayachandran
Hi All,
I could see php_output_activate(TSRMLS_C) getting called from
php_module_startup immedeately after php_output_startup.

Why is this needed? As each SAPI modules call
php_output_activate(TSRMLS_C) explicitly as a part of request startup.

Why am I concerned about this?

Ans: php_output_activate(TSRMLS_C) sets
OG(php_body_write) = php_ub_body_write;
which causes calls to php_printf to use php_ub_body_write which depends
on SG(request_info) which is null while php_printf is invoked as part of
apache startup error(Like Invalid extension/ Non existent extension)
logging.

This causes segmentation fault.

This change seems to have been introduced in version 1.371 of
main/main.c by Zeev(3 years and 3 months ago).
The comment says,
Fix a major thread safety bug in the output mechanism
@- Fixed a major memory corruption bug in the thread safe version (Zeev) 


Can I remove a call to php_output_activate(TSRMLS_C) from
php_module_startup?

PS:What is the use of display_startup_errors? What does display mean
with respect to startup as it might not have any associated request
context?

With regards
Kamesh Jayachandran

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



[PHP-DEV] Shall we remove including config.w32.h and php_config.h from php_scandir.c?

2004-10-07 Thread Kamesh Jayachandran
Hi All,
In main/php_scandir.c
we are conditionally including config.w32.h for windows and php_config.h
for others.
As we are including the php_scandir.h also I feel including config.w32.h
and php_config.h is not necessary(php_scandir.h has already would have
included either config.w32.h or php_config.h).

With regards
Kamesh Jayachandran

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



Re: [PHP-DEV] issues in compiling the zend_execute.c in CVS HEAD

2004-09-28 Thread Kamesh Jayachandran
Hi Andi,
I had a problem in compiling the zend_execute.c. 
My CPU was used upto 100% for 10 minutes while compiling zend_execute.c,
After 10 minutes zend_execute.c got compiled.
The same code when compiled with -O1 optimisations compiles pretty fast.

I use gcc 3.3.1, trying to compile for Linux.

With regards
Kamesh Jayachandran


On Mon, 27 Sep 2004 19:11:53 -0700, Andi Gutmans [EMAIL PROTECTED] said:
 What platform are you on? What compiler? (Netware?)
 Try and edit zend_vm.h:
 #ifndef ZEND_VM_OLD_EXECUTOR
 /*#  define ZEND_VM_KIND ZEND_VM_KIND_CALL */
 
 And uncomment the second line (forces PHP to use the function call
 handlers).
 Let me know what happens.
 Andi
 
 At 05:18 AM 9/25/2004 -0700, Kamesh Jayachandran wrote:
 Hi All,
 
 I have updated the php to latest HEAD from then on compiling
 zend_execute.c keeps hanging.
 
 This is the compile command I could see,
 
 /bin/sh /root/kamesh/work/php-src/libtool --silent --preserve-dup-deps
 --mode=compile /root/kamesh/work/php-src/meta_ccld  -IZend/
 -I/root/kamesh/work/php-src/Zend/ -DPHP_ATOM_INC
 -I/root/kamesh/work/php-src/include -I/root/kamesh/work/php-src/main
 -I/root/kamesh/work/php-src -I/root/kamesh/work/php-src/Zend
 -I/usr/include/libxml2  -D_REENTRANT -I/root/kamesh/work/php-src/TSRM
 -g -O2 -pthread -DZTS  -prefer-pic -c
 /root/kamesh/work/php-src/Zend/zend_execute.c -o Zend/zend_execute.lo
 
 With regards
 Kamesh Jayachandran
 
 --
 PHP Internals - PHP Runtime Development Mailing List
 To unsubscribe, visit: http://www.php.net/unsub.php
 

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



Re: [PHP-DEV] issues in compiling the zend_execute.c in CVS HEAD

2004-09-28 Thread Kamesh Jayachandran
Hi Wez,

Yes there is no problem. I got scared after my CPU getting hog for
continous 5 minutes on a single file.

Ultimately It compiles after around 10 minutes.

FYI: I did not configure explicitly with --enable-inline-optimization
switch.

With regards
Kamesh Jayachandran
On Tue, 28 Sep 2004 08:30:26 +0100, Wez Furlong [EMAIL PROTECTED]
said:
 There is no problem there...
 
 You configured PHP with the --enable-inline-optimization switch,
 right?  Turn it off if you don't want an optimized executor.
 
 --Wez.
 
 
 On Mon, 27 Sep 2004 23:10:07 -0700, Kamesh Jayachandran
 [EMAIL PROTECTED] wrote:
  Hi Andi,
  I had a problem in compiling the zend_execute.c.
  My CPU was used upto 100% for 10 minutes while compiling zend_execute.c,
  After 10 minutes zend_execute.c got compiled.
  The same code when compiled with -O1 optimisations compiles pretty fast.
  
  I use gcc 3.3.1, trying to compile for Linux.
  
  With regards
  Kamesh Jayachandran
  
  
  
  
  On Mon, 27 Sep 2004 19:11:53 -0700, Andi Gutmans [EMAIL PROTECTED] said:
   What platform are you on? What compiler? (Netware?)
   Try and edit zend_vm.h:
   #ifndef ZEND_VM_OLD_EXECUTOR
   /*#  define ZEND_VM_KIND ZEND_VM_KIND_CALL */
  
   And uncomment the second line (forces PHP to use the function call
   handlers).
   Let me know what happens.
   Andi
  
   At 05:18 AM 9/25/2004 -0700, Kamesh Jayachandran wrote:
   Hi All,
   
   I have updated the php to latest HEAD from then on compiling
   zend_execute.c keeps hanging.
   
   This is the compile command I could see,
   
   /bin/sh /root/kamesh/work/php-src/libtool --silent --preserve-dup-deps
   --mode=compile /root/kamesh/work/php-src/meta_ccld  -IZend/
   -I/root/kamesh/work/php-src/Zend/ -DPHP_ATOM_INC
   -I/root/kamesh/work/php-src/include -I/root/kamesh/work/php-src/main
   -I/root/kamesh/work/php-src -I/root/kamesh/work/php-src/Zend
   -I/usr/include/libxml2  -D_REENTRANT -I/root/kamesh/work/php-src/TSRM
   -g -O2 -pthread -DZTS  -prefer-pic -c
   /root/kamesh/work/php-src/Zend/zend_execute.c -o Zend/zend_execute.lo
   
   With regards
   Kamesh Jayachandran
   
   --
   PHP Internals - PHP Runtime Development Mailing List
   To unsubscribe, visit: http://www.php.net/unsub.php
  
  
  --
  PHP Internals - PHP Runtime Development Mailing List
  To unsubscribe, visit: http://www.php.net/unsub.php
  
 

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



[PHP-DEV] issues with ext/xml/tests/bug26614.phpt

2004-09-28 Thread Kamesh Jayachandran
Hi All,
I have a expat based php xml parser extension there also the
ext/xml/tests/bug26614.phpt fails the difference I could see is in byte
position,

For this snippet expected xml_get_current_byte_index is 45, 90 for start
and end of data tag respectively.
This would be correct if the lines are ended by \n.
?xml version=1.0 encoding=iso-8859-1 ?
data
![CDATA[
multi
line 
CDATA
block
]]
/data

But I feel the lines are ended by \r\n 

So I get 46(\r in the first line) and 98(8 \r preceding 8 lines).

How to differentiate between \r\n and \n?

I tried vi editor with :se list it was showing $ for both \r\n and
\n.


With regards
Kamesh Jayachandran

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



[PHP-DEV] issues in compiling the zend_execute.c in CVS HEAD

2004-09-25 Thread Kamesh Jayachandran
Hi All,

I have updated the php to latest HEAD from then on compiling
zend_execute.c keeps hanging.

This is the compile command I could see,

/bin/sh /root/kamesh/work/php-src/libtool --silent --preserve-dup-deps
--mode=compile /root/kamesh/work/php-src/meta_ccld  -IZend/
-I/root/kamesh/work/php-src/Zend/ -DPHP_ATOM_INC
-I/root/kamesh/work/php-src/include -I/root/kamesh/work/php-src/main
-I/root/kamesh/work/php-src -I/root/kamesh/work/php-src/Zend
-I/usr/include/libxml2  -D_REENTRANT -I/root/kamesh/work/php-src/TSRM 
-g -O2 -pthread -DZTS  -prefer-pic -c
/root/kamesh/work/php-src/Zend/zend_execute.c -o Zend/zend_execute.lo

With regards
Kamesh Jayachandran

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



Re: [PHP-DEV] issues in compiling the zend_execute.c in CVS HEAD

2004-09-25 Thread Kamesh Jayachandran
Hi Andi,
This problem seems to be there with the zend_compile.h version 1.293,
zend_execute.c version 1.680, zend_opcode.c version 1.108 and
zend_execute_API.c version 1.299.

This compilation problem does not exist in Non-ZTS mode, but exist in
ZTS mode only.

I have just reverted the versions just 1 down and My problem(ZTS build)
is solved.
With regards
Kamesh Jayachandran
On Sat, 25 Sep 2004 05:18:14 -0700, Kamesh Jayachandran
[EMAIL PROTECTED] said:
 Hi All,
 
 I have updated the php to latest HEAD from then on compiling
 zend_execute.c keeps hanging.
 
 This is the compile command I could see,
 
 /bin/sh /root/kamesh/work/php-src/libtool --silent --preserve-dup-deps
 --mode=compile /root/kamesh/work/php-src/meta_ccld  -IZend/
 -I/root/kamesh/work/php-src/Zend/ -DPHP_ATOM_INC
 -I/root/kamesh/work/php-src/include -I/root/kamesh/work/php-src/main
 -I/root/kamesh/work/php-src -I/root/kamesh/work/php-src/Zend
 -I/usr/include/libxml2  -D_REENTRANT -I/root/kamesh/work/php-src/TSRM 
 -g -O2 -pthread -DZTS  -prefer-pic -c
 /root/kamesh/work/php-src/Zend/zend_execute.c -o Zend/zend_execute.lo
 
 With regards
 Kamesh Jayachandran
 
 -- 
 PHP Internals - PHP Runtime Development Mailing List
 To unsubscribe, visit: http://www.php.net/unsub.php
 

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



Re: [PHP-DEV] [PATCH] tests/classes/factory_and_singleton_009.phpt

2004-09-24 Thread Kamesh Jayachandran
Hi Marcus,

For me also this test is going through if I run the test using
run-tests.php.

But it fails with run-tests2.php

With run-tests2.php
I could see the output from the execute function itself was lacking that
one new line character that exists between
===DONE=== and the actual waring line.

The only difference I could see is the way the php
factory_and_singleton_009.php

In run-tests.php
All the -d option value pairs are enclosed by double quote
has extra options -d xdebug.default_enable=0 -d session.auto_start=0
runs the script with -f option.

With regards
Kamesh Jayachandran
On Thu, 23 Sep 2004 21:07:01 +0200, Marcus Boerger [EMAIL PROTECTED]
said:
 Hello Kamesh,
 
  doesn't work for me. And if you were right we would see those tests
  FAILing
 in all php 5 test reports. There must be another problem.
 
 regards
 marcus
 
 Thursday, September 23, 2004, 1:15:30 PM, you wrote:
 
  Hi Helly,
  I had the tests/classes/factory_and_singleton_009.phpt testcase failing
  in Linux, NetWare, Windows ports of PHP.
  And found that this failure is due to one extra line.
 
  Attached the patch.
 
  Similar issue exists in tests/classes/factory_and_singleton_010.phpt
 
  Actually after ===DONE=== newline preceded in warning message brings the
  cursor to next immedeate line with a warning message. So expecting one
  more new line between ===DONE=== and warning message is incorrect.
 
  Correct me if I am wrong.
 
  If I am correct can I go ahead and commit it.
 
  With regards
  Kamesh Jayachandran 
 
 
 
 -- 
 Best regards,
  Marcusmailto:[EMAIL PROTECTED]
 

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



Re: [PHP-DEV] [PATCH] tests/classes/factory_and_singleton_009.phpt

2004-09-24 Thread Kamesh Jayachandran
Hi Marcus,

Found the cause of the problem.

getSectionText function in run-tests2.php is trimming the each
sectiontext values except for POST.

This trimming causes the eol character in the phpt file to get lost when
saved to a php file.

Should we have to remove the trim function? or fix our testcases or
run-tests.php?

Please advise.

With regards
Kamesh Jayachandran

On Fri, 24 Sep 2004 00:20:15 -0700, Kamesh Jayachandran
[EMAIL PROTECTED] said:
 Hi Marcus,
 
 For me also this test is going through if I run the test using
 run-tests.php.
 
 But it fails with run-tests2.php
 
 With run-tests2.php
 I could see the output from the execute function itself was lacking that
 one new line character that exists between
 ===DONE=== and the actual waring line.
 
 The only difference I could see is the way the php
 factory_and_singleton_009.php
 
 In run-tests.php
 All the -d option value pairs are enclosed by double quote
 has extra options -d xdebug.default_enable=0 -d session.auto_start=0
 runs the script with -f option.
 
 With regards
 Kamesh Jayachandran
 On Thu, 23 Sep 2004 21:07:01 +0200, Marcus Boerger [EMAIL PROTECTED]
 said:
  Hello Kamesh,
  
   doesn't work for me. And if you were right we would see those tests
   FAILing
  in all php 5 test reports. There must be another problem.
  
  regards
  marcus
  
  Thursday, September 23, 2004, 1:15:30 PM, you wrote:
  
   Hi Helly,
   I had the tests/classes/factory_and_singleton_009.phpt testcase failing
   in Linux, NetWare, Windows ports of PHP.
   And found that this failure is due to one extra line.
  
   Attached the patch.
  
   Similar issue exists in tests/classes/factory_and_singleton_010.phpt
  
   Actually after ===DONE=== newline preceded in warning message brings the
   cursor to next immedeate line with a warning message. So expecting one
   more new line between ===DONE=== and warning message is incorrect.
  
   Correct me if I am wrong.
  
   If I am correct can I go ahead and commit it.
  
   With regards
   Kamesh Jayachandran 
  
  
  
  -- 
  Best regards,
   Marcusmailto:[EMAIL PROTECTED]
  
 
 -- 
 PHP Internals - PHP Runtime Development Mailing List
 To unsubscribe, visit: http://www.php.net/unsub.php
 

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



Re: [PHP-DEV] Fwd: [ZEND-ENGINE-CVS] cvs: ZendEngine2 / zend_execute_API.c zend_globals.h

2004-09-23 Thread Kamesh Jayachandran
Hi All,

Reverted the NetWare specific stack limit check related changes.

With regards
Kamesh Jayachandran

On Wed, 22 Sep 2004 11:12:05 -0700, Andi Gutmans [EMAIL PROTECTED] said:
 Do we want this in the core engine?
 If so, why not create a general solution for multi-threaded systems (I 
 think Apache pre-fork is better off without it due to performance
 reasons).
 Anantha, can you please revert this patch until we come to a conclusion?
 I 
 prefer doing a general implementation (#ifdef'ed) and having each
 platform 
 implement their own stack threshold check.
 
 Andi
 
 
 Delivered-To: [EMAIL PROTECTED]
 Mailing-List: contact [EMAIL PROTECTED]; run by ezmlm
 list-help: mailto:[EMAIL PROTECTED]
 list-unsubscribe: mailto:[EMAIL PROTECTED]
 list-post: mailto:[EMAIL PROTECTED]
 Delivered-To: mailing list [EMAIL PROTECTED]
 Delivered-To: [EMAIL PROTECTED]
 Delivered-To: [EMAIL PROTECTED]
 From: Anantha Kesari H Y [EMAIL PROTECTED]
 To: [EMAIL PROTECTED]
 Date: Wed, 22 Sep 2004 15:51:56 -
 Subject: [ZEND-ENGINE-CVS] cvs: ZendEngine2 / zend_execute_API.c 
 zend_globals.h
 X-Bogosity: No, tests=bogofilter, spamicity=0.00, version=0.13.6.2
 
 hyanantha   Wed Sep 22 11:51:56 2004 EDT
 
Modified files:
  /ZendEngine2zend_globals.h zend_execute_API.c
Log:
NetWare specific stack limit checks
 
 
 http://cvs.php.net/diff.php/ZendEngine2/zend_globals.h?r1=1.137r2=1.138ty=u
 Index: ZendEngine2/zend_globals.h
 diff -u ZendEngine2/zend_globals.h:1.137 ZendEngine2/zend_globals.h:1.138
 --- ZendEngine2/zend_globals.h:1.137Mon Aug 23 16:57:40 2004
 +++ ZendEngine2/zend_globals.h  Wed Sep 22 11:51:56 2004
 @@ -17,7 +17,7 @@
  +--+
   */
 
 -/* $Id: zend_globals.h,v 1.137 2004/08/23 20:57:40 helly Exp $ */
 +/* $Id: zend_globals.h,v 1.138 2004/09/22 15:51:56 hyanantha Exp $ */
 
   #ifndef ZEND_GLOBALS_H
   #define ZEND_GLOBALS_H
 @@ -202,6 +202,10 @@
 
   #ifdef ZEND_WIN32
  zend_bool timed_out;
 +#endif
 +
 +#ifdef NETWARE
 +   zend_bool nw_stack_limit;
   #endif
 
  HashTable regular_list;
 http://cvs.php.net/diff.php/ZendEngine2/zend_execute_API.c?r1=1.296r2=1.297ty=u
 Index: ZendEngine2/zend_execute_API.c
 diff -u ZendEngine2/zend_execute_API.c:1.296 
 ZendEngine2/zend_execute_API.c:1.297
 --- ZendEngine2/zend_execute_API.c:1.296Fri Sep 17 06:13:52 2004
 +++ ZendEngine2/zend_execute_API.c  Wed Sep 22 11:51:56 2004
 @@ -17,7 +17,7 @@
  +--+
   */
 
 -/* $Id: zend_execute_API.c,v 1.296 2004/09/17 10:13:52 stas Exp $ */
 +/* $Id: zend_execute_API.c,v 1.297 2004/09/22 15:51:56 hyanantha Exp $ */
 
   #include stdio.h
   #include signal.h
 @@ -49,6 +49,9 @@
   static int timeout_thread_initialized=0;
   #endif
 
 +#ifdef NETWARE
 +ZEND_API void zend_nw_stack_limit(int dummy);
 +#endif
 
   #if ZEND_DEBUG
   static void (*original_sigsegv_handler)(int);
 @@ -178,6 +181,10 @@
  EG(timed_out) = 0;
   #endif
 
 +#ifdef NETWARE
 +   EG(nw_stack_limit) = 0;
 +#endif
 +
  EG(exception) = NULL;
 
  EG(scope) = NULL;
 @@ -1104,6 +,12 @@
EG(timeout_seconds), EG(timeout_seconds) == 1 ? 
   : s);
   }
 
 +#ifdef NETWARE
 +ZEND_API void zend_nw_stack_limit(int dummy)
 +{
 +zend_error(E_ERROR, Stack limit exceeded);
 +}
 +#endif
 
   #ifdef ZEND_WIN32
   static LRESULT CALLBACK zend_timeout_WndProc(HWND hWnd, UINT message, 
  WPARAM wParam, LPARAM lParam)
 
 --
 Zend Engine CVS Mailing List (http://cvs.php.net/)
 To unsubscribe, visit: http://www.php.net/unsub.php
 
 -- 
 PHP Internals - PHP Runtime Development Mailing List
 To unsubscribe, visit: http://www.php.net/unsub.php
 

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



[PHP-DEV] Why to have owner's uid of the file when WWW-Authenticate header?

2004-09-22 Thread Kamesh Jayachandran
Hi All,

I want to know the reason behind the having the uid of the owner of the
file shown as a part of realm string the WWW-Authenticate when safe_mode
is enabled.


With regards
Kamesh Jayachandran

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



[PHP-DEV] Why zend_shutdown_constants not called from executor_globals_dtor?

2004-09-11 Thread Kamesh Jayachandran
Hi All,
I could see in executor_globals_ctor calling zend_startup_constants
which allocates one hash table.
Later to free this hash table zend_shutdown_constants is called from
zend_shutdown rather than executor_globals_dtor.
This may not cause a memory leak in Non ZTS environment where
zend_shutdown and executor_globals_dtor are called only once and the
current free up by calling zend_shutdown_constants from zend_shutdown
won't cause any memory leak.

In case of ZTS environment every thread calls executor_globals_ctor and
only the main thread causes zend_shutdown and hence only main thread
EG(zend_constants) are freed whereas other threads EG(zend_constants)
are not freed.

Correct me if I am wrong.

With regards
Kamesh Jayachandran

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



[PHP-DEV] who calls ts_free_thread?

2004-09-10 Thread Kamesh Jayachandran
Hi All,
I am going through the TSRM code. I could see ts_free_thread method to
release the resources for the thread.
grep did not give me any information about the caller.

I could see a constant amount of leak per thread. Whether this leak has
got anything to do with not calling ts_free_thread.

If at all have to be called from where it should be called.

With regards
Kamesh Jayachandran

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



Re: [PHP-DEV] Info needed

2004-09-09 Thread Kamesh Jayachandran
Hi Derick,
Just one more reminder to apply my patches for NetWare port.
With regards
Kamesh Jayachandran


On Fri, 13 Aug 2004 01:10:56 -0700, Kamesh Jayachandran
[EMAIL PROTECTED] said:
 Hi Derick,
 Just a remainder to apply my patches for NetWare port.
 
 With regards
 Kamesh Jayachandran
 
 On Mon, 2 Aug 2004 16:19:56 +0200 (CEST), Derick Rethans
 [EMAIL PROTECTED] said:
  On Mon, 2 Aug 2004, Kamesh Jayachandran wrote:
  
   Hi Derick,
   Did you apply my patches?
  
  Not yet, but I will. I just returned today.
  
  Derick
 
 -- 
 PHP Internals - PHP Runtime Development Mailing List
 To unsubscribe, visit: http://www.php.net/unsub.php
 

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



[PHP-DEV] info needed regarding TSRM thread local storage

2004-09-09 Thread Kamesh Jayachandran
Hi All,
what this MBO_0 mean?
I could see the MBO_0 ifdefs removed in 1.62 version of TSRM.c whether
this change has got anything to do with memory leak fix.
I could see 246888 bytes of leak for each thread.
Even the simple ?php echo hi;? script causes 60 bytes of leak.

Where and when the thread local storage is freed?. 

With regards
Kamesh Jayachandran

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



Re: [PHP-DEV] info needed regarding TSRM thread local storage

2004-09-09 Thread Kamesh Jayachandran
Thanks Andrey.
I have Apache with worker thread mpm configured.
With this MBO_0 macro not defined I get a memory leak of 2,46,888 bytes.
With this MBO_0 macro defined I get a memory leak of 51,912 bytes.
If I look at the code also it seems that dtor of the resources are
called only if MBO_0 macro is defined.

Correct me if I am wrong.

With regards
Kamesh Jayachandran

On Thu, 09 Sep 2004 16:30:12 +0200, Andrey Hristov [EMAIL PROTECTED]
said:
   Hi,
 probably MBO_0 stands for MarcusBOerger_0 . I am not sure whether this
 was somewehere in 
 the coding standards
 document, but this means that the programmer has commented the code by
 using the 
 preprocessor. The programmer
 has to put his name and a suffix _0 . Usually code commented this way is
 quite 
 experimental and can lead to problems,
 but was left for some reason.
 It looks like this.
 
 Andrey
 
 Kamesh Jayachandran wrote:
  Hi All,
  what this MBO_0 mean?
  I could see the MBO_0 ifdefs removed in 1.62 version of TSRM.c whether
  this change has got anything to do with memory leak fix.
  I could see 246888 bytes of leak for each thread.
  Even the simple ?php echo hi;? script causes 60 bytes of leak.
  
  Where and when the thread local storage is freed?. 
  
  With regards
  Kamesh Jayachandran
  
 

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



Re: [PHP-DEV] info needed regarding TSRM thread local storage

2004-09-09 Thread Kamesh Jayachandran
Hi Marcus,
That is fine.
The leak of 2,46,888 I was getting when I had ldap, mysql and xml
extension enabled.
After Disabling them and without MBO_0 I had a leak of 87744 bytes.
After Disabling them and with MBO_0 I had a leak of 51,912 bytes.
Anyway this figures are as given by NetWare System Console which might
be bit higher that actual called with malloc or calloc or realloc.

With regards
Kamesh Jayachandran
On Thu, 9 Sep 2004 17:05:32 +0200, Marcus Boerger [EMAIL PROTECTED]
said:
 Hello Kamesh,
 
 Thursday, September 9, 2004, 4:37:24 PM, you wrote:
 
  Thanks Andrey.
  I have Apache with worker thread mpm configured.
  With this MBO_0 macro not defined I get a memory leak of 2,46,888 bytes.
  With this MBO_0 macro defined I get a memory leak of 51,912 bytes.
  If I look at the code also it seems that dtor of the resources are
  called only if MBO_0 macro is defined.
 
 That's exactly correct. The mistake i did was using 'MBO_0' instead of
 'HELLY_0'. The reason this was commented out earlier was that we were
 too close to a release and decieded to live without that patch until
 the next release. However your numbers above look wrong. Could you
 repeat them correctly so i can see the difference between using that
 code and not using it?
 
 marcus
 

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



[PHP-DEV] clarification needed regarding tests\lang\bug22510.phpt and tests\lang\bug22231.phpt

2004-09-09 Thread Kamesh Jayachandran
Hi All,
Both these test cases expect strict standards but don't have --INI--
header to have the error_reporting to 2048 or E_STRICT.

Because of that these testcases fails in local build.

Am I missing something.
If I remember correctly from run_tests2.php passes -d
error_reporting=2047 only to all the scripts.

With regards
Kamesh Jayachandran

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



[PHP-DEV] Re: Clarification needed regarding tests/run-test/test005.phpt

2004-08-18 Thread Kamesh Jayachandran
Can Someone clarify on this?

With regards
Kamesh Jayachandran
On Wed, 11 Aug 2004 22:43:20 -0700, Kamesh Jayachandran
[EMAIL PROTECTED] said:
 Can someone clarify me on this?
 
 With regards
 Kamesh Jayachandran
 On Tue, 27 Jul 2004 22:46:40 -0700, Kamesh Jayachandran
 [EMAIL PROTECTED] said:
  Hi All,
  tests/run-test/test005.phpt is failing in PHP-5.0.0 linux.
  The log of test execution is pasted below.
  
   EXPECTED OUTPUT
  string(1) 1
  string(4) 4095
  string(1) 0
  string(1) 1
  string(1) 0
  NULL
  string(%d) %sivision by zer%s
   ACTUAL OUTPUT
  string(1) 1
  string(4) 2047
  string(1) 0
  string(1) 1
  string(1) 0
  NULL
  string(16) Division by zero
   FAILED
  
  The only difference I see is in the error_reporting value. 
  Which I think 2047 is right as my php.ini says E_ALL. 
  And my command line also says the same
  php  -d output_handler= -d zlib.output_compression=Off -d
  open_basedir= -d safe_mode=0 -d disable_functions= -d
  output_buffering=Off -d error_reporting=2047 -d display_errors=1
  -d log_errors=0 -d html_errors=0 -d track_errors=1 -d
  report_memleaks=1 -d report_zend_debug=0 -d
  docref_root=/phpmanual/ -d docref_ext=.html -d
  error_prepend_string= -d error_append_string= -d
  auto_prepend_file= -d auto_append_file= -d magic_quotes_runtime=0
  testsuite/tests/run-test/test005.php
  
  Why the testcase is expecting 4095 as I could not find any --INI section
  inside the testcase that sets this value to 4095?
  
  With regards
  Kamesh Jayachandran
  
  

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



Re: [PHP-DEV] Info needed

2004-08-13 Thread Kamesh Jayachandran
Hi Derick,
Just a remainder to apply my patches for NetWare port.

With regards
Kamesh Jayachandran

On Mon, 2 Aug 2004 16:19:56 +0200 (CEST), Derick Rethans
[EMAIL PROTECTED] said:
 On Mon, 2 Aug 2004, Kamesh Jayachandran wrote:
 
  Hi Derick,
  Did you apply my patches?
 
 Not yet, but I will. I just returned today.
 
 Derick

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



[PHP-DEV] Re: Clarification needed regarding tests/run-test/test005.phpt

2004-08-11 Thread Kamesh Jayachandran
Can someone clarify me on this?

With regards
Kamesh Jayachandran
On Tue, 27 Jul 2004 22:46:40 -0700, Kamesh Jayachandran
[EMAIL PROTECTED] said:
 Hi All,
 tests/run-test/test005.phpt is failing in PHP-5.0.0 linux.
 The log of test execution is pasted below.
 
  EXPECTED OUTPUT
 string(1) 1
 string(4) 4095
 string(1) 0
 string(1) 1
 string(1) 0
 NULL
 string(%d) %sivision by zer%s
  ACTUAL OUTPUT
 string(1) 1
 string(4) 2047
 string(1) 0
 string(1) 1
 string(1) 0
 NULL
 string(16) Division by zero
  FAILED
 
 The only difference I see is in the error_reporting value. 
 Which I think 2047 is right as my php.ini says E_ALL. 
 And my command line also says the same
 php  -d output_handler= -d zlib.output_compression=Off -d
 open_basedir= -d safe_mode=0 -d disable_functions= -d
 output_buffering=Off -d error_reporting=2047 -d display_errors=1
 -d log_errors=0 -d html_errors=0 -d track_errors=1 -d
 report_memleaks=1 -d report_zend_debug=0 -d
 docref_root=/phpmanual/ -d docref_ext=.html -d
 error_prepend_string= -d error_append_string= -d
 auto_prepend_file= -d auto_append_file= -d magic_quotes_runtime=0
 testsuite/tests/run-test/test005.php
 
 Why the testcase is expecting 4095 as I could not find any --INI section
 inside the testcase that sets this value to 4095?
 
 With regards
 Kamesh Jayachandran
 
 

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



[PHP-DEV] bug with display_startup_errors to On

2004-08-09 Thread Kamesh Jayachandran
Hi All,
I was just trying to load extension apc.so.
Accidentally I typed it as abc.so(See the typo).
I started apache2 but it did not crib at all.
But when  I tried to access the apache2, I could not.
Later I come to know that apache2 has not started at all.
When I drilled down further I found the following
The following two functions are not checking for not null on
SG(server_context).
php_apache_sapi_send_headers
php_apache_sapi_ub_write
This functions were causing a segmentation fault.

This happens only with display_startup_errors set to On

With regards
Kamesh Jayachandran

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



[PHP-DEV] bug in sapi apache2filter

2004-08-08 Thread Kamesh Jayachandran
Hi All,
I found apache giving segmentation fault in the following scenario.
1)Disable php module and start apache.
2)enable php in the httpd.conf
3)httpd restart(Not stop and start)
4)make a request to any php page apache segfaults.
I drilled down on this issue.
My investigation is,
Apache on startup calls php_apache_server_startup twice 
one to set a user data for a userdata_key apache2filter_post_config
and another to call tsrm_startup and all.
While restart it simply calls this function once which misses out call
to tsrm_startup and hence tsrm_tls_table_size is just zero inside TSRM
which causes divide by zero error in THREAD_HASH_OF macro.

With regards
Kamesh Jayachandran

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



[PHP-DEV] dom extension corrupting the Exception class

2004-08-03 Thread Kamesh Jayachandran
Hi All,
I found the following behaviour. I think it is a bug please clarify.

In php-5.0.0
1)Exception class is registered from zend_exceptions.c
2)After this If I see the common.fn_flags of constructor member of
Exception class entry it is 0x2100(Public Constructor).
Till this point is fine.
3)When dom extension is getting started It registers the DOMException
class to the CG(class_table) in that process it inherits from the
Exception class_entry and gets a constructor member pointer of Exception
class_entry.
4)dom extension startup routine updates this constructor pointer's
class_entry-common.fn_flags|=ZEND_ACC_PROTECTED and hence to 0x2300.
5)This causes me not to get the access specifier of __construct
constructor of Exception class if I access it from as Public.

Is this a accepted behaviour?
I see even though ReflectionException and SQLiteException extends
Exception they have their __construct method set to some function
pointer or else to NULL not just left at all.
This is no the case with DOMException.

With regards
Kamesh Jayachandran

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



Re: [PHP-DEV] dom extension corrupting the Exception class

2004-08-03 Thread Kamesh Jayachandran
Hi Wez,
Will the fix be available in 5.0.1?
How to browse the cvs tree of 5.0.1 from the web?

With regards
Kamesh Jayachandran

On Tue, 3 Aug 2004 11:52:48 +0100, Wez Furlong [EMAIL PROTECTED]
said:
 Already fixed in HEAD.
 
 On Tue, 03 Aug 2004 03:36:06 -0700, Kamesh Jayachandran
 [EMAIL PROTECTED] wrote:
  Hi All,
  I found the following behaviour. I think it is a bug please clarify.
  
  In php-5.0.0
  1)Exception class is registered from zend_exceptions.c
  2)After this If I see the common.fn_flags of constructor member of
  Exception class entry it is 0x2100(Public Constructor).
  Till this point is fine.
  3)When dom extension is getting started It registers the DOMException
  class to the CG(class_table) in that process it inherits from the
  Exception class_entry and gets a constructor member pointer of Exception
  class_entry.
  4)dom extension startup routine updates this constructor pointer's
  class_entry-common.fn_flags|=ZEND_ACC_PROTECTED and hence to 0x2300.
  5)This causes me not to get the access specifier of __construct
  constructor of Exception class if I access it from as Public.
  
  Is this a accepted behaviour?
  I see even though ReflectionException and SQLiteException extends
  Exception they have their __construct method set to some function
  pointer or else to NULL not just left at all.
  This is no the case with DOMException.
  
  With regards
  Kamesh Jayachandran
  
  --
  PHP Internals - PHP Runtime Development Mailing List
  To unsubscribe, visit: http://www.php.net/unsub.php
  
 

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



[PHP-DEV] Re: How to access the per-class constant from a member function?

2004-08-02 Thread Kamesh Jayachandran
Hi Mehdi,
Even Foo::HELLO works.
My question is why simple HELLO inside a member function does not work.

Why are we not able to access the static and const members of a class
from inside a class member function like the way with other member
variables.?

Any special reasons.

With regards
Kamesh Jayachandran
On Wed, 28 Jul 2004 18:10:52 +0200, Mehdi Achour [EMAIL PROTECTED] said:
 Hi Kamesh,
 
 Try replacing Foo::HELLO with self::HELLO. This should work.
 (this is documented, the manual will reflect it in the next build)
 
 didou
 
 Kamesh Jayachandran wrote:
  Hi All,
  ?php
  class Foo {
 const HELLO = con\n;
 function memberfunc() {
   echo HELLO; //does not work
   echo Foo::HELLO; //works
 }
  }
  $obj = new Foo();
  $obj-memberfunc();
  ?
  
  With a error_reporting=2047 I get 
  
  Notice: Use of undefined constant HELLO - assumed 'HELLO' in
  /rekha/php-5.0.0/test.php on line 5
  Whey echo HELLO fails?
  
  With regards
  Kamesh Jayachandran
 

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



[PHP-DEV] How to access the per-class constant from a member function?

2004-07-28 Thread Kamesh Jayachandran
Hi All,
?php
class Foo {
   const HELLO = con\n;
   function memberfunc() {
 echo HELLO; //does not work
 echo Foo::HELLO; //works
   }
}
$obj = new Foo();
$obj-memberfunc();
?

With a error_reporting=2047 I get 

Notice: Use of undefined constant HELLO - assumed 'HELLO' in
/rekha/php-5.0.0/test.php on line 5
Whey echo HELLO fails?

With regards
Kamesh Jayachandran

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



[PHP-DEV] Clarification needed regarding tests/run-test/test005.phpt

2004-07-27 Thread Kamesh Jayachandran
Hi All,
tests/run-test/test005.phpt is failing in PHP-5.0.0 linux.
The log of test execution is pasted below.

 EXPECTED OUTPUT
string(1) 1
string(4) 4095
string(1) 0
string(1) 1
string(1) 0
NULL
string(%d) %sivision by zer%s
 ACTUAL OUTPUT
string(1) 1
string(4) 2047
string(1) 0
string(1) 1
string(1) 0
NULL
string(16) Division by zero
 FAILED

The only difference I see is in the error_reporting value. 
Which I think 2047 is right as my php.ini says E_ALL. 
And my command line also says the same
php  -d output_handler= -d zlib.output_compression=Off -d
open_basedir= -d safe_mode=0 -d disable_functions= -d
output_buffering=Off -d error_reporting=2047 -d display_errors=1
-d log_errors=0 -d html_errors=0 -d track_errors=1 -d
report_memleaks=1 -d report_zend_debug=0 -d
docref_root=/phpmanual/ -d docref_ext=.html -d
error_prepend_string= -d error_append_string= -d
auto_prepend_file= -d auto_append_file= -d magic_quotes_runtime=0
testsuite/tests/run-test/test005.php

Why the testcase is expecting 4095 as I could not find any --INI section
inside the testcase that sets this value to 4095?

With regards
Kamesh Jayachandran

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



Re: [PHP-DEV] [PATCH] tests/classes/factory_and_singleton_010.phpt

2004-07-26 Thread Kamesh Jayachandran
Hello Marcus,
I am attaching my test log file after adding echo *\n; as the first
executable statment.

With regards
Kamesh Jayachandran
On Sun, 25 Jul 2004 08:21:38 +0200, Marcus Boerger [EMAIL PROTECTED]
said:
 Hello Kamesh,
 
 Saturday, July 24, 2004, 6:10:56 PM, you wrote:
 
  Hello Marcus,
  On Thu, 22 Jul 2004 20:47:31 +0200, Marcus Boerger [EMAIL PROTECTED]
  said:
  Hello Kamesh,
  
   can you adapt you test files to ouput a single line before the actual
  script starts by using 'echo *\n;' for example and see if you get
  a blank line in the output then?
  
  I did not get what you mean by this.
  Do you want me to go to each test case and add echo '\n'; as the first
  executable statement?
 
 yes but echo *\n would be easier to track
 
  How it will help?
 
 It won't help i simply want to see what you get then.
 
 regards
 marcus
 
 


factory_and_singleton_009.log
Description: application/unknown
-- 
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP-DEV] [PATCH] tests/classes/factory_and_singleton_010.phpt

2004-07-24 Thread Kamesh Jayachandran
Hello Marcus,
On Thu, 22 Jul 2004 20:47:31 +0200, Marcus Boerger [EMAIL PROTECTED]
said:
 Hello Kamesh,
 
  can you adapt you test files to ouput a single line before the actual
 script starts by using 'echo *\n;' for example and see if you get
 a blank line in the output then?
 
I did not get what you mean by this.
Do you want me to go to each test case and add echo '\n'; as the first
executable statement?
How it will help?

With regards
Kamesh Jayachandran
 I checked all testfiles again and they all PASS for me pretty fine. And
 in all the qa reports we got so far there was never such a problem as you
 mentioned.
 
 regards
 marcus
  
 Thursday, July 22, 2004, 9:25:19 AM, you wrote:
 
  Hi All,
  I had the tests/classes/factory_and_singleton_010.phpt testcase failing
  in Linux, NetWare, Windows ports of PHP.
  And found that this failure is due to one extra line.
 
  Attached the patch.
 
  With regards
  Kamesh Jayachandran 
 
 
 
 -- 
 Best regards,
  Marcusmailto:[EMAIL PROTECTED]
 

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



  1   2   >