Opened 16 years ago

Closed 14 years ago

#752 closed Bugs (invalid)

directory_iterator doesn't work with catch — at Version 2

Reported by: nobody Owned by: Beman Dawes
Milestone: Component: filesystem
Version: None Severity: Showstopper
Keywords: Cc:

Description (last modified by Beman Dawes)

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".

Change History (2)

comment:1 by Marshall Clow, 15 years ago

Owner: changed from beman_dawes to Beman Dawes
Severity: Showstopper
Status: assignednew

assigning to actual user "bemandawes" instead of unknown user "beman_dawes"

comment:2 by Beman Dawes, 14 years ago

Description: modified (diff)
Resolution: Noneinvalid
Status: newclosed

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

--Beman

Note: See TracTickets for help on using tickets.