Bug #40479 [Com]: zend_mm_heap corrupted

2010-09-16 Thread michael202 at gmx dot de
Edit report at http://bugs.php.net/bug.php?id=40479&edit=1

 ID: 40479
 Comment by: michael202 at gmx dot de
 Reported by:rrossi at maggioli dot it
 Summary:zend_mm_heap corrupted
 Status: No Feedback
 Type:   Bug
 Package:Reproducible crash
 Operating System:   Suse Linux 9.0
 PHP Version:5.2.1
 Block user comment: N

 New Comment:

The problem is still in 5.3.3 on Suse 11.2, but it is not reproducible
:-(

Sometimes it is twice a day sometimes every few days.



Apache starts giving these messages:

"child pid x exit signal Segmentation fault (11)"

And if your are lucky, the scripts still return xml-results.

If you get a no result from the script (i.a. white page in browser),

you'll need a apache stop and start (graceful does not help)

and the error_log says:

"seg fault or similar nasty error detected in the parent process"


Previous Comments:

[2010-08-09 10:32:10] sht dot alien at gmx dot net

I had it coming when I started my unittests. But it happened out of
nowhere ^^

Wehen I set USE_ZEND_ALLOC=0 it didn't go away, but instead I got a
debug backtrace (as seen below). But I came up with a solution:
ZendDebugger was the root of all evil. I'll check out if there's a newer
version available...



FAILURES!

Tests: 284, Assertions: 1911, Errors: 4, Incomplete: 10, Skipped: 9.

*** glibc detected *** /usr/local/zend/bin/php: free(): invalid pointer:
0x035b5a8f ***

=== Backtrace: =

/lib/libc.so.6(+0x775b6)[0x7f56f13105b6]

/lib/libc.so.6(cfree+0x73)[0x7f56f1316e53]

/usr/local/zend/bin/php(zend_hash_destroy+0x7b)[0x656b7b]

/usr/local/zend/bin/php(destroy_zend_class+0x55)[0x641845]

/usr/local/zend/bin/php[0x656822]

/usr/local/zend/bin/php(zend_hash_reverse_apply+0x59)[0x656929]

/usr/local/zend/bin/php[0x63e486]

/usr/local/zend/bin/php[0x64a8b2]

/usr/local/zend/bin/php(php_request_shutdown+0x1ae)[0x5f9cce]

/usr/local/zend/bin/php[0x6d2be4]

/lib/libc.so.6(__libc_start_main+0xfd)[0x7f56f12b7c4d]

/usr/local/zend/bin/php[0x45ffaa]

=== Memory map: 

0040-009d8000 r-xp  08:01 12588460  
/usr/local/zend/bin/php

00ad8000-00b5f000 rwxp 005d8000 08:01 12588460  
/usr/local/zend/bin/php

00b5f000-00b7f000 rwxp  00:00 0 

02b4e000-04999000 rwxp  00:00 0 
[heap]

7f56e000-7f56e0021000 rwxp  00:00 0 

7f56e0021000-7f56e400 ---p  00:00 0 

7f56e5309000-7f56e530e000 r-xp  08:01 15842 
/lib/libnss_dns-2.11.1.so

7f56e530e000-7f56e550d000 ---p 5000 08:01 15842 
/lib/libnss_dns-2.11.1.so

7f56e550d000-7f56e550e000 r-xp 4000 08:01 15842 
/lib/libnss_dns-2.11.1.so

7f56e550e000-7f56e550f000 rwxp 5000 08:01 15842 
/lib/libnss_dns-2.11.1.so

7f56e550f000-7f56e5511000 r-xp  08:01 41397 
/lib/libnss_mdns4_minimal.so.2

7f56e5511000-7f56e571 ---p 2000 08:01 41397 
/lib/libnss_mdns4_minimal.so.2

7f56e571-7f56e5711000 r-xp 1000 08:01 41397 
/lib/libnss_mdns4_minimal.so.2

7f56e5711000-7f56e5712000 rwxp 2000 08:01 41397 
/lib/libnss_mdns4_minimal.so.2

7f56e5712000-7f56e5714000 rwxp  00:00 0 

7f56e5794000-7f56e58f7000 r-xp  08:01 12582939  
/usr/local/zend/lib/debugger/php-5.3.x/ZendDebugger.so

7f56e58f7000-7f56e59f7000 ---p 00163000 08:01 12582939  
/usr/local/zend/lib/debugger/php-5.3.x/ZendDebugger.so

7f56e59f7000-7f56e5a21000 rwxp 00163000 08:01 12582939  
/usr/local/zend/lib/debugger/php-5.3.x/ZendDebugger.so

7f56e5a21000-7f56e5a27000 rwxp  00:00 0 

7f56e5a27000-7f56e5a69000 r-xp  08:01 12583569  
/usr/local/zend/lib/optimizerplus/php-5.3.x/ZendOptimizerPlus.so

7f56e5a69000-7f56e5b69000 ---p 00042000 08:01 12583569  
/usr/local/zend/lib/optimizerplus/php-5.3.x/ZendOptimizerPlus.so

7f56e5b69000-7f56e5b6b000 rwxp 00042000 08:01 12583569  
/usr/local/zend/lib/optimizerplus/php-5.3.x/ZendOptimizerPlus.so

7f56e5b6b000-7f56e5b76000 rwxp  00:00 0 

7f56e5b76000-7f56e5cd3000 r-xp  08:01 12583576  
/usr/local/zend/lib/utils/php-5.3.x/ZendUtils.so

7f56e5cd3000-7f56e5dd3000 ---p 0015d000 08:01 12583576  
/usr/local/zend/lib/utils/php-5.3.x/ZendUtils.so

7f56e5dd3000-7f56e5ddb000 rwxp 0015d000 08:01 12583576  
/usr/local/zend/lib/utils/php-5.3.x/ZendUtils.so

7f56e5ddb000-7f56e5dde000 rwxp  00:00 0 

7f56e5dde000-7f56e5f5 r-xp  08:01 12583528  
/usr/local/zend/lib/datacache/php-5.3.x/ZendDataCache.so

7f56e5f500

Req #32100 [Com]: Request 'finally' support for exceptions

2010-09-07 Thread michael202 at gmx dot de
Edit report at http://bugs.php.net/bug.php?id=32100&edit=1

 ID: 32100
 Comment by: michael202 at gmx dot de
 Reported by:ceefour at gauldong dot net
 Summary:Request 'finally' support for exceptions
 Status: Closed
 Type:   Feature/Change Request
 Package:Feature/Change Request
 Operating System:   *
 PHP Version:5.*
 Block user comment: N

 New Comment:

I also think that try-finally is useful.

try catch is no elegant replacement. 

Just needed it today again.

finally is more elegant than an other solution.



For example:



try {

  lots o' code

  if a return

  ..

  if b exit

  ..

} finally

  do somethin

}



