#40701 [Com]: Interesting observation

2007-03-27 Thread priyadi at priyadi dot net
 ID:   40701
 Comment by:   priyadi at priyadi dot net
 Reported By:  michaeldaly at magma dot ca
 Status:   Open
 Bug Type: Unknown/Other Function
 Operating System: Win XP Pro
 PHP Version:  5.2.2
 New Comment:

this occurs to me too with PHP 5.2.1 and mediawiki 1.9.3. in my 
case, the error message stays constant: Fatal error: Out of memory 
(allocated 5242880) (tried to allocate 1245184 bytes) in 
*/web/languages/messages/MessagesEn.php on line 2106.

this is on RHEL 3. memory_limit is set to 128M and PHP is using CGI 
API, so I don't think this problem is related to apache.

this works in my development machine though (gentoo, same PHP 
version running as apache module).


Previous Comments:


[2007-03-25 20:19:42] michaeldaly at magma dot ca

While testing a new php program, I inadvertently coded an infinite
loop.  While running it, the thing failed at over 400MB with an
allocation error.  

This shows the config is capable of using lots of memory and the
repeated failures at 0.7MB to 9MB seem anomalous.



[2007-03-21 15:55:02] edwin at aucs dot org

I think I am getting the same problem with
php5.2-win32-200703210430.zip

I am getting PHP Fatal error:  Out of memory (allocated random size)
(tried to allocate random size bytes) after the server started for a
while.

May be this is something related to memory leakage with mysql, as in
Listing 7 of
http://www.ibm.com/developerworks/opensource/library/os-php-v521/ ?



[2007-03-16 16:49:25] michaeldaly at magma dot ca

That version has no effect.  However, I'm not so sure it's any
different than the version I started with - Feb 28 build that included
the early Feb memory fix.



[2007-03-14 11:31:32] [EMAIL PROTECTED]

Please try using this CVS snapshot:

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

A fix for memory manager was applied to CVS recently, it might solve
this issue.



[2007-03-13 04:55:55] michaeldaly at magma dot ca

With memory_limit = -1 there is no change.



The remainder of the comments for this report are too long. To view
the rest of the comments, please view the bug report online at
http://bugs.php.net/40701

-- 
Edit this bug report at http://bugs.php.net/?id=40701edit=1


#40701 [Com]: Interesting observation

2007-03-27 Thread priyadi at priyadi dot net
 ID:   40701
 Comment by:   priyadi at priyadi dot net
 Reported By:  michaeldaly at magma dot ca
 Status:   Open
 Bug Type: Unknown/Other Function
 Operating System: Win XP Pro
 PHP Version:  5.2.2
 New Comment:

I think I found the culprit. In my case it is my ulimits. my 
previous ulimits were (taken from 'ulimit -a'):

core file size (blocks, -c) 0
data seg size (kbytes, -d) 20480
file size (blocks, -f) unlimited
max locked memory (kbytes, -l) 4
max memory size (kbytes, -m) unlimited
open files (-n) 1024
pipe size (512 bytes, -p) 8
stack size (kbytes, -s) 10240
cpu time (seconds, -t) 60
max user processes (-u) 20
virtual memory (kbytes, -v) 20480

now they are:

core file size (blocks, -c) 0
data seg size (kbytes, -d) 204800
file size (blocks, -f) unlimited
max locked memory (kbytes, -l) 4
max memory size (kbytes, -m) unlimited
open files (-n) 1024
pipe size (512 bytes, -p) 8
stack size (kbytes, -s) 10240
cpu time (seconds, -t) 600
max user processes (-u) 200
virtual memory (kbytes, -v) 204800

so, my case is probably not related to this bug, sorry.


Previous Comments:


[2007-03-27 22:35:54] priyadi at priyadi dot net

this occurs to me too with PHP 5.2.1 and mediawiki 1.9.3. in my 
case, the error message stays constant: Fatal error: Out of memory 
(allocated 5242880) (tried to allocate 1245184 bytes) in 
*/web/languages/messages/MessagesEn.php on line 2106.

this is on RHEL 3. memory_limit is set to 128M and PHP is using CGI 
API, so I don't think this problem is related to apache.

this works in my development machine though (gentoo, same PHP 
version running as apache module).



[2007-03-25 20:19:42] michaeldaly at magma dot ca

While testing a new php program, I inadvertently coded an infinite
loop.  While running it, the thing failed at over 400MB with an
allocation error.  

