pytorch/caffe2/serialize
Xu Han b2553a6ec4 [AOTI] raise PyTorchStreamWriter open failed error code on windows (#162799)
When I debug AOTI UT: `TestAOTInductorPackage_cpu::test_add`.  I found it didn't output the verbose error code, when PyTorchStreamWriter open failed.

This PR add the verbose error code output for debug. Local test shows as below:
<img width="1124" height="653" alt="image" src="https://github.com/user-attachments/assets/01cb1a51-2982-4106-8b5b-c608ac26a075" />

The error code is 32, we can check the Windows error code 32 at https://learn.microsoft.com/en-us/windows/win32/debug/system-error-codes--0-499-
```
ERROR_SHARING_VIOLATION
32 (0x20)
The process cannot access the file because it is being used by another process.
```

This issue is caused by the file is opened by another process. I fixed same issue in zip open as PR: https://github.com/pytorch/pytorch/pull/162617 But still no idea how to open file with shared access in `std::ofstream`. I will continue to researching it.

Pull Request resolved: https://github.com/pytorch/pytorch/pull/162799
Approved by: https://github.com/jansel
2025-09-13 01:41:14 +00:00
..
CMakeLists.txt [miniz] Bump miniz version to 3.0.2 and add patch for zip64 (#140041) 2024-11-09 00:13:16 +00:00
crc_alt.h Revert "Fix clang-tidy warnings in Caffe2 code (#134935)" 2024-09-13 16:42:37 +00:00
crc.cc [4/N] Fix Wextra-semi warning (#139256) 2024-10-31 03:01:14 +00:00
file_adapter.cc Format caffe2/serialize (#141850) 2024-12-04 01:14:24 +00:00
file_adapter.h Format caffe2/serialize (#141850) 2024-12-04 01:14:24 +00:00
in_memory_adapter.h Format caffe2/serialize (#141850) 2024-12-04 01:14:24 +00:00
inline_container_test.cc Update PyTorchStreamReader API to take cpu allocator override (#150439) 2025-04-18 01:53:14 +00:00
inline_container.cc [AOTI] raise PyTorchStreamWriter open failed error code on windows (#162799) 2025-09-13 01:41:14 +00:00
inline_container.h Update PyTorchStreamReader API to take cpu allocator override (#150439) 2025-04-18 01:53:14 +00:00
istream_adapter.cc Remove deprecated alias macro(1/3) (#137556) 2024-10-21 17:32:32 +00:00
istream_adapter.h Revert "Fix clang-tidy warnings in Caffe2 code (#134935)" 2024-09-13 16:42:37 +00:00
read_adapter_interface.cc Revert "Fix clang-tidy warnings in Caffe2 code (#134935)" 2024-09-13 16:42:37 +00:00
read_adapter_interface.h Revert "Fix clang-tidy warnings in Caffe2 code (#134935)" 2024-09-13 16:42:37 +00:00
versions.h Revert "Fix clang-tidy warnings in Caffe2 code (#134935)" 2024-09-13 16:42:37 +00:00