Another solution to the "finally" problem is to use goto.

Not so elegant but not a bad thing according to Knuth.


Previous Comments:

[2010-08-16 12:42:11] torsten dot landmann at bauermedia dot com

I also agree: 'finally' is needed. I really don't get why it has been
left out.



There is no elegant equivalent, especially so since rethrowing the
exception alters file and line number saved in the exception, so later
it's hard to find out where it originally came from.



Please offer "finally". Don't worry, nobody will be forced to use it.

I definitely will.



thuejk showed very well how 'finally' helps with keeping your code
clean. Or vice versa: How the absence of it often causes the need to
copy and paste code (which is always a bad development pattern).


[2010-06-27 00:59:16] thuejk at gmail dot com

>We've had long discussions and came to the only conclusion that we
don't need 

that, for more search the mailing list archieves.



Where is that discussion? I haven't been able to find it. Only people
saying 

that finally is utterly useless, without showing any signs that they
have 

actually considered finally's uses.



As the other comments have said, sometimes some code inside a try will
allocate 

a non-php ressource which need to be deallocated whether or not an
exception is 

thrown. To avoid writing that code twice, you need it in finally.



Version without finally:



try {

   allocate non-php resource

} catch ($ex) {

   deallocate non-php resource

   throw $ex;

}

deallocate non-php resource



Version with finally:



try {

   allocate non-php resource

} finally {

   deallocate non-php resource

}



The finally code is obviously "better". And it is a completely
reasonable way to 

code.



Sure you can emulate finally with more code, but so can a Turin Machine.
finally 

is syntactic sugar which makes it easier to write maintainable programs.


[2010-06-16 20:54:10] orlandu96 at gmail dot com

are there any updates on this issue?


[2010-03-31 12:40:17] a dot e at inne dot pl

Could finally also mean that 'returns' will be executed after the
finally block



try{

   some ifs

   ...

   return x

   ...

   more ifs

   ...

   throw

   ... 

   return y

}catch{

   handle exceptions

}finally{

   No matter if there was exception or not

   execute this bit before you leave the method.

   For example if object has some state it might be necessary to 

   make sure its consistent at the end

}



In the case i have now at work i had to add method call before every
return and throw to make sure that my data will be set properly before
method ends.



Would that be a feature someone might like?



thanks



art


[2005-02-25 20:27:50] ceefour at gauldong dot net

I don't think the code is absolutely equivalent. And omitting the
rethrow statement gives up the whole notion of 'finally'.



Actually my code was trying to *emulate* finally. But it's not the right
thing to do. Finally should not even touch the Exception at all...
Finally doesn't even know there is an exception.



I have to agree that 'finally' is not _required_ by PHP, but not by
'we'. 'We' in this sense refers to 'all PHP developers' and that
includes me, and I _need_ (although not _require_) this functionality.
Almost the same as namespaces don't have to be in PHP but some people
feel the need for it. However namespaces are much harder to implement
yet I think finally is relatively straightforward since we can already
emulate it using try/catch, but with the quirks.



