Bug #74923 [Opn->Fbk]: Crash when crawling through network share

From: Date: Fri, 14 Jul 2017 08:49:58 +0000
Subject: Bug #74923 [Opn->Fbk]: Crash when crawling through network share
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-210052@lists.php.net to get a copy of this message
Edit report at https://bugs.php.net/bug.php?id=74923&edit=1 ID: 74923 Updated by: ab@php.net Reported by: martin dot keckeis1 at gmail dot com Summary: Crash when crawling through network share -Status: Open +Status: Feedback Type: Bug Package: Filesystem function related Operating System: Windows Server 2012 R2 PHP Version: 7.1.7 Block user comment: N Private report: N New Comment: Thanks for the report. Would it be possible you to post a backtrace or to provide a crash dump? Also, what is the exact PHP package name, in particular is it a thread safe build? Regarding the length - no, the limitation of the path length in 7.1 is 2048 bytes. The specification also tells nothing specific https://msdn.microsoft.com/en-us/library/gg465305.aspx , but the APIs are known to have a limitation of 32k bytes in most cases. Further investigation is needed on this anyway. Direct support of such prefixes is not on the plan ATM. Thanks. Previous Comments: ------------------------------------------------------------------------ [2017-07-14 08:23:50] martin dot keckeis1 at gmail dot com 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 this bug report at https://bugs.php.net/bug.php?id=74923&edit=1

« previous php.bugs (#210052) next »