Regression: Crash when saving after pressing ctrl+S twice. #88570

Closed
opened 2 years ago by JacquesLucke · 34 comments
Collaborator

System Information
Operating system: Linux-5.12.3-arch1-1-x86_64-with-glibc2.33 64 Bits
Graphics card: AMD Radeon RX 5700 (NAVI10, DRM 3.40.0, 5.12.3-arch1-1, LLVM 11.1.0) AMD 4.6 (Core Profile) Mesa 21.1.0

Blender Version
Broken: version: 2.92, 2.93.0 Beta (1a69d491e5), 3.0 Alpha (067587e329).
Worked: 2.83

Caused by 796412dca0

Short description of error
Blender crashes when I click on save in the file browser after pressing ctrl+S twice.

Exact steps for others to reproduce the error

  1. Open default scene.
  2. Press ctrl+S to open the save file dialog.
  3. When it opened, press ctrl+S again.
  4. Click on "Save Blender File".
  5. Crash.
_BLI_assert_abort() (/home/jacques/blender-git/blender/source/blender/blenlib/intern/BLI_assert.c:56)
wm_handler_fileselect_do(bContext * C, ListBase * handlers, wmEventHandler_Op * handler, int val) (/home/jacques/blender-git/blender/source/blender/windowmanager/intern/wm_event_system.c:2316)
wm_handler_fileselect_call(bContext * C, ListBase * handlers, wmEventHandler_Op * handler, const wmEvent * event) (/home/jacques/blender-git/blender/source/blender/windowmanager/intern/wm_event_system.c:2462)
wm_handlers_do_intern(bContext * C, wmEvent * event, ListBase * handlers) (/home/jacques/blender-git/blender/source/blender/windowmanager/intern/wm_event_system.c:2906)
wm_handlers_do(bContext * C, wmEvent * event, ListBase * handlers) (/home/jacques/blender-git/blender/source/blender/windowmanager/intern/wm_event_system.c:2958)
wm_event_do_handlers(bContext * C) (/home/jacques/blender-git/blender/source/blender/windowmanager/intern/wm_event_system.c:3378)
WM_main(bContext * C) (/home/jacques/blender-git/blender/source/blender/windowmanager/intern/wm.c:647)
main(int argc, const char ** argv) (/home/jacques/blender-git/blender/source/creator/creator.c:520)
**System Information** Operating system: Linux-5.12.3-arch1-1-x86_64-with-glibc2.33 64 Bits Graphics card: AMD Radeon RX 5700 (NAVI10, DRM 3.40.0, 5.12.3-arch1-1, LLVM 11.1.0) AMD 4.6 (Core Profile) Mesa 21.1.0 **Blender Version** Broken: version: 2.92, 2.93.0 Beta (1a69d491e5), 3.0 Alpha (067587e329). Worked: 2.83 Caused by 796412dca0 **Short description of error** Blender crashes when I click on save in the file browser after pressing ctrl+S twice. **Exact steps for others to reproduce the error** 1. Open default scene. 2. Press ctrl+S to open the save file dialog. 3. When it opened, press ctrl+S again. 4. Click on "Save Blender File". 5. Crash. ``` _BLI_assert_abort() (/home/jacques/blender-git/blender/source/blender/blenlib/intern/BLI_assert.c:56) wm_handler_fileselect_do(bContext * C, ListBase * handlers, wmEventHandler_Op * handler, int val) (/home/jacques/blender-git/blender/source/blender/windowmanager/intern/wm_event_system.c:2316) wm_handler_fileselect_call(bContext * C, ListBase * handlers, wmEventHandler_Op * handler, const wmEvent * event) (/home/jacques/blender-git/blender/source/blender/windowmanager/intern/wm_event_system.c:2462) wm_handlers_do_intern(bContext * C, wmEvent * event, ListBase * handlers) (/home/jacques/blender-git/blender/source/blender/windowmanager/intern/wm_event_system.c:2906) wm_handlers_do(bContext * C, wmEvent * event, ListBase * handlers) (/home/jacques/blender-git/blender/source/blender/windowmanager/intern/wm_event_system.c:2958) wm_event_do_handlers(bContext * C) (/home/jacques/blender-git/blender/source/blender/windowmanager/intern/wm_event_system.c:3378) WM_main(bContext * C) (/home/jacques/blender-git/blender/source/blender/windowmanager/intern/wm.c:647) main(int argc, const char ** argv) (/home/jacques/blender-git/blender/source/creator/creator.c:520) ```
Poster
Collaborator

Added subscriber: @JacquesLucke

Added subscriber: @JacquesLucke
Collaborator

#96185 was marked as duplicate of this issue

#96185 was marked as duplicate of this issue
Collaborator