I don't think finally is a control flow block. By emulating finally
using try/catch, yes maybe, but we have no other choice. Finally is not
a control flow because why..? Finally has no idea wheth

#42096 [NoF->Opn]: is_dir() truncates dirs when using UNC paths

2009-11-27 Thread michael202 at gmx dot de
 ID:   42096
 User updated by:  michael202 at gmx dot de
 Reported By:  michael202 at gmx dot de
-Status:   No Feedback
+Status:   Open
 Bug Type: Streams related
 Operating System: Windows only
 PHP Version:  5.2CVS-2007-07-24
 New Comment:

First I gave up on this issue and switched to drive letters.
Now I tested php 5.3.1 and this bug is fixed !

It must have been an issue with php, because:

I have two parallel installations of php (5.2.6 and 5.3.1) on the same
computer.
If I switch between these I can produce the bug with 5.2.6 and I don't
have it with 5.3.1.

Again: for each access to a file with a UNC path, something truncates
the last character of the share name (here import -> impor) resulting in
hundreds of these error messages (/var/log/samba/log.smbd):

[2009/11/27 18:07:44, 0] smbd/service.c:make_connection(794)
  pro (1.2.7.1) couldn't find service impor

AND resulting in a very high load and a server hard reset.

Thanks !


Previous Comments:


[2007-09-08 01:00:01] php-bugs at lists dot php dot net

No feedback was provided for this bug for over a week, so it is
being suspended automatically. If you are able to provide the
information that was originally requested, please do so and change
the status of the bug back to "Open".



[2007-08-31 10:04:20] j...@php.net

As is_dir() uses stat to check whether passed path is directory or not
I doubt this can really be any PHP bug, just another limitiation of
Windows. Try doing the same using something else than PHP and I bet the
result is the same.

And this is totally bogus: echo(is_dir($p) . "\n");
Proto for the function http://php.net/is_dir is:

bool is_dir ( string $filename )

"Returns TRUE if the filename exists and is a directory, FALSE 
otherwise."

------------

[2007-08-08 09:09:04] michael202 at gmx dot de

running a script that makes a few thousand accesses to a samba server
(that is used by approx. 30 other hosts) causes this server to "crash"
and dismount the samba share.

--------------------

[2007-07-25 14:43:22] michael202 at gmx dot de

tested with php5.2-win32-latest.zip
from today morning 2007-07-25 08h08

error is still in there

--------------------

[2007-07-25 08:48:13] michael202 at gmx dot de

Description:

calling is_dir() with an UNC path truncates each part of the path. The
last character is missing.

This results in unnecessary errors (on the host side) and slowdowns (on
client side).


Reproduce code:
---
windows only (php 5.2.3, Windows XP with cmd.exe) and linux host.

 STATUS_BAD_NETWORK_NAME
FindFirst2, Pattern: \dir

these are in /var/log/messages in 'hostA'
  ... smbd/service.c:make_connection(252)
  ... couldn't find service volume




I think this is another problem with tsrm_virtual_cwd.c where around
line 500 state_cwd_length is set to 2 if a slash is found at the
beginning. Perhaps the existence of UNC paths is not checked for.






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



#48511 [Com]: libxml_get_errors() returns an empty array but libxml_get_last_error() doesn't

2009-08-21 Thread michael202 at gmx dot de
 ID:   48511
 Comment by:   michael202 at gmx dot de
 Reported By:  geoffers+phpbugs at gmail dot com
 Status:   Assigned
 Bug Type: XML Writer
 Operating System: Mac OS 10.5.7
 PHP Version:  5.3CVS-2009-06-09 (CVS)
 Assigned To:  rrichards
 New Comment:

Oh I forgot to mention that the error is present in the release version
of php 5.3:
PHP 5.3.0 (cli) (built: Jul 29 2009 15:03:42)


Previous Comments:


[2009-08-21 09:37:18] michael202 at gmx dot de

I have a similar problem:

libxml_get_errors() is empty after loading a faulty XML with
simplexml_load_file() BUT libxml_get_last_error() contains the last
error:
var_dump(libxml_get_errors()) > array(0) { }
var_dump(libxml_get_last_error()) > object(LibXMLError)#11 



"solution" is to use libxml_use_internal_errors:

libxml_clear_errors(); // otherwise you also get all of the old errors
libxml_use_internal_errors(true);

other advantage is the you do not get any PHP Warning outputs and you
can call simplexml_load_file without the @-operator


strange though:
simplexml_load_file() displays the correct error position in the "PHP
Warning" BUT libxml_get_errors() does not contain it.



[2009-06-09 17:49:07] geoffers+phpbugs at gmail dot com

Description:

I would expect the last member of the array returned by
libxml_get_errors() to be equal to libxml_get_last_error(), but the
former returns an empty array while the latter returns the expected
error object.

