Re: [Boost-bugs] [Boost C++ Libraries] #752: directory_iterator doesn't work with catch

Subject: Re: [Boost-bugs] [Boost C++ Libraries] #752: directory_iterator doesn't work with catch
From: Boost C++ Libraries (noreply_at_[hidden])
Date: 2008-06-29 21:21:14


#752: directory_iterator doesn't work with catch
----------------------+-----------------------------------------------------
  Reporter: nobody | Owner: bemandawes
      Type: Bugs | Status: closed
 Milestone: | Component: filesystem
   Version: None | Severity: Showstopper
Resolution: invalid | Keywords:
----------------------+-----------------------------------------------------
Changes (by bemandawes):

  * status: new => closed
  * resolution: None => invalid


Old description:

> {{{
> Fedora Core 4, gcc version 4.0.2 20051125 (Red Hat
> 4.0.2-8)
> The next construction doesn't work (but it works if
> directory_iterator is changed to some other iterator
> or just counter):
>
> path dir_path(dir_name);
> directory_iterator end_itr;
> try {
> for (directory_iterator itr(dir_name);
> itr!=end_itr; ++itr)
> {
> try {
> ......
> }
> catch (...) {
> cout<<"First catch"<<endl;
> throw 20;
> }
> }
> }
> catch (...) {
> cout<<"Second catch"<<endl;
> }
>
> Result: First catch
> and stucked program, "strace" shows:
> "futex(0x...,FUTEX_WAIT,2,NULL".
> }}}

New description:

 {{{
 Fedora Core 4, gcc version 4.0.2 20051125 (Red Hat
 4.0.2-8)
 The next construction doesn't work (but it works if
 directory_iterator is changed to some other iterator
 or just counter):

 path dir_path(dir_name);
 directory_iterator end_itr;
 try {
    for (directory_iterator itr(dir_name);
             itr!=end_itr; ++itr)
    {
        try {
            ......
        }
        catch (...) {
            cout<<"First catch"<<endl;
            throw 20;
        }
    }
 }
 catch (...) {
    cout<<"Second catch"<<endl;
 }

 Result: First catch
         and stucked program, "strace" shows:
 "futex(0x...,FUTEX_WAIT,2,NULL".
 }}}

--
Comment:
 Can't diagnose without more information. What was in the try block? Was it
 supposed to throw or not? Etc.

 --Beman
-- 
Ticket URL: <http://svn.boost.org/trac/boost/ticket/752#comment:2>
Boost C++ Libraries <http://www.boost.org/>
Boost provides free peer-reviewed portable C++ source libraries.

This archive was generated by hypermail 2.1.7 : 2017-02-16 18:49:58 UTC