Bug #74923 [NEW]: Crash when crawling through network share
| From: | martin dot keckeis1 at gmail dot com | Date: | Fri, 14 Jul 2017 08:23:59 +0000 |
| Subject: | Bug #74923 [NEW]: Crash when crawling through network share | ||
| Groups: | php.bugs | ||
| Request: | Send a blank email to php-bugs+get-210051@lists.php.net to get a copy of this message | ||
From: martin dot keckeis1 at gmail dot com
Operating system: Windows Server 2012 R2
PHP version: 7.1.7
Package: Filesystem function related
Bug Type: Bug
Bug description:Crash when crawling through network share
Description:
------------
My filesystem crawler can crawl through millions of documents on WIN7,
but on Server 2012 R2 it crashes on too long paths/files (>260 chars).
If the files would be skipped, it wouldn't be that hard problem. But the
script crashes (see actual result), so i cannot continue script
execution.
From the documentation:
> In the Windows API (with some exceptions discussed in the following
paragraphs), the maximum length for a path is MAX_PATH, which is defined
as 260 characters.
> The "\\?\" prefix can also be used with paths constructed according to
the universal naming convention (UNC). To specify such a path using UNC,
use the "\\?\UNC\" prefix.
https://msdn.microsoft.com/en-us/library/windows/desktop/aa365247(v=vs.85).aspx
I tried now that kind of path, but PHP does not support that, so i'm
having no possibility to fix in on the server (or i'm not seeing how i
can do it).
Test script:
---------------
$recIterIter = new \RecursiveDirectoryIterator($this->getPath(),
\RecursiveDirectoryIterator::SKIP_DOTS);
$iterator = new \RecursiveIteratorIterator($recIterIter);
try {
foreach ($iterator as $path => $file) {
/* @var $file \SplFileInfo */
var_dump($file->getPathname());
}
} catch (\UnexpectedValueException $ex) {}
Expected result:
----------------
no crash - at least throw an exception
maybe support the \\?\UNC notation
Actual result:
--------------
Problem signature:
Problem Event Name: APPCRASH
Application Name: php.exe
Application Version: 7.1.7.0
Application Timestamp: 595e6adf
Fault Module Name: StackHash_c66e
Fault Module Version: 6.3.9600.18233
Fault Module Timestamp: 56bb4ebb
Exception Code: c0000374
Exception Offset: PCH_A1_FROM_ntdll+0x0000000000090C6A
OS Version: 6.3.9600.2.0.0.400.8
Locale ID: 5127
Additional Information 1: c66e
Additional Information 2: c66eb003ccb0f321719ea11a2dfd28cb
Additional Information 3: 985f
Additional Information 4: 985ffcf5786fa614c8c9d97a270df159
--
Edit bug report at https://bugs.php.net/bug.php?id=74923&edit=1
--
Try a snapshot (PHP 5.4): https://bugs.php.net/fix.php?id=74923&r=trysnapshot54
Try a snapshot (PHP 5.5): https://bugs.php.net/fix.php?id=74923&r=trysnapshot55
Try a snapshot (trunk): https://bugs.php.net/fix.php?id=74923&r=trysnapshottrunk
Fixed in SVN: https://bugs.php.net/fix.php?id=74923&r=fixed
Fixed in release: https://bugs.php.net/fix.php?id=74923&r=alreadyfixed
Need backtrace: https://bugs.php.net/fix.php?id=74923&r=needtrace
Need Reproduce Script: https://bugs.php.net/fix.php?id=74923&r=needscript
Try newer version: https://bugs.php.net/fix.php?id=74923&r=oldversion
Not developer issue: https://bugs.php.net/fix.php?id=74923&r=support
Expected behavior: https://bugs.php.net/fix.php?id=74923&r=notwrong
Not enough info: https://bugs.php.net/fix.php?id=74923&r=notenoughinfo
Submitted twice: https://bugs.php.net/fix.php?id=74923&r=submittedtwice
register_globals: https://bugs.php.net/fix.php?id=74923&r=globals
PHP 4 support discontinued: https://bugs.php.net/fix.php?id=74923&r=php4
Daylight Savings: https://bugs.php.net/fix.php?id=74923&r=dst
IIS Stability: https://bugs.php.net/fix.php?id=74923&r=isapi
Install GNU Sed: https://bugs.php.net/fix.php?id=74923&r=gnused
Floating point limitations: https://bugs.php.net/fix.php?id=74923&r=float
No Zend Extensions: https://bugs.php.net/fix.php?id=74923&r=nozend
MySQL Configuration Error: https://bugs.php.net/fix.php?id=74923&r=mysqlcfg