Reproduce code:
---
openMemory();
$foo->startElement("\xEF\xBF\xBF");
var_dump(libxml_get_last_error());
var_dump(libxml_get_errors());
var_dump(libxml_get_last_error() == end(libxml_get_errors()));

Expected result:

Warning: XMLWriter::startElement(): Char 0x out of allowed range in
/Users/gsnedders/Desktop/test.php on line 5

Warning: XMLWriter::startElement(): Invalid Element Name in
/Users/gsnedders/Desktop/test.php on line 5
object(LibXMLError)#2 (6) {
  ["level"]=>
  int(3)
  ["code"]=>
  int(9)
  ["column"]=>
  int(0)
  ["message"]=>
  string(33) "Char 0x out of allowed range
"
  ["file"]=>
  string(0) ""
  ["line"]=>
  int(0)
}
array(1) {
  [0]=>
  object(LibXMLError)#2 (6) {
["level"]=>
int(3)
["code"]=>
int(9)
["column"]=>
int(0)
["message"]=>
string(33) "Char 0x out of allowed range
"
["file"]=>
string(0) ""
["line"]=>
int(0)
  }
}
bool(true)

Actual result:
--
Warning: XMLWriter::startElement(): Char 0x out of allowed range in
/Users/gsnedders/Desktop/test.php on line 5

Warning: XMLWriter::startElement(): Invalid Element Name in
/Users/gsnedders/Desktop/test.php on line 5
object(LibXMLError)#2 (6) {
  ["level"]=>
  int(3)
  ["code"]=>
  int(9)
  ["column"]=>
  int(0)
  ["message"]=>
  string(33) "Char 0x out of allowed range
"
  ["file"]=>
  string(0) ""
  ["line"]=>
  int(0)
}
array(0) {
}
bool(false)





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



#48511 [Com]: libxml_get_errors() returns an empty array but libxml_get_last_error() doesn't

2009-08-21 Thread michael202 at gmx dot de
 ID:   48511
 Comment by:   michael202 at gmx dot de
 Reported By:  geoffers+phpbugs at gmail dot com
 Status:   Assigned
 Bug Type: XML Writer
 Operating System: Mac OS 10.5.7
 PHP Version:  5.3CVS-2009-06-09 (CVS)
 Assigned To:  rrichards
 New Comment:

I have a similar problem:

libxml_get_errors() is empty after loading a faulty XML with
simplexml_load_file() BUT libxml_get_last_error() contains the last
error:
var_dump(libxml_get_errors()) > array(0) { }
var_dump(libxml_get_last_error()) > object(LibXMLError)#11 



"solution" is to use libxml_use_internal_errors:

libxml_clear_errors(); // otherwise you also get all of the old errors
libxml_use_internal_errors(true);

other advantage is the you do not get any PHP Warning outputs and you
can call simplexml_load_file without the @-operator


strange though:
simplexml_load_file() displays the correct error position in the "PHP
Warning" BUT libxml_get_errors() does not contain it.


Previous Comments:


[2009-06-09 17:49:07] geoffers+phpbugs at gmail dot com

Description:

I would expect the last member of the array returned by
libxml_get_errors() to be equal to libxml_get_last_error(), but the
former returns an empty array while the latter returns the expected
error object.

Reproduce code:
---
openMemory();
$foo->startElement("\xEF\xBF\xBF");
var_dump(libxml_get_last_error());
var_dump(libxml_get_errors());
var_dump(libxml_get_last_error() == end(libxml_get_errors()));

Expected result:

Warning: XMLWriter::startElement(): Char 0x out of allowed range in
/Users/gsnedders/Desktop/test.php on line 5

Warning: XMLWriter::startElement(): Invalid Element Name in
/Users/gsnedders/Desktop/test.php on line 5
object(LibXMLError)#2 (6) {
  ["level"]=>
  int(3)
  ["code"]=>
  int(9)
  ["column"]=>
  int(0)
  ["message"]=>
  string(33) "Char 0x out of allowed range
"
  ["file"]=>
  string(0) ""
  ["line"]=>
  int(0)
}
array(1) {
  [0]=>
  object(LibXMLError)#2 (6) {
["level"]=>
int(3)
["code"]=>
int(9)
["column"]=>
int(0)
["message"]=>
string(33) "Char 0x out of allowed range
"
["file"]=>
string(0) ""
["line"]=>
int(0)
  }
}
bool(true)

Actual result:
--
Warning: XMLWriter::startElement(): Char 0x out of allowed range in
/Users/gsnedders/Desktop/test.php on line 5

Warning: XMLWriter::startElement(): Invalid Element Name in
/Users/gsnedders/Desktop/test.php on line 5
object(LibXMLError)#2 (6) {
  ["level"]=>
  int(3)
  ["code"]=>
  int(9)
  ["column"]=>
  int(0)
  ["message"]=>
  string(33) "Char 0x out of allowed range
"
  ["file"]=>
  string(0) ""
  ["line"]=>
  int(0)
}
array(0) {
}
bool(false)





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



