Fix #95411: Collada export crashes if temporary file is not accessible #118958

Merged
Philipp Oeser merged 4 commits from lichtwerk/blender:95411_b into blender-v4.1-release 2024-03-05 13:14:57 +01:00
Member

This can happen e.g. when relative "//" is in Preferences > File Paths >
Temporary Files is used.

Now catch the corresponding COLLADASW::StreamWriterException
and cancel export then.

NOTE: 51126fab33 might have prevented the most common case
to run into this crash (but there might be other cases still so being safe
here does not hurt)

This can happen e.g. when relative "//" is in Preferences > File Paths > Temporary Files is used. Now catch the corresponding COLLADASW::StreamWriterException and cancel export then. NOTE: 51126fab3314 might have prevented the most common case to run into this crash (but there might be other cases still so being safe here does not hurt)
Philipp Oeser added 1 commit 2024-03-01 12:19:43 +01:00
Fix #95411: Collada export crashes if temporary file is not accessible
Some checks failed
buildbot/vexp-code-patch-lint Build done.
buildbot/vexp-code-patch-windows-amd64 Build done.
buildbot/vexp-code-patch-linux-x86_64 Build done.
buildbot/vexp-code-patch-darwin-arm64 Build done.
buildbot/vexp-code-patch-darwin-x86_64 Build done.
buildbot/vexp-code-patch-coordinator Build done.
2c6a1ffc6c
This can happen e.g. when relative "//" is in Preferences > File Paths >
Temporary Files is used.

It seems other libraries (such as USD) guard against this themselves,
for Collada, we apparently have to step in.

Now check if file could be accessed and not export anything otherwise.
Author
Member

@blender-bot build

@blender-bot build
Philipp Oeser added this to the Pipeline, Assets & IO project 2024-03-01 12:37:57 +01:00
Philipp Oeser added the
Interest
Collada
label 2024-03-01 12:38:09 +01:00
Philipp Oeser added 1 commit 2024-03-01 13:27:00 +01:00
add missing include for windows
All checks were successful
buildbot/vexp-code-patch-lint Build done.
buildbot/vexp-code-patch-linux-x86_64 Build done.
buildbot/vexp-code-patch-darwin-arm64 Build done.
buildbot/vexp-code-patch-darwin-x86_64 Build done.
buildbot/vexp-code-patch-windows-amd64 Build done.
buildbot/vexp-code-patch-coordinator Build done.
ed3932e165
Author
Member

@blender-bot build

@blender-bot build
Philipp Oeser requested review from Campbell Barton 2024-03-01 15:31:45 +01:00
Campbell Barton requested changes 2024-03-04 00:41:20 +01:00
Dismissed
@ -173,1 +177,4 @@
COLLADABU::NativeString native_filename = make_temp_filepath(nullptr, ".dae");
/* Avoid crash if temp file cannot be written to. */
if (BLI_access(native_filename.c_str(), W_OK) != 0) {

Files can fail to be created for many reasons, this only addresses not having permissions.

It would be better to catch the COLLADASW::StreamWriterException.

Files can fail to be created for many reasons, this only addresses not having permissions. It would be better to catch the `COLLADASW::StreamWriterException`.
lichtwerk marked this conversation as resolved
Philipp Oeser added 2 commits 2024-03-04 16:25:44 +01:00
Campbell Barton approved these changes 2024-03-04 22:59:10 +01:00
Philipp Oeser merged commit 959595069d into blender-v4.1-release 2024-03-05 13:14:57 +01:00
Philipp Oeser deleted branch 95411_b 2024-03-05 13:15:03 +01:00
Sign in to join this conversation.
No reviewers
No Label
Interest
Alembic
Interest
Animation & Rigging
Interest
Asset System
Interest
Audio
Interest
Automated Testing
Interest
Blender Asset Bundle
Interest
BlendFile
Interest
Collada
Interest
Compatibility
Interest
Compositing
Interest
Core
Interest
Cycles
Interest
Dependency Graph
Interest
Development Management
Interest
EEVEE
Interest
EEVEE & Viewport
Interest
Freestyle
Interest
Geometry Nodes
Interest
Grease Pencil
Interest
ID Management
Interest
Images & Movies
Interest
Import Export
Interest
Line Art
Interest
Masking
Interest
Metal
Interest
Modeling
Interest
Modifiers
Interest
Motion Tracking
Interest
Nodes & Physics
Interest
OpenGL
Interest
Overlay
Interest
Overrides
Interest
Performance
Interest
Physics
Interest
Pipeline, Assets & IO
Interest
Platforms, Builds & Tests
Interest
Python API
Interest
Render & Cycles
Interest
Render Pipeline
Interest
Sculpt, Paint & Texture
Interest
Text Editor
Interest
Translations
Interest
Triaging
Interest
Undo
Interest
USD
Interest
User Interface
Interest
UV Editing
Interest
VFX & Video
Interest
Video Sequencer
Interest
Virtual Reality
Interest
Vulkan
Interest
Wayland
Interest
Workbench
Interest: X11
Legacy
Asset Browser Project
Legacy
Blender 2.8 Project
Legacy
Milestone 1: Basic, Local Asset Browser
Legacy
OpenGL Error
Meta
Good First Issue
Meta
Papercut
Meta
Retrospective
Meta
Security
Module
Animation & Rigging
Module
Core
Module
Development Management
Module
EEVEE & Viewport
Module
Grease Pencil
Module
Modeling
Module
Nodes & Physics
Module
Pipeline, Assets & IO
Module
Platforms, Builds & Tests
Module
Python API
Module
Render & Cycles
Module
Sculpt, Paint & Texture
Module
Triaging
Module
User Interface
Module
VFX & Video
Platform
FreeBSD
Platform
Linux
Platform
macOS
Platform
Windows
Priority
High
Priority
Low
Priority
Normal
Priority
Unbreak Now!
Status
Archived
Status
Confirmed
Status
Duplicate
Status
Needs Info from Developers
Status
Needs Information from User
Status
Needs Triage
Status
Resolved
Type
Bug
Type
Design
Type
Known Issue
Type
Patch
Type
Report
Type
To Do
No Milestone
No Assignees
2 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: blender/blender#118958
No description provided.