-
-
Notifications
You must be signed in to change notification settings - Fork 56.5k
FileStorage segmentation fault when saving to a folder which doesn't exist #21448
Copy link
Copy link
Closed
Closed
Copy link
Labels
bugcategory: coreconfirmedThere is stable reproducer / investigation completeThere is stable reproducer / investigation complete
Milestone
Description
System information (version)
- OpenCV => 4.2.0
- Operating System / Platform => Ubuntu Mate aarch64
- Compiler => N/A (Python3)
Detailed description
In Python, when using cv2.FileStorage attempting to save the file to a folder which doesn't exist causes a segmentation fault.
Steps to reproduce
- Run the following sample program with the
makedirsline commented out. - Segmentation fault occurs
Running the same program with a folder which exists (e.g. uncomment the line to create the folder) works without error.
import cv2
import os
save_folder = os.path.join("work")
save_path = os.path.join(save_folder, f"test_file.yaml")
### Comment the following line out for a segmentation fault
# os.makedirs(save_folder, exist_ok = True)
###
cv_file = cv2.FileStorage(save_path, cv2.FILE_STORAGE_WRITE)
cv_file.write('K', 1)
cv_file.release()Issue submission checklist
- I report the issue, it's not a question
- I checked the problem with documentation, FAQ, open issues,
forum.opencv.org, Stack Overflow, etc and have not found solution - I updated to latest OpenCV version and the issue is still there
- There is reproducer code and related data files: videos, images, onnx, etc
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
bugcategory: coreconfirmedThere is stable reproducer / investigation completeThere is stable reproducer / investigation complete