#49108 [NEW]: 2nd scan_dir produces seg fault

2009-07-30 Thread michael202 at gmx dot de
From: michael202 at gmx dot de
Operating system: Suse Linux
PHP version:  5.3.0
PHP Bug Type: Reproducible crash
Bug description:  2nd scan_dir produces seg fault

Description:

the second call to scandir() crashes the script with a "Segmentation
fault".



Reproduce code:
---
ftp://anonymous:anonym...@mirrors.kernel.org/suse/';

$f = scandir($dir1 . 'i386/');
echo count($f) . "\n";


$f = scandir($dir1 . 'noarch/');
echo count($f) . "\n";



Expected result:

# php php_scandir_segfault.php
5
1



Actual result:
--
# php php_scandir_segfault.php
5
Segmentation fault


-- 
Edit bug report at http://bugs.php.net/?id=49108&edit=1
-- 
Try a snapshot (PHP 5.2):
http://bugs.php.net/fix.php?id=49108&r=trysnapshot52
Try a snapshot (PHP 5.3):
http://bugs.php.net/fix.php?id=49108&r=trysnapshot53
Try a snapshot (PHP 6.0):
http://bugs.php.net/fix.php?id=49108&r=trysnapshot60
Fixed in SVN:
http://bugs.php.net/fix.php?id=49108&r=fixed
Fixed in SVN and need be documented: 
http://bugs.php.net/fix.php?id=49108&r=needdocs
Fixed in release:
http://bugs.php.net/fix.php?id=49108&r=alreadyfixed
Need backtrace:  
http://bugs.php.net/fix.php?id=49108&r=needtrace
Need Reproduce Script:   
http://bugs.php.net/fix.php?id=49108&r=needscript
Try newer version:   
http://bugs.php.net/fix.php?id=49108&r=oldversion
Not developer issue: 
http://bugs.php.net/fix.php?id=49108&r=support
Expected behavior:   
http://bugs.php.net/fix.php?id=49108&r=notwrong
Not enough info: 
http://bugs.php.net/fix.php?id=49108&r=notenoughinfo
Submitted twice: 
http://bugs.php.net/fix.php?id=49108&r=submittedtwice
register_globals:
http://bugs.php.net/fix.php?id=49108&r=globals
PHP 4 support discontinued:  http://bugs.php.net/fix.php?id=49108&r=php4
Daylight Savings:http://bugs.php.net/fix.php?id=49108&r=dst
IIS Stability:   
http://bugs.php.net/fix.php?id=49108&r=isapi
Install GNU Sed: 
http://bugs.php.net/fix.php?id=49108&r=gnused
Floating point limitations:  
http://bugs.php.net/fix.php?id=49108&r=float
No Zend Extensions:  
http://bugs.php.net/fix.php?id=49108&r=nozend
MySQL Configuration Error:   
http://bugs.php.net/fix.php?id=49108&r=mysqlcfg



#44014 [NEW]: mb_convert_encoding 'destroys' first character (UTF16->UTF8)

2008-02-01 Thread michael202 at gmx dot de
From: michael202 at gmx dot de
Operating system: Win XP
PHP version:  5.2.5
PHP Bug Type: mbstring related
Bug description:  mb_convert_encoding 'destroys' first character (UTF16->UTF8)

Description:

mb_convert_encoding 'destroys' first character when
converting from UTF16 to UTF8

(iconv works).

Reproduce code:
---
$utf16 = chr(0xFF).chr(0xFE).chr(0x4d).chr(0).chr(0x6f).chr(0); //'Mo'

$utf8 = mb_convert_encoding($utf16, 'UTF-8', 'UTF-16');  

echo($utf8 . "\n"); // -> ´++´¢ìo

$utf8 = iconv('UTF-16', 'UTF-8', $utf16);  

echo($utf8 . "\n"); // -> Mo 


Expected result:

mb:(BOM8)Mo
iconv: Mo

(BOM8) is a placeholder

Actual result:
--
mb:(BOM8)´¢ìo  (copied from cmd shell)
iconv: Mo

(BOM8) is a placeholder



