Boost C++ Libraries: Ticket #12079: Infinite loop in boost:: filesystem::directory_iterator https://svn.boost.org/trac10/ticket/12079 <p> Debian Jessie (GLIBC 2.19) </p> <p> I have an NTFS partition created in Windows. On that partition there is a file with very long filename that contains Cyrillic characters: D:\test\очень_длинное_имя_для_файла_очень_длинное_имя_для_файла_очень_длинное_имя_для_файла_очень_длинное_имя_для_файла_очень_длинное_имя_для_файла_очень_длинное_имя_для_файла_очень_длинное_имя_для_файла_очень_длинное_имя_для_файла_очень_длинное_имя_для_ф.txt </p> <p> I attached this partition to my linux box and mounted it to /media/sk1ff/EEBEDC27BEDBE65D/. So, when I execute the following simple piece of code: </p> <div class="wiki-code"><div class="code"><pre> <span class="n">fs</span><span class="o">::</span><span class="n">directory_iterator</span> <span class="n">it</span><span class="p">(</span><span class="s">&quot;/media/sk1ff/EEBEDC27BEDBE65D/test&quot;</span><span class="p">),</span> <span class="n">dir_end</span><span class="p">;</span> <span class="k">for</span> <span class="p">(;</span> <span class="n">it</span> <span class="o">!=</span> <span class="n">dir_end</span><span class="p">;</span> <span class="o">++</span><span class="n">it</span><span class="p">)</span> <span class="p">{</span> <span class="n">std</span><span class="o">::</span><span class="n">cout</span> <span class="o">&lt;&lt;</span> <span class="n">it</span><span class="o">-&gt;</span><span class="n">path</span><span class="p">()</span> <span class="o">&lt;&lt;</span> <span class="n">std</span><span class="o">::</span><span class="n">endl</span><span class="p">;</span> <span class="p">}</span> </pre></div></div><p> it falls into an infinite loop. </p> en-us Boost C++ Libraries /htdocs/site/boost.png https://svn.boost.org/trac10/ticket/12079 Trac 1.4.3 alexb.x42@… Sat, 19 Mar 2016 21:10:35 GMT attachment set https://svn.boost.org/trac10/ticket/12079 https://svn.boost.org/trac10/ticket/12079 <ul> <li><strong>attachment</strong> → <span class="trac-field-new">fs_dir_iter_fix.diff</span> </li> </ul> Ticket alexb.x42@… Sat, 19 Mar 2016 21:12:32 GMT <link>https://svn.boost.org/trac10/ticket/12079#comment:1 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/12079#comment:1</guid> <description> <p> I checked with the debugger, and it seems that the problem is that the function readdir_r() for that file returns an error code 36 (ENAMETOOLONG). But errno is still zero. With this .diff in attachment, it started to work correctly (i.e. generates an error). Well, at least for this specific case :) </p> </description> <category>Ticket</category> </item> </channel> </rss>