#89683 was marked as duplicate of this issue

#89683 was marked as duplicate of this issue
Collaborator

#89075 was marked as duplicate of this issue

#89075 was marked as duplicate of this issue
Owner

Added subscriber: @dfelinto

Added subscriber: @dfelinto
Owner

Changed status from 'Needs Triage' to: 'Confirmed'

Changed status from 'Needs Triage' to: 'Confirmed'
dfelinto self-assigned this 2 years ago
Owner

I can reproduce this in 2.92 as well as 2.93 and master. It doesn't happen in 2.91.

I can reproduce this in 2.92 as well as 2.93 and master. It doesn't happen in 2.91.

Added subscriber: @Raimund58

Added subscriber: @Raimund58

Blender 2.83.15 is also not affected (on Windows)

Blender 2.83.15 is also not affected (on Windows)
Harley commented 2 years ago
Collaborator

Added subscriber: @Harley

Added subscriber: @Harley
Harley commented 2 years ago
Collaborator

Actually I just got the exact same behavior in 2.91.0 (for Windows).

Actually I just got the exact same behavior in 2.91.0 (for Windows).
Owner

Interesting, in Linux I cannot reproduce it in 2.91.

Interesting, in Linux I cannot reproduce it in 2.91.
Garek commented 2 years ago

Added subscriber: @Garek

Added subscriber: @Garek
Garek commented 2 years ago

Can confirm on Windows for 2.90.
Working for 2.83.15 as well as 2.83.0

Can confirm on Windows for 2.90. Working for 2.83.15 as well as 2.83.0
Harley commented 2 years ago
Collaborator

@dfelinto - Interesting, in Linux I cannot reproduce it in 2.91.

Yeah, was doubting myself after seeing other people say otherwise. So I downloaded it again and gave it another try.

Date: 2020-11-25 08:34
Hash: 0f45cab862

And it definitely dies, just as described above. But there are further details that might help:

How quickly you press that second ctrl-S makes a big difference. Best to wait at least a second or two between them just to be sure.

This same issue occurs when pressing the "Cancel" Button on the same form. But NOT when clicking the "X" close in the titlebar. This could be a very interesting clue.