-- 
Edit bug report at http://bugs.php.net/?id=44014&edit=1
-- 
Try a CVS snapshot (PHP 4.4): 
http://bugs.php.net/fix.php?id=44014&r=trysnapshot44
Try a CVS snapshot (PHP 5.2): 
http://bugs.php.net/fix.php?id=44014&r=trysnapshot52
Try a CVS snapshot (PHP 5.3): 
http://bugs.php.net/fix.php?id=44014&r=trysnapshot53
Try a CVS snapshot (PHP 6.0): 
http://bugs.php.net/fix.php?id=44014&r=trysnapshot60
Fixed in CVS: http://bugs.php.net/fix.php?id=44014&r=fixedcvs
Fixed in release: 
http://bugs.php.net/fix.php?id=44014&r=alreadyfixed
Need backtrace:   http://bugs.php.net/fix.php?id=44014&r=needtrace
Need Reproduce Script:http://bugs.php.net/fix.php?id=44014&r=needscript
Try newer version:http://bugs.php.net/fix.php?id=44014&r=oldversion
Not developer issue:  http://bugs.php.net/fix.php?id=44014&r=support
Expected behavior:http://bugs.php.net/fix.php?id=44014&r=notwrong
Not enough info:  
http://bugs.php.net/fix.php?id=44014&r=notenoughinfo
Submitted twice:  
http://bugs.php.net/fix.php?id=44014&r=submittedtwice
register_globals: http://bugs.php.net/fix.php?id=44014&r=globals
PHP 3 support discontinued:   http://bugs.php.net/fix.php?id=44014&r=php3
Daylight Savings: http://bugs.php.net/fix.php?id=44014&r=dst
IIS Stability:http://bugs.php.net/fix.php?id=44014&r=isapi
Install GNU Sed:  http://bugs.php.net/fix.php?id=44014&r=gnused
Floating point limitations:   http://bugs.php.net/fix.php?id=44014&r=float
No Zend Extensions:   http://bugs.php.net/fix.php?id=44014&r=nozend
MySQL Configuration Error:http://bugs.php.net/fix.php?id=44014&r=mysqlcfg


#42096 [Opn]: is_dir() truncates dirs when using UNC paths

2007-08-08 Thread michael202 at gmx dot de
 ID:   42096
 User updated by:  michael202 at gmx dot de
 Reported By:  michael202 at gmx dot de
 Status:   Open
 Bug Type: Streams related
 Operating System: Windows only
 PHP Version:  5.2CVS-2007-07-24
 New Comment:

running a script that makes a few thousand accesses to a samba server
(that is used by approx. 30 other hosts) causes this server to "crash"
and dismount the samba share.


Previous Comments:


[2007-07-25 17:01:20] thinktank2002 at netcologne dot de

I can confirm this behavior. Tested with PHP 5.2.0 on Windows XP. And
the bug appears not only when using is_dir, it appears also using
is_file.

To make it clear: both functions are working well. But they produce
network errors. 

I used this code:

$path = 'Ralf\\postbox\\Public\\xy\\';
if ( is_dir( $path ) ) {
echo 'found';
}

You can see it well using wireshark. Extract:

Tree Connect AndX Request, Path: \\RALF\IPC$
Tree Connect AndX Response

Tree Connect AndX Request, Path: \\RALF\POSTBO
Tree Connect AndX Response, Error: STATUS_BAD_NETWORK_NAME

Trans2 Request, QUERY_PATH_INFO, Query File Basic Info, Path: 
Trans2 Response, QUERY_PATH_INFO

Trans2 Request, FIND_FIRST2, Pattern: \Public
Trans2 Response, FIND_FIRST2, Files: Public

Trans2 Request, QUERY_PATH_INFO, Query File Basic Info, Path: \Public
Trans2 Response, QUERY_PATH_INFO

and so on...

----

[2007-07-25 14:43:22] michael202 at gmx dot de

tested with php5.2-win32-latest.zip
from today morning 2007-07-25 08h08

error is still in there

----

[2007-07-25 08:48:13] michael202 at gmx dot de

Description:

calling is_dir() with an UNC path truncates each part of the path. The
last character is missing.

This results in unnecessary errors (on the host side) and slowdowns (on
client side).


Reproduce code:
---
windows only (php 5.2.3, Windows XP with cmd.exe) and linux host.

 STATUS_BAD_NETWORK_NAME
FindFirst2, Pattern: \dir

these are in /var/log/messages in 'hostA'
  ... smbd/service.c:make_connection(252)
  ... couldn't find service volume




I think this is another problem with tsrm_virtual_cwd.c where around
line 500 state_cwd_length is set to 2 if a slash is found at the
beginning. Perhaps the existence of UNC paths is not checked for.






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


#42096 [Fbk->Opn]: is_dir() truncates dirs when using UNC paths

2007-07-25 Thread michael202 at gmx dot de
 ID:   42096
 User updated by:  michael202 at gmx dot de
 Reported By:  michael202 at gmx dot de
-Status:   Feedback
+Status:   Open
 Bug Type: Streams related
 Operating System: Windows only
 PHP Version:  5.2.3
 New Comment:

tested with php5.2-win32-latest.zip
from today morning 2007-07-25 08h08

error is still in there


Previous Comments:


[2007-07-25 11:56:38] [EMAIL PROTECTED]

Please try using this CVS snapshot:

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

For Windows (installer):

  http://snaps.php.net/win32/php5.2-win32-installer-latest.msi

Some fixes regarding this and other issue alike where fixed recently.



[2007-07-25 08:48:13] michael202 at gmx dot de

Description:

calling is_dir() with an UNC path truncates each part of the path. The
last character is missing.

This results in unnecessary errors (on the host side) and slowdowns (on
client side).