This shows the config is capable of using lots of memory and the
repeated failures at 0.7MB to 9MB seem anomalous.



[2007-03-21 15:55:02] edwin at aucs dot org

I think I am getting the same problem with
php5.2-win32-200703210430.zip

I am getting PHP Fatal error:  Out of memory (allocated random size)
(tried to allocate random size bytes) after the server started for a
while.

May be this is something related to memory leakage with mysql, as in
Listing 7 of
http://www.ibm.com/developerworks/opensource/library/os-php-v521/ ?



[2007-03-16 16:49:25] michaeldaly at magma dot ca

That version has no effect.  However, I'm not so sure it's any
different than the version I started with - Feb 28 build that included
the early Feb memory fix.



[2007-03-14 11:31:32] [EMAIL PROTECTED]

Please try using this CVS snapshot:

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

A fix for memory manager was applied to CVS recently, it might solve
this issue.



The remainder of the comments for this report are too long. To view
the rest of the comments, please view the bug report online at
http://bugs.php.net/40701

-- 
Edit this bug report at http://bugs.php.net/?id=40701edit=1


#21743 [Asn]: Driver initialization failed for handler: db3 (and db2)

2003-02-06 Thread priyadi
 ID:   21743
 User updated by:  [EMAIL PROTECTED]
 Reported By:  [EMAIL PROTECTED]
 Status:   Assigned
 Bug Type: DBM/DBA related
 Operating System: RedHat Linux 7.2
 PHP Version:  4.3.0
 Assigned To:  helly
 New Comment:

Hello, sorry for not responding for so long. I have 
another observation to this elusive problem. 
 
- It fails when using mode 'c' but the file doesn't exist 
already 
- It succeeds when using mode 'n' and the file doesn't 
already exist 
- It succeeds when using mode 'c' and the file exists and 
it is a valid db3 btree 
- It fails when using mode 'c' and the file exists but it 
is not a valid db3 btree 
 
Regarding db4 version, I lost access to the system but I 
think it is version 4.0.14.


Previous Comments:


[2003-01-31 01:28:04] [EMAIL PROTECTED]

Please update: ext/dba/config.m4

This fixes some problems when linking against a specific
library version. If you do not use your systems default
db library you must not include ndbm support since that
is based on db1 which in turn is db-1.85 or based on db-x
where x is 1.85 or x = 2.

I tried the following:
- db-3.2 (not shared) and it works.
- db-4.1.25 (shared/not shared) and it works.
- db-3.3 from system rpm (not shared) and it works.
- db-3.3 from source (shared) and it works

So i will ask sleepycat for known problems and maybe
disable shared dba in case of db-3.2.

I missed to answer your question: db libraries *can*
do file locking but we tell the library not to do so and 
use our own locking.

To unalize your db4 problems: What extact version are you 
using (ldd) and which config (but ldd should be enough).



[2003-01-30 11:38:18] [EMAIL PROTECTED]

I also encountered segfaults with db4 compiled with 
--with-db3=dir but not with db3 supplied by redhat.



[2003-01-29 18:59:10] [EMAIL PROTECTED]

Called my contact at Berkeley and got the link to the 3.2
version. Now i am able to reproduce a segfault...I'll look
into deeper ASAP



[2003-01-26 23:49:22] [EMAIL PROTECTED]