> @dfelinto - Interesting, in Linux I cannot reproduce it in 2.91. Yeah, was doubting myself after seeing other people say otherwise. So I [downloaded it again ](https://download.blender.org/release/Blender2.91/) and gave it another try. Date: 2020-11-25 08:34 Hash: 0f45cab862b8 And it **definitely dies**, *just as described above*. But there are further details that might help: How quickly you press that second ctrl-S makes a big difference. Best to wait at least a second or two between them just to be sure. This same issue occurs when pressing the "Cancel" Button on the same form. But NOT when clicking the "X" close in the titlebar. This could be a very interesting clue.
ankitm commented 2 years ago
Collaborator

Added subscribers: @coolchou-zhao, @ankitm, @PratikPB2123

Added subscribers: @coolchou-zhao, @ankitm, @PratikPB2123
ankitm commented 2 years ago
Collaborator

Also happens with:

  • command + O
  • command + S
  • Escape/ Enter to save.
Also happens with: - command + O - command + S - Escape/ Enter to save.
rjg commented 2 years ago
Collaborator

Added subscriber: @YKTMU2

Added subscriber: @YKTMU2
dfelinto was unassigned by JulianEisel 2 years ago
Jake-Faulkner self-assigned this 1 year ago
1D_Inc commented 1 year ago

Added subscriber: @1D_Inc

Added subscriber: @1D_Inc
1D_Inc commented 1 year ago

Saving action is more than an action - it is a reflex, a part of a CG survival instinct.
A way to save massively learned from the industry standards design solutions has its own memes:
image.png
image.png

In #88570#1168210, @Harley wrote:
How quickly you press that second ctrl-S makes a big difference. Best to wait at least a second or two between them just to be sure.

Not exactly, it looks like it more depends on if you press

  • full Ctrl+S several times
  • or Ctrl+SSSS way.
    The second way seems to be stable.
Saving action is more than an action - it is a reflex, a part of a CG survival instinct. A way to save massively learned from the industry standards design solutions has its own memes: ![image.png](https://archive.blender.org/developer/F12688056/image.png) ![image.png](https://archive.blender.org/developer/F12688082/image.png) > In #88570#1168210, @Harley wrote: > How quickly you press that second ctrl-S makes a big difference. Best to wait at least a second or two between them just to be sure. Not exactly, it looks like it more depends on if you press - full Ctrl+S several times - or Ctrl+SSSS way. The second way seems to be stable.

Added subscriber: @michael64

Added subscriber: @michael64

The described crash happens as follows.
In the function GHOST_ScreenToClient the following line is executed:
window->screenToClient(inX, inY, *outX, *outY);
When window is NULL the process crashes but here we are in a code segment that we shouldn't have gotten into in the first place.

Reproducing this bug in a debug build with enabled asserts aborts the process earlier because of a failed assert in wm_event_system.c:

  BLI_assert(ctx_win != win);

So we have ctx_win == win which it shouldn't be but a release build with disabled asserts just marches on and crashes later.

Let's have a look at the big picture.
One could say that most powers users don't like modal dialogs in general. They are overused and annoying, especially when not needed.

As an example, we have a fresh scene with the default cube. Let's move the default cube to the left window border so it's still visible when we press Ctrl-S to save the scene.

Now we have the "Blender File View" save dialog open and the default cube next to the left of it.

Now pressing 'g' to move the default cube does not allow me to move the default cube which seems appropriate to me.
With the save dialog open, I can go to the Object Properties to adjust the x value of the location and click on the number which is in focus but the field does not accept key events, not even moving the cursor.
But I can still click and scrub location.x and see the cube moving while the save dialog is open. Should this even be possible? I don't know, it's a matter of taste I guess.

Likewise I can also press Ctrl-Shift-O to get the recent files dialog while the the save dialog is open. This could even make sense if one just wanted to be reminded of a recent file name before saving.

Back to the details in wm_event_system.c.
A quick workaround like this is not what we are looking for:

        if (BLI_listbase_is_single(&file_area->spacedata)) {
          if (ctx_win == win) {  // This would prevent an immediate
            continue;            // crash but still allows
          }                      // a weird app state.
          BLI_assert(ctx_win != win);

This would still allow a second file window(over the first one to be opened.
Cancelling the second window would remove it as well as the file name, Cancel and Save As buttons. Now the file dialog can only be closed by clicking the 'x'.
My intuition tells me that in this particular case it might be a good idea to not open the second file dialog instance while the first one is still opened.

That's my diagnosis, maybe somebody else knows how to prevent improperly nested file dialogs tastefully.

The described crash happens as follows. In the function GHOST_ScreenToClient the following line is executed: window->screenToClient(inX, inY, *outX, *outY); When window is NULL the process crashes but here we are in a code segment that we shouldn't have gotten into in the first place. Reproducing this bug in a debug build with enabled asserts aborts the process earlier because of a failed assert in wm_event_system.c: ``` BLI_assert(ctx_win != win); ``` So we have ctx_win == win which it shouldn't be but a release build with disabled asserts just marches on and crashes later. Let's have a look at the big picture. One could say that most powers users don't like modal dialogs in general. They are overused and annoying, especially when not needed. As an example, we have a fresh scene with the default cube. Let's move the default cube to the left window border so it's still visible when we press Ctrl-S to save the scene. Now we have the "Blender File View" save dialog open and the default cube next to the left of it. Now pressing 'g' to move the default cube does not allow me to move the default cube which seems appropriate to me. With the save dialog open, I can go to the Object Properties to adjust the x value of the location and click on the number which is in focus but the field does not accept key events, not even moving the cursor. But I can still click and scrub location.x and see the cube moving while the save dialog is open. Should this even be possible? I don't know, it's a matter of taste I guess. Likewise I can also press Ctrl-Shift-O to get the recent files dialog while the the save dialog is open. This could even make sense if one just wanted to be reminded of a recent file name before saving. Back to the details in wm_event_system.c. A quick workaround like this is not what we are looking for: ``` if (BLI_listbase_is_single(&file_area->spacedata)) { if (ctx_win == win) { // This would prevent an immediate continue; // crash but still allows } // a weird app state. BLI_assert(ctx_win != win); ``` This would still allow a second file window(over the first one to be opened. Cancelling the second window would remove it as well as the file name, Cancel and Save As buttons. Now the file dialog can only be closed by clicking the 'x'. My intuition tells me that in this particular case it might be a good idea to not open the second file dialog instance while the first one is still opened. That's my diagnosis, maybe somebody else knows how to prevent improperly nested file dialogs tastefully.
1D_Inc commented 1 year ago

Previously a file dialog in Blender was opened fullscreen instead of a window (which was a nice solution to win 95 window file dialog style, still presented in industry standards - so you can work with long paths and view lots of data).
Does it influence?

Previously a file dialog in Blender was opened fullscreen instead of a window (which was a nice solution to win 95 window file dialog style, still presented in industry standards - so you can work with long paths and view lots of data). Does it influence?
Collaborator

This report is not appearing in normal searches and crash wasn't fixed in 3.0.0 release. So setting back #bf_blender project

This report is not appearing in normal searches and crash wasn't fixed in 3.0.0 release. So setting back #bf_blender project
Collaborator

Added subscriber: @PsychoFisch

Added subscriber: @PsychoFisch
Collaborator

Added subscribers: @JulianEisel, @lichtwerk

Added subscribers: @JulianEisel, @lichtwerk
Collaborator

Caused by 796412dca0 btw.

@JulianEisel:I know you have a fix ready already, mind getting that reviewed/pushed somehow?

Caused by 796412dca0 btw. @JulianEisel:I know you have a fix ready already, mind getting that reviewed/pushed somehow?
lichtwerk changed title from Crash when saving after pressing ctrl+S twice. to Regression: Crash when saving after pressing ctrl+S twice. 11 months ago

Added subscriber: @kmcurry

Added subscriber: @kmcurry
Jake-Faulkner was unassigned by ideasman42 9 months ago
JulianEisel was assigned by ideasman42 9 months ago
Owner

Added subscriber: @Jake-Faulkner

Added subscriber: @Jake-Faulkner
Collaborator

Alright so:

Alright so: - [D13441: Fix #88570: Crash when saving after pressing ctrl+S twice.](https://archive.blender.org/developer/D13441): This solves the crash reported here. It tries to do so on the design level by introducing a well defined context that "owns" the file browser and for executing the file operation in. It may unveil some further issues. - [D14905: Fix for crash opening the file selector multiple times](https://archive.blender.org/developer/D14905) (by @ideasman42): This is one such issue unveiled by the fix above. It fixes dangling pointers. - [D13459: Restrict temp/Maximized/Fullscreen window editing](https://archive.blender.org/developer/D13459) (by @Jake-Faulkner): This prevents more undefined state that causes issues. Editing of temporary/modal screens is supposed to be disabled, see 87aca8bd02, but that commit didn't cover enough cases.
Collaborator

Added subscriber: @ideasman42

Added subscriber: @ideasman42
Collaborator

This issue was referenced by bc8e030a84

This issue was referenced by bc8e030a84001cc4b0ed870e607b3f94d32faf82
Collaborator

This issue was referenced by 7849b56c3c

This issue was referenced by 7849b56c3c41c00af1008652936bda5ea5e3e175
Collaborator

Changed status from 'Confirmed' to: 'Resolved'

Changed status from 'Confirmed' to: 'Resolved'
JulianEisel closed this issue 9 months ago
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/Collada
Interest/Compositing
Interest/Core
Interest/Cycles
Interest/Dependency Graph
Interest/Development Management
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/Modeling
Interest/Modifiers
Interest/Motion Tracking
Interest/Nodes & Physics
Interest/Overrides
Interest/Performance
Interest/Performance
Interest/Physics
Interest/Pipeline, Assets & I/O
Interest/Platforms, Builds, Tests & Devices
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
legacy module/Animation & Rigging
legacy module/Core
legacy module/Development Management
legacy module/Eevee & Viewport
legacy module/Grease Pencil
legacy module/Modeling
legacy module/Nodes & Physics
legacy module/Pipeline, Assets & IO
legacy module/Platforms, Builds, Tests & Devices
legacy module/Python API
legacy module/Rendering & Cycles
legacy module/Sculpt, Paint & Texture
legacy module/Triaging
legacy module/User Interface
legacy module/VFX & Video
legacy project/1.0.0-beta.2
legacy project/Asset Browser (Archived)
legacy project/BF Blender: 2.8
legacy project/BF Blender: After Release
legacy project/BF Blender: Next
legacy project/BF Blender: Regressions
legacy project/BF Blender: Unconfirmed
legacy project/Blender 2.70
legacy project/Code Quest
legacy project/Datablocks and Libraries
legacy project/Eevee
legacy project/Game Animation
legacy project/Game Audio
legacy project/Game Data Conversion
legacy project/Game Engine
legacy project/Game Logic
legacy project/Game Physics
legacy project/Game Python
legacy project/Game Rendering
legacy project/Game UI
legacy project/GPU / Viewport
legacy project/GSoC
legacy project/Infrastructure: Websites
legacy project/LibOverrides - Usability and UX
legacy project/Milestone 1: Basic, Local Asset Browser
legacy project/Nodes
legacy project/OpenGL Error
legacy project/Papercut
legacy project/Pose Library Basics
legacy project/Retrospective
legacy project/Tracker Curfew
legacy project/Wintab High Frequency
Meta/Good First Issue
Meta/Papercut
migration/requires-manual-verification
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 & Devices
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 Information 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
No Assignees
15 Participants
Notifications
Due Date

No due date set.

Dependencies

No dependencies set.

Reference: blender/blender#88570
Loading…
There is no content yet.