Reproduce code:
---
windows only (php 5.2.3, Windows XP with cmd.exe) and linux host.

 STATUS_BAD_NETWORK_NAME
FindFirst2, Pattern: \dir

these are in /var/log/messages in 'hostA'
  ... smbd/service.c:make_connection(252)
  ... couldn't find service volume




I think this is another problem with tsrm_virtual_cwd.c where around
line 500 state_cwd_length is set to 2 if a slash is found at the
beginning. Perhaps the existence of UNC paths is not checked for.






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


#42096 [NEW]: is_dir() truncates dirs when using UNC paths

2007-07-25 Thread michael202 at gmx dot de
From: michael202 at gmx dot de
Operating system: Windows only
PHP version:  5.2.3
PHP Bug Type: Streams related
Bug description:  is_dir() truncates dirs when using UNC paths

Description:

calling is_dir() with an UNC path truncates each part of the path. The
last character is missing.

This results in unnecessary errors (on the host side) and slowdowns (on
client side).


Reproduce code:
---
windows only (php 5.2.3, Windows XP with cmd.exe) and linux host.

 STATUS_BAD_NETWORK_NAME
FindFirst2, Pattern: \dir

these are in /var/log/messages in 'hostA'
  ... smbd/service.c:make_connection(252)
  ... couldn't find service volume




I think this is another problem with tsrm_virtual_cwd.c where around line
500 state_cwd_length is set to 2 if a slash is found at the beginning.
Perhaps the existence of UNC paths is not checked for.


-- 
Edit bug report at http://bugs.php.net/?id=42096&edit=1
-- 
Try a CVS snapshot (PHP 4.4): 
http://bugs.php.net/fix.php?id=42096&r=trysnapshot44
Try a CVS snapshot (PHP 5.2): 
http://bugs.php.net/fix.php?id=42096&r=trysnapshot52
Try a CVS snapshot (PHP 6.0): 
http://bugs.php.net/fix.php?id=42096&r=trysnapshot60
Fixed in CVS: http://bugs.php.net/fix.php?id=42096&r=fixedcvs
Fixed in release: 
http://bugs.php.net/fix.php?id=42096&r=alreadyfixed
Need backtrace:   http://bugs.php.net/fix.php?id=42096&r=needtrace
Need Reproduce Script:http://bugs.php.net/fix.php?id=42096&r=needscript
Try newer version:http://bugs.php.net/fix.php?id=42096&r=oldversion
Not developer issue:  http://bugs.php.net/fix.php?id=42096&r=support
Expected behavior:http://bugs.php.net/fix.php?id=42096&r=notwrong
Not enough info:  
http://bugs.php.net/fix.php?id=42096&r=notenoughinfo
Submitted twice:  
http://bugs.php.net/fix.php?id=42096&r=submittedtwice
register_globals: http://bugs.php.net/fix.php?id=42096&r=globals
PHP 3 support discontinued:   http://bugs.php.net/fix.php?id=42096&r=php3
Daylight Savings: http://bugs.php.net/fix.php?id=42096&r=dst
IIS Stability:http://bugs.php.net/fix.php?id=42096&r=isapi
Install GNU Sed:  http://bugs.php.net/fix.php?id=42096&r=gnused
Floating point limitations:   http://bugs.php.net/fix.php?id=42096&r=float
No Zend Extensions:   http://bugs.php.net/fix.php?id=42096&r=nozend
MySQL Configuration Error:http://bugs.php.net/fix.php?id=42096&r=mysqlcfg


#36352 [NEW]: writing to max sized file "crashes" php/apache

2006-02-10 Thread michael202 at gmx dot de
From: michael202 at gmx dot de
Operating system: Linux
PHP version:  5.1.2
PHP Bug Type: Reproducible crash
Bug description:  writing to max sized file "crashes" php/apache

Description:

a log-file has reached its maxmimum file size allowed by the 
operation and file system.

Appending further additional byte to this file ends the php and apache
process without any message. Nothing in error_log and console output.

Script procession simply stops.


Reproduce code:
---
  function append_to_file($aFilename, $aData)
  {
clearstatcache();

  $fh = fopen($aFilename, 'a');
  if ($fh === false) {
return (-1);
  }
  $result = fwrite($fh, $aData);
  fclose($fh);

return ($result);
  }


Expected result:

Error Message or Warning and script continues to execute

tested with
php 5.1.2 and 5.0.5


Actual result:
--
script stopped/ended without any notice