I've tested it with db3-3.3 (RedHat 7.3) and also   
experienced the same result :(. 
 
Older berkeley db sources can be obtained from 
http://rpmfind.net as SRPMSs.  
 
I've also uploaded my binary dba.so to 
http://priyadi.net/php/dba.so if that will help. It is 
compiled with --with-flatfile --with-cdb --with-db3. 
Compiled on a RedHat 7.2 system, and db3-3.2.9.



[2003-01-26 08:01:02] [EMAIL PROTECTED]

I've reconfigured my system with shared dba and db3-3.3
and cannot reproduce you results. Hopefully i can get a
copy of the db-3.2 source distrubution which is no longer
online :-(



The remainder of the comments for this report are too long. To view
the rest of the comments, please view the bug report online at
http://bugs.php.net/21743

-- 
Edit this bug report at http://bugs.php.net/?id=21743edit=1




#21743 [Asn]: Driver initialization failed for handler: db3 (and db2)

2003-01-30 Thread priyadi
 ID:   21743
 User updated by:  [EMAIL PROTECTED]
 Reported By:  [EMAIL PROTECTED]
 Status:   Assigned
 Bug Type: DBM/DBA related
 Operating System: RedHat Linux 7.2
 PHP Version:  4.3.0
 Assigned To:  helly
 New Comment:

I also encountered segfaults with db4 compiled with 
--with-db3=dir but not with db3 supplied by redhat.


Previous Comments:


[2003-01-29 18:59:10] [EMAIL PROTECTED]

Called my contact at Berkeley and got the link to the 3.2
version. Now i am able to reproduce a segfault...I'll look
into deeper ASAP



[2003-01-26 23:49:22] [EMAIL PROTECTED]

I've tested it with db3-3.3 (RedHat 7.3) and also   
experienced the same result :(. 
 
Older berkeley db sources can be obtained from 
http://rpmfind.net as SRPMSs.  
 
I've also uploaded my binary dba.so to 
http://priyadi.net/php/dba.so if that will help. It is 
compiled with --with-flatfile --with-cdb --with-db3. 
Compiled on a RedHat 7.2 system, and db3-3.2.9.



[2003-01-26 08:01:02] [EMAIL PROTECTED]

I've reconfigured my system with shared dba and db3-3.3
and cannot reproduce you results. Hopefully i can get a
copy of the db-3.2 source distrubution which is no longer
online :-(



[2003-01-26 00:21:47] [EMAIL PROTECTED]

 First please try this (note the - after c: 
 ?   
 dl(dba.so);   
 $a = dba_open(test, c-, db3);   
 ?   
 
It is working!

# php 2.php
Content-type: text/html
X-Powered-By: PHP/4.3.0


# ls -al test
-rw-r--r--1 root root 8192 Jan 26 12:34
test
# file test
test: Berkeley DB (Btree, version 8, native byte-order)

 
 Then please try if you can create and open an new file: 
 ?   
 dl(dba.so);   
 $a = dba_open(test2, n-, db3);  
 var_dump($a); 
 dba_close($a); 
 $b = dba_open(test2, r-, db3); 
 var_dump($b); 
 dba_close($b); 
 ?   

It is working...

# php 3.php 
Content-type: text/html
X-Powered-By: PHP/4.3.0

resource(1) of type (dba)
resource(2) of type (dba)


 after that: From your configure script: 
 --enable-dba=shared \   
--with-gdbm \   
--with-db3 \   
--with-cdb=/usr \   
--with-flatfile \  
 
 This means you cannot have db2. 
 
 However you found a problem here: --with-cdb always 
loads 
 the internal cdb support (so thanks here i've fixed 
 this part already in cvs). 

OK, while we are at this, it seems there is another
related problem. --without-db3 (or db2, flatfile, and   
others too) doesn't seem to be working. configure will 
show that db3 will not be included (checking for Berkeley 
DB3 support... no), but it will still be included if it 
finds one on my system, and the resulting binary will not 
be linked to DB3 library as shown by ldd. And 
--without-flatfile (and maybe --without-cdb too) will 
cause undefined symbol error but I think you already know
that :)

 Could you try (with only db3, cdb and flatfile) 
 --enable-dba=shared \   
 --with-db3 \   
 --with-cdb \   
 --with-flatfile \  
 
Doesn't work. :( 
 
 Maybe you could also try db4 or db4.1 versions buy  
 --with-db3=/path/to/db4 for PHP 4.3 or --with-db4 for 
cvs versions.  
 
I'll get back to you later on this after I finally 
finished downloading and compiling (the sql worm thing is 
still wreaking havoc here) 
   
On a side note, ext/dba from PHP 4.2.1 works (phpize'ed),  
maybe because it doesn't have locking? 
 
Oh, is it possible that BerkeleyDB has its own locking 
mechanism that is conflicting with PHP's? Consider this 
scenario: 
- on dba_open, php locks the berkeley db file 
- php then handles opening the db file to berkeley db 
library 
- berkeley db tries to lock the file, but since it is 
already locked by php it will eventually time out 
 
From berkeley db documentation, it seems that it does its 
own locking. 
http://www.sleepycat.com/docs/ref/lock/intro.html



[2003-01-25 14:18:06] [EMAIL PROTECTED]

First please try this (note the - after c:
?  
dl(dba.so);  
$a = dba_open(test, c-, 

#21743 [Opn]: Driver initialization failed for handler: db3 (and db2)

2003-01-26 Thread priyadi
 ID:   21743
 User updated by:  [EMAIL PROTECTED]
 Reported By:  [EMAIL PROTECTED]
 Status:   Open
 Bug Type: DBM/DBA related
 Operating System: RedHat Linux 7.2
 PHP Version:  4.3.0
 Assigned To:  helly
 New Comment:

I've tested it with db3-3.3 (RedHat 7.3) and also   
experienced the same result :(. 
 
Older berkeley db sources can be obtained from 
http://rpmfind.net as SRPMSs.  
 
I've also uploaded my binary dba.so to 
http://priyadi.net/php/dba.so if that will help. It is 
compiled with --with-flatfile --with-cdb --with-db3. 
Compiled on a RedHat 7.2 system, and db3-3.2.9.


Previous Comments:


[2003-01-26 08:01:02] [EMAIL PROTECTED]

I've reconfigured my system with shared dba and db3-3.3
and cannot reproduce you results. Hopefully i can get a
copy of the db-3.2 source distrubution which is no longer
online :-(



[2003-01-26 00:21:47] [EMAIL PROTECTED]

 First please try this (note the - after c: 
 ?   
 dl(dba.so);   
 $a = dba_open(test, c-, db3);   
 ?   
 
It is working!

# php 2.php
Content-type: text/html
X-Powered-By: PHP/4.3.0


# ls -al test
-rw-r--r--1 root root 8192 Jan 26 12:34
test
# file test
test: Berkeley DB (Btree, version 8, native byte-order)

 
 Then please try if you can create and open an new file: 
 ?   
 dl(dba.so);   
 $a = dba_open(test2, n-, db3);  
 var_dump($a); 
 dba_close($a); 
 $b = dba_open(test2, r-, db3); 
 var_dump($b); 
 dba_close($b); 
 ?   

It is working...

# php 3.php 
Content-type: text/html
X-Powered-By: PHP/4.3.0

resource(1) of type (dba)
resource(2) of type (dba)


 after that: From your configure script: 
 --enable-dba=shared \   
--with-gdbm \   
--with-db3 \   
--with-cdb=/usr \   
--with-flatfile \  
 
 This means you cannot have db2. 
 
 However you found a problem here: --with-cdb always 
loads 
 the internal cdb support (so thanks here i've fixed 
 this part already in cvs). 

OK, while we are at this, it seems there is another
related problem. --without-db3 (or db2, flatfile, and   
others too) doesn't seem to be working. configure will 
show that db3 will not be included (checking for Berkeley 
DB3 support... no), but it will still be included if it 
finds one on my system, and the resulting binary will not 
be linked to DB3 library as shown by ldd. And 
--without-flatfile (and maybe --without-cdb too) will 
cause undefined symbol error but I think you already know
that :)

 Could you try (with only db3, cdb and flatfile) 
 --enable-dba=shared \   
 --with-db3 \   
 --with-cdb \   
 --with-flatfile \  
 
Doesn't work. :( 
 
 Maybe you could also try db4 or db4.1 versions buy  
 --with-db3=/path/to/db4 for PHP 4.3 or --with-db4 for 
cvs versions.  
 
I'll get back to you later on this after I finally 
finished downloading and compiling (the sql worm thing is 
still wreaking havoc here) 
   
On a side note, ext/dba from PHP 4.2.1 works (phpize'ed),  
maybe because it doesn't have locking? 
 
Oh, is it possible that BerkeleyDB has its own locking 
mechanism that is conflicting with PHP's? Consider this 
scenario: 
- on dba_open, php locks the berkeley db file 
- php then handles opening the db file to berkeley db 
library 
- berkeley db tries to lock the file, but since it is 
already locked by php it will eventually time out 
 
From berkeley db documentation, it seems that it does its 
own locking. 
http://www.sleepycat.com/docs/ref/lock/intro.html



[2003-01-25 14:18:06] [EMAIL PROTECTED]

First please try this (note the - after c:
?  
dl(dba.so);  
$a = dba_open(test, c-, db3);  
?  

Then please try if you can create and open an new file:
?  
dl(dba.so);  
$a = dba_open(test2, n-, db3); 
var_dump($a);
dba_close($a);
$b = dba_open(test2, r-, db3);
var_dump($b);
dba_close($b);
?  


after that: From your configure script:
--enable-dba=shared \  
--with-gdbm \  
--with-db3 \  
--with-cdb=/usr \  
--with-flatfile \ 

This means you cannot have db2.

However you found a problem here: 

#21743 [Opn]: Driver initialization failed for handler: db3 (and db2)

2003-01-25 Thread priyadi
 ID:   21743
 User updated by:  [EMAIL PROTECTED]
 Reported By:  [EMAIL PROTECTED]
 Status:   Open
 Bug Type: DBM/DBA related
 Operating System: RedHat Linux 7.2
 PHP Version:  4.3.0
 Assigned To:  helly
 New Comment:

 First please try this (note the - after c: 
 ?   
 dl(dba.so);   
 $a = dba_open(test, c-, db3);   
 ?   
 
It is working!

# php 2.php
Content-type: text/html
X-Powered-By: PHP/4.3.0


# ls -al test
-rw-r--r--1 root root 8192 Jan 26 12:34
test
# file test
test: Berkeley DB (Btree, version 8, native byte-order)

 
 Then please try if you can create and open an new file: 
 ?   
 dl(dba.so);   
 $a = dba_open(test2, n-, db3);  
 var_dump($a); 
 dba_close($a); 
 $b = dba_open(test2, r-, db3); 
 var_dump($b); 
 dba_close($b); 
 ?   

It is working...

# php 3.php 
Content-type: text/html
X-Powered-By: PHP/4.3.0

resource(1) of type (dba)
resource(2) of type (dba)


 after that: From your configure script: 
 --enable-dba=shared \   
--with-gdbm \   
--with-db3 \   
--with-cdb=/usr \   
--with-flatfile \  
 
 This means you cannot have db2. 
 
 However you found a problem here: --with-cdb always 
loads 
 the internal cdb support (so thanks here i've fixed 
 this part already in cvs). 

OK, while we are at this, it seems there is another
related problem. --without-db3 (or db2, flatfile, and   
others too) doesn't seem to be working. configure will 
show that db3 will not be included (checking for Berkeley 
DB3 support... no), but it will still be included if it 
finds one on my system, and the resulting binary will not 
be linked to DB3 library as shown by ldd. And 
--without-flatfile (and maybe --without-cdb too) will 
cause undefined symbol error but I think you already know
that :)

 Could you try (with only db3, cdb and flatfile) 
 --enable-dba=shared \   
 --with-db3 \   
 --with-cdb \   
 --with-flatfile \  
 
Doesn't work. :( 
 
 Maybe you could also try db4 or db4.1 versions buy  
 --with-db3=/path/to/db4 for PHP 4.3 or --with-db4 for 
cvs versions.  
 
I'll get back to you later on this after I finally 
finished downloading and compiling (the sql worm thing is 
still wreaking havoc here) 
   
On a side note, ext/dba from PHP 4.2.1 works (phpize'ed),  
maybe because it doesn't have locking? 
 
Oh, is it possible that BerkeleyDB has its own locking 
mechanism that is conflicting with PHP's? Consider this 
scenario: 
- on dba_open, php locks the berkeley db file 
- php then handles opening the db file to berkeley db 
library 
- berkeley db tries to lock the file, but since it is 
already locked by php it will eventually time out 
 
From berkeley db documentation, it seems that it does its 
own locking. 
http://www.sleepycat.com/docs/ref/lock/intro.html


Previous Comments:


[2003-01-25 14:18:06] [EMAIL PROTECTED]

First please try this (note the - after c:
?  
dl(dba.so);  
$a = dba_open(test, c-, db3);  
?  

Then please try if you can create and open an new file:
?  
dl(dba.so);  
$a = dba_open(test2, n-, db3); 
var_dump($a);
dba_close($a);
$b = dba_open(test2, r-, db3);
var_dump($b);
dba_close($b);
?  


after that: From your configure script:
--enable-dba=shared \  
--with-gdbm \  
--with-db3 \  
--with-cdb=/usr \  
--with-flatfile \ 

This means you cannot have db2.

However you found a problem here: --with-cdb always loads
the internal cdb support (so thanks here i've fixed
this part already in cvs).

Could you try (with only db3, cdb and flatfile)
--enable-dba=shared \  
--with-db3 \  
--with-cdb \  
--with-flatfile \ 


Maybe you could also try db4 or db4.1 versions buy 
--with-db3=/path/to/db4 for PHP 4.3 or --with-db4 for cvs versions. 

If this solves the problem then it is gdbm

The zero length test file is created by the locking 
mechanism and after that calls to library should do
the rest but that failed...



[2003-01-19 02:32:50] [EMAIL PROTECTED]

dba_open with dba handler db2 or db3 always failed,   
however it worked with flatfile, gdbm or  cdb_make. I'm