Fluid: Crash with empty cache path #81271

Closed
opened 2020-09-29 00:47:50 +02:00 by Andrey Tumanov · 22 comments

System Information
Operating system: Windows 10 Pro/Win 10 Home
Graphics card: NVIDIA GeForce GTX 1080/Intel HD620

Blender Version
Broken: 2.90.1

Short description of error
Entering an empty line in the cache directory path field causes the blender to crash.

Exact steps for others to reproduce the error

  1. Make start cube as 'Domain' for fluid
  2. On physics tab delete a path for cache directory (make this field empty)
  3. Click anywhere or press enter

{F8933401,size=full}

This crash has been reproduced on three computers (Windows 10).

Best regards sincerely.

**System Information** Operating system: Windows 10 Pro/Win 10 Home Graphics card: NVIDIA GeForce GTX 1080/Intel HD620 **Blender Version** Broken: 2.90.1 **Short description of error** Entering an empty line in the cache directory path field causes the blender to crash. **Exact steps for others to reproduce the error** 1. Make start cube as 'Domain' for fluid 2. On physics tab delete a path for cache directory (make this field empty) 3. Click anywhere or press enter {[F8933401](https://archive.blender.org/developer/F8933401/image.png),size=full} This crash has been reproduced on three computers (Windows 10). Best regards sincerely.
Author

Added subscriber: @andreytumanov

Added subscriber: @andreytumanov
Member

Added subscribers: @sebbas, @lichtwerk

Added subscribers: @sebbas, @lichtwerk
Member

Changed status from 'Needs Triage' to: 'Needs Developer To Reproduce'

Changed status from 'Needs Triage' to: 'Needs Developer To Reproduce'
Member

Cannot reproduce on Linux (checked both 2.90.1 and 32d4a67017)

**System Information**
Operating system: Linux-5.8.4-200.fc32.x86_64-x86_64-with-fedora-32-Thirty_Two 64 Bits
Graphics card: GeForce GTX 970M/PCIe/SSE2 NVIDIA Corporation 4.5.0 NVIDIA 450.66
ersion: 2.91.0 Alpha, branch: master, commit date: 2020-09-29 07:53, hash: `rB32d4a67017ec`

Might be a Windows specific problem?

CC @sebbas

Cannot reproduce on Linux (checked both 2.90.1 and 32d4a67017) ``` **System Information** Operating system: Linux-5.8.4-200.fc32.x86_64-x86_64-with-fedora-32-Thirty_Two 64 Bits Graphics card: GeForce GTX 970M/PCIe/SSE2 NVIDIA Corporation 4.5.0 NVIDIA 450.66 ersion: 2.91.0 Alpha, branch: master, commit date: 2020-09-29 07:53, hash: `rB32d4a67017ec` ``` Might be a Windows specific problem? CC @sebbas

Added subscriber: @iss

Added subscriber: @iss

Changed status from 'Needs Developer To Reproduce' to: 'Needs User Info'

Changed status from 'Needs Developer To Reproduce' to: 'Needs User Info'

Also can not reproduce.

Please click on Help > Save System Info and upload saved file. Download build from https://builder.blender.org/download/ and check if this problem persists.

Also can not reproduce. Please click on Help > Save System Info and upload saved file. Download build from https://builder.blender.org/download/ and check if this problem persists.

Added subscriber: @rjg

Added subscriber: @rjg

If you set the path to empty and haven't previously saved the project, then it will attempt to create the cache folders in the directory of Blender's executable. If you've installed Blender to C:\Program Files\Blender Foundation then Blender likely doesn't have the required permissions to do so.

If you set the path to empty and haven't previously saved the project, then it will attempt to create the cache folders in the directory of Blender's executable. If you've installed Blender to `C:\Program Files\Blender Foundation` then Blender likely doesn't have the required permissions to do so.

Changed status from 'Needs User Info' to: 'Confirmed'

Changed status from 'Needs User Info' to: 'Confirmed'

I can confirm that this results in a crash @sebbas

I can confirm that this results in a crash @sebbas

Added subscriber: @dfelinto

Added subscriber: @dfelinto

@rjg so if you saved the project previously, does the problem still happen? Or even, if you save the project, but explicitly set the cache folder to one you can't write to. I cannot reproduce on Linux

@rjg so if you saved the project previously, does the problem still happen? Or even, if you save the project, but explicitly set the cache folder to one you can't write to. I cannot reproduce on Linux

@dfelinto It generally crashes when using a path that can't be accessed due to missing permissions, e.g. C:\Program Files.

BLI_gzopen(const unsigned char * filename, const unsigned char * mode) Line 366	C
MANTA::writeConfiguration(FluidModifierData * fmd, int framenr) Line 1118	C++
manta_write_config(MANTA * fluid, FluidModifierData * fmd, int framenr) Line 69	C++
BKE_fluid_modifier_processDomain(FluidModifierData * fmd, Depsgraph * depsgraph, Scene * scene, Object * ob, Mesh * me, const int scene_framenr) Line 4105	C
BKE_fluid_modifier_process(FluidModifierData * fmd, Depsgraph * depsgraph, Scene * scene, Object * ob, Mesh * me) Line 4146	C
BKE_fluid_modifier_do(FluidModifierData * fmd, Depsgraph * depsgraph, Scene * scene, Object * ob, Mesh * me) Line 4164	C
modifyMesh(ModifierData * md, const ModifierEvalContext * ctx, Mesh * me) Line 130	C
BKE_modifier_modify_mesh(ModifierData * md, const ModifierEvalContext * ctx, Mesh * me) Line 1011	C
mesh_calc_modifiers(Depsgraph * depsgraph, Scene * scene, Object * ob, int useDeform, const bool need_mapping, const CustomData_MeshMasks * dataMask, const int index, const bool use_cache, const bool allow_shared_mesh, Mesh * * r_deform, Mesh * * r_final) Line 1183	C
mesh_build_data(Depsgraph * depsgraph, Scene * scene, Object * ob, const CustomData_MeshMasks * dataMask, const bool need_mapping) Line 1806	C
makeDerivedMesh(Depsgraph * depsgraph, Scene * scene, Object * ob, BMEditMesh * em, const CustomData_MeshMasks * dataMask) Line 1927	C
BKE_object_handle_data_update(Depsgraph * depsgraph, Scene * scene, Object * ob) Line 194	C
BKE_object_eval_uber_data(Depsgraph * depsgraph, Scene * scene, Object * ob) Line 385	C
 	[Externer Code]	
blender::deg::`anonymous namespace'::evaluate_node(const blender::deg::`anonymous-namespace'::DepsgraphEvalState * state, blender::deg::OperationNode * operation_node) Line 116	C++
blender::deg::`anonymous namespace'::deg_task_run_func(TaskPool * pool, void * taskdata) Line 128	C++
Task::()::__l2::<Lambdafunktion>() Line 118	C++
tbb::interface7::internal::delegated_function<void <Lambdafunktion>(void) const ,void>::operator()() Line 94	C++
 	[Externer Code]	
tbb::interface7::internal::isolate_impl<void,void <Lambdafunktion>(void) const>(const Task::()::__l2::void <Lambdafunktion>(void) & f) Line 161	C++
tbb::interface7::this_task_arena::isolate<void <Lambdafunktion>(void)>(const Task::()::__l2::void <Lambdafunktion>(void) & f) Line 396	C++
Task::operator()() Line 122	C++
tbb::internal::function_task<Task>::execute() Line 1049	C++
 	[Externer Code]	
tbb::task::wait_for_all() Line 810	C++
tbb::internal::task_group_base::wait() Line 168	C++
tbb_task_pool_work_and_wait(TaskPool * pool) Line 253	C++
BLI_task_pool_work_and_wait(TaskPool * pool) Line 500	C++
blender::deg::deg_evaluate_on_refresh(blender::deg::Depsgraph * graph) Line 399	C++
deg_flush_updates_and_refresh(blender::deg::Depsgraph * deg_graph) Line 59	C++
DEG_evaluate_on_refresh(Depsgraph * graph) Line 74	C++
scene_graph_update_tagged(Depsgraph * depsgraph, Main * bmain, bool only_if_tagged) Line 1537	C
BKE_scene_graph_update_tagged(Depsgraph * depsgraph, Main * bmain) Line 1575	C
wm_event_do_depsgraph(bContext * C, bool is_after_open_file) Line 357	C
wm_event_do_refresh_wm_and_depsgraph(bContext * C) Line 384	C
wm_event_do_notifiers(bContext * C) Line 562	C
WM_main(bContext * C) Line 482	C
main(int argc, const unsigned char * * UNUSED_argv_c) Line 526	C
@dfelinto It generally crashes when using a path that can't be accessed due to missing permissions, e.g. `C:\Program Files`. ```lines BLI_gzopen(const unsigned char * filename, const unsigned char * mode) Line 366 C MANTA::writeConfiguration(FluidModifierData * fmd, int framenr) Line 1118 C++ manta_write_config(MANTA * fluid, FluidModifierData * fmd, int framenr) Line 69 C++ BKE_fluid_modifier_processDomain(FluidModifierData * fmd, Depsgraph * depsgraph, Scene * scene, Object * ob, Mesh * me, const int scene_framenr) Line 4105 C BKE_fluid_modifier_process(FluidModifierData * fmd, Depsgraph * depsgraph, Scene * scene, Object * ob, Mesh * me) Line 4146 C BKE_fluid_modifier_do(FluidModifierData * fmd, Depsgraph * depsgraph, Scene * scene, Object * ob, Mesh * me) Line 4164 C modifyMesh(ModifierData * md, const ModifierEvalContext * ctx, Mesh * me) Line 130 C BKE_modifier_modify_mesh(ModifierData * md, const ModifierEvalContext * ctx, Mesh * me) Line 1011 C mesh_calc_modifiers(Depsgraph * depsgraph, Scene * scene, Object * ob, int useDeform, const bool need_mapping, const CustomData_MeshMasks * dataMask, const int index, const bool use_cache, const bool allow_shared_mesh, Mesh * * r_deform, Mesh * * r_final) Line 1183 C mesh_build_data(Depsgraph * depsgraph, Scene * scene, Object * ob, const CustomData_MeshMasks * dataMask, const bool need_mapping) Line 1806 C makeDerivedMesh(Depsgraph * depsgraph, Scene * scene, Object * ob, BMEditMesh * em, const CustomData_MeshMasks * dataMask) Line 1927 C BKE_object_handle_data_update(Depsgraph * depsgraph, Scene * scene, Object * ob) Line 194 C BKE_object_eval_uber_data(Depsgraph * depsgraph, Scene * scene, Object * ob) Line 385 C [Externer Code] blender::deg::`anonymous namespace'::evaluate_node(const blender::deg::`anonymous-namespace'::DepsgraphEvalState * state, blender::deg::OperationNode * operation_node) Line 116 C++ blender::deg::`anonymous namespace'::deg_task_run_func(TaskPool * pool, void * taskdata) Line 128 C++ Task::()::__l2::<Lambdafunktion>() Line 118 C++ tbb::interface7::internal::delegated_function<void <Lambdafunktion>(void) const ,void>::operator()() Line 94 C++ [Externer Code] tbb::interface7::internal::isolate_impl<void,void <Lambdafunktion>(void) const>(const Task::()::__l2::void <Lambdafunktion>(void) & f) Line 161 C++ tbb::interface7::this_task_arena::isolate<void <Lambdafunktion>(void)>(const Task::()::__l2::void <Lambdafunktion>(void) & f) Line 396 C++ Task::operator()() Line 122 C++ tbb::internal::function_task<Task>::execute() Line 1049 C++ [Externer Code] tbb::task::wait_for_all() Line 810 C++ tbb::internal::task_group_base::wait() Line 168 C++ tbb_task_pool_work_and_wait(TaskPool * pool) Line 253 C++ BLI_task_pool_work_and_wait(TaskPool * pool) Line 500 C++ blender::deg::deg_evaluate_on_refresh(blender::deg::Depsgraph * graph) Line 399 C++ deg_flush_updates_and_refresh(blender::deg::Depsgraph * deg_graph) Line 59 C++ DEG_evaluate_on_refresh(Depsgraph * graph) Line 74 C++ scene_graph_update_tagged(Depsgraph * depsgraph, Main * bmain, bool only_if_tagged) Line 1537 C BKE_scene_graph_update_tagged(Depsgraph * depsgraph, Main * bmain) Line 1575 C wm_event_do_depsgraph(bContext * C, bool is_after_open_file) Line 357 C wm_event_do_refresh_wm_and_depsgraph(bContext * C) Line 384 C wm_event_do_notifiers(bContext * C) Line 562 C WM_main(bContext * C) Line 482 C main(int argc, const unsigned char * * UNUSED_argv_c) Line 526 C ```
Sebastián Barschkis was assigned by Dalai Felinto 2020-11-05 17:41:04 +01:00

Assigning it to @sebbas then. I believe he has access to a Windows station. He should be able to reproduce it.

Assigning it to @sebbas then. I believe he has access to a Windows station. He should be able to reproduce it.
Sebastián Barschkis changed title from Crash with empty cache path to Fluid: Crash with empty cache path 2020-11-07 13:01:51 +01:00

Don't have access to a Windows machine right now and would say this won't be fixed in 2.91.

Don't have access to a Windows machine right now and would say this won't be fixed in 2.91.

@sebbas Do you want me to take another look?

@sebbas Do you want me to take another look?

@rjg Sure, it would be interesting to know why BLI_gzopen() in MANTA::writeConfiguration gives a crash. If a file cannot be opened I would have expected to return false afterwards.

@rjg Sure, it would be interesting to know why `BLI_gzopen()` in `MANTA::writeConfiguration` gives a crash. If a file cannot be opened I would have expected to return `false` afterwards.

So this is rather a bug in BLI_gzopen() than it is in Mantaflow. It does the following on Windows to create the file:

  /* xxx Creates file before transcribing the path */
  if (mode[0] == 'w') {
    fclose(ufopen(filename, "a"));
  }

This fails when the file can't be opened and ufopen returns NULL.

  /* xxx Creates file before transcribing the path */
  if (mode[0] == 'w') {
    FILE *file = ufopen(filename, "a");
    if (file == NULL) {
      /* File couldn't be opened, e.g. due to permission error. */
      return NULL;
    }
    fclose(file);
  }

Mantaflow should probably display a warning/error to the user though when the cache directory can't be used. Currently it only writes a messages to the console.

So this is rather a bug in `BLI_gzopen()` than it is in Mantaflow. It does the following on Windows to create the file: ``` /* xxx Creates file before transcribing the path */ if (mode[0] == 'w') { fclose(ufopen(filename, "a")); } ``` This fails when the file can't be opened and `ufopen` returns `NULL`. ``` /* xxx Creates file before transcribing the path */ if (mode[0] == 'w') { FILE *file = ufopen(filename, "a"); if (file == NULL) { /* File couldn't be opened, e.g. due to permission error. */ return NULL; } fclose(file); } ``` Mantaflow should probably display a warning/error to the user though when the cache directory can't be used. Currently it only writes a messages to the console.

@rjg Looks good to me. As this fixes the crash (right?), from my side you could already commit this to 2.91.
I can add warnings etc. afterwards.

@rjg Looks good to me. As this fixes the crash (right?), from my side you could already commit this to 2.91. I can add warnings etc. afterwards.

This issue was referenced by 8b815c7ce5

This issue was referenced by 8b815c7ce565b707fca9e9793bbec9784856f0f9

Changed status from 'Confirmed' to: 'Resolved'

Changed status from 'Confirmed' to: 'Resolved'
Sign in to join this conversation.
No Label
Interest
Alembic
Interest
Animation & Rigging
Interest
Asset Browser
Interest
Asset Browser Project Overview
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
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 project
7 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#81271
No description provided.