-- 
Edit bug report at http://bugs.php.net/?id=36352&edit=1
-- 
Try a CVS snapshot (PHP 4.4): 
http://bugs.php.net/fix.php?id=36352&r=trysnapshot44
Try a CVS snapshot (PHP 5.1): 
http://bugs.php.net/fix.php?id=36352&r=trysnapshot51
Try a CVS snapshot (PHP 6.0): 
http://bugs.php.net/fix.php?id=36352&r=trysnapshot60
Fixed in CVS: http://bugs.php.net/fix.php?id=36352&r=fixedcvs
Fixed in release: 
http://bugs.php.net/fix.php?id=36352&r=alreadyfixed
Need backtrace:   http://bugs.php.net/fix.php?id=36352&r=needtrace
Need Reproduce Script:http://bugs.php.net/fix.php?id=36352&r=needscript
Try newer version:http://bugs.php.net/fix.php?id=36352&r=oldversion
Not developer issue:  http://bugs.php.net/fix.php?id=36352&r=support
Expected behavior:http://bugs.php.net/fix.php?id=36352&r=notwrong
Not enough info:  
http://bugs.php.net/fix.php?id=36352&r=notenoughinfo
Submitted twice:  
http://bugs.php.net/fix.php?id=36352&r=submittedtwice
register_globals: http://bugs.php.net/fix.php?id=36352&r=globals
PHP 3 support discontinued:   http://bugs.php.net/fix.php?id=36352&r=php3
Daylight Savings: http://bugs.php.net/fix.php?id=36352&r=dst
IIS Stability:http://bugs.php.net/fix.php?id=36352&r=isapi
Install GNU Sed:  http://bugs.php.net/fix.php?id=36352&r=gnused
Floating point limitations:   http://bugs.php.net/fix.php?id=36352&r=float
No Zend Extensions:   http://bugs.php.net/fix.php?id=36352&r=nozend
MySQL Configuration Error:http://bugs.php.net/fix.php?id=36352&r=mysqlcfg


#36258 [NEW]: Iterator method getPath crashes Apache

2006-02-02 Thread michael202 at gmx dot de
From: michael202 at gmx dot de
Operating system: Linux
PHP version:  5CVS-2006-02-02 (snap)
PHP Bug Type: Reproducible crash
Bug description:  Iterator method getPath crashes Apache

Description:

when iterating through a dir structure the apache process serving this
script crashes with 'child pid XY exit signal Segmentation fault (11)'
when trying to execute getPath method

Reproduce code:
---
  function test_apache_segfault()
  {
$diriter = new RecursiveIteratorIterator( new
RecursiveDirectoryIterator('.') );

foreach ($diriter as $key => $file) {
  echo($file->getFilename()); flush(); 
  echo(' 1'); flush();

 // 'child pid XY exit signal Segmentation fault (11)'
 echo($file->getPath()); // <-- crash here  
 echo(' 2'); flush();
}  // foreach
   echo(' end'); flush();
  }


Expected result:

a list of more than one entry and
the word 'end' at the end

Actual result:
--
output ends after the 'echo 1'

when commenting out the line with 'getPath' this function runs till the
end.

checked this with 
- apache 2.0.53 and php 5.0.4  both compiled by myself
- apache 2.2.0 and php 5.1.2  both compiled by myself
- apache 2.2.0 and php 5.1.3-dev (2006-02-02 snap)  both compiled by
myself

-- 
Edit bug report at http://bugs.php.net/?id=36258&edit=1
-- 
Try a CVS snapshot (PHP 4.4): 
http://bugs.php.net/fix.php?id=36258&r=trysnapshot44
Try a CVS snapshot (PHP 5.1): 
http://bugs.php.net/fix.php?id=36258&r=trysnapshot51
Try a CVS snapshot (PHP 6.0): 
http://bugs.php.net/fix.php?id=36258&r=trysnapshot60
Fixed in CVS: http://bugs.php.net/fix.php?id=36258&r=fixedcvs
Fixed in release: 
http://bugs.php.net/fix.php?id=36258&r=alreadyfixed
Need backtrace:   http://bugs.php.net/fix.php?id=36258&r=needtrace
Need Reproduce Script:http://bugs.php.net/fix.php?id=36258&r=needscript
Try newer version:http://bugs.php.net/fix.php?id=36258&r=oldversion
Not developer issue:  http://bugs.php.net/fix.php?id=36258&r=support
Expected behavior:http://bugs.php.net/fix.php?id=36258&r=notwrong
Not enough info:  
http://bugs.php.net/fix.php?id=36258&r=notenoughinfo
Submitted twice:  
http://bugs.php.net/fix.php?id=36258&r=submittedtwice
register_globals: http://bugs.php.net/fix.php?id=36258&r=globals
PHP 3 support discontinued:   http://bugs.php.net/fix.php?id=36258&r=php3
Daylight Savings: http://bugs.php.net/fix.php?id=36258&r=dst
IIS Stability:http://bugs.php.net/fix.php?id=36258&r=isapi
Install GNU Sed:  http://bugs.php.net/fix.php?id=36258&r=gnused
Floating point limitations:   http://bugs.php.net/fix.php?id=36258&r=float
No Zend Extensions:   http://bugs.php.net/fix.php?id=36258&r=nozend
MySQL Configuration Error:http://bugs.php.net/fix.php?id=36258&r=mysqlcfg