-
Notifications
You must be signed in to change notification settings - Fork 16
Open
Description
MacOS 14.1.1 clang 编译环境。
创作异常执行的条件:
在执行目录预先touch dir2创建一个和目录同名的文件。
崩溃情况如下:
Start task
Create directory: dir1/a/b/c
Create directory: dir2/1/2/3
Create directory: dir3/A/B/C
Exception in thread
libc++abi: terminating due to uncaught exception of type std::__1::future_error: The state of the promise has already been set.
[1] 66108 abort ./03-FutureFileSystem
修改代码,把promise.set_value(false);注释后,重新编译执行是另一个错误崩溃:
Start task
Create directory: dir1/a/b/c
Create directory: dir2/1/2/3
Create directory: dir3/A/B/C
Exception in thread
Task1 result: 1
libc++abi: terminating due to uncaught exception of type std::__1::__fs::filesystem::filesystem_error: filesystem error: in create_directories: Not a directory ["dir2/1"]
Task2 result: [1] 66969 abort ./03-FutureFileSystem
修改代码,在 main 里加入 try{ ... } catch(...) {},重新编译执行是另一个错误崩溃:
Start task
Create directory: dir1/a/b/c
Create directory: dir2/1/2/3
Create directory: dir3/A/B/C
Exception in thread
Task1 result: 1
libc++abi: terminating
Task2 result: [1] 66765 abort ./03-FutureFileSystem
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels