To set stereo 3d mode to Time Sequential may crash Blender #44688

Closed
opened 2015-05-13 00:11:37 +02:00 by Dalai Felinto · 27 comments

System Information
OSX 10.9.5 but I also suspect Linux have this issue.

Short description of error
When setting 3D to Time Sequential (aka Quadbuffer) Blender duplicates the window (see wm_stereo3d_set_exec), when 'time sequential is not supported, the menu lingers open, and leads to a crash after I try to press OK, or simply click around the UI.

Also, if I try to change the stereo mode in the python console it works fine:
bpy.ops.wm.set_stereo_3d(display_mode='TIMESEQUENTIAL')

Exact steps for others to reproduce the error

  • Turn on Views (in the Render Layer panel)
  • Set Stereo 3D mode to Time Sequential (in the Info Header > Window > Set Stereo 3D, 'Time Sequential')

Now quit the menu (esc), or just click anywhere in the UI and boom !

Program received signal EXC_BAD_ACCESS, Could not access memory.
Reason: 13 at address: 0x0000000000000000
0x000000010002df45 in wm_operator_ui_popup_cancel (C=0x107f11ea8, userData=0x108fd6ea8) at //blender/windowmanager/intern/wm_operators.c:1657
1657			if (op->type->cancel) {

This may be related to the 'broken pop UI' I get when Quadbuffer is not supported:
time-sequential.jpg
(look at the exclamation mark on the left)

**System Information** OSX 10.9.5 but I also suspect Linux have this issue. **Short description of error** When setting 3D to Time Sequential (aka Quadbuffer) Blender duplicates the window (see `wm_stereo3d_set_exec`), when 'time sequential is not supported, the menu lingers open, and leads to a crash after I try to press OK, or simply click around the UI. Also, if I try to change the stereo mode in the python console it works fine: `bpy.ops.wm.set_stereo_3d(display_mode='TIMESEQUENTIAL')` **Exact steps for others to reproduce the error** * Turn on Views (in the Render Layer panel) * Set Stereo 3D mode to Time Sequential (in the Info Header > Window > Set Stereo 3D, 'Time Sequential') Now quit the menu (esc), or just click anywhere in the UI and boom ! ``` Program received signal EXC_BAD_ACCESS, Could not access memory. Reason: 13 at address: 0x0000000000000000 0x000000010002df45 in wm_operator_ui_popup_cancel (C=0x107f11ea8, userData=0x108fd6ea8) at //blender/windowmanager/intern/wm_operators.c:1657 1657 if (op->type->cancel) { ``` This may be related to the 'broken pop UI' I get when Quadbuffer is not supported: ![time-sequential.jpg](https://archive.blender.org/developer/F173628/time-sequential.jpg) (look at the exclamation mark on the left)
Author
Owner

Changed status to: 'Open'

Changed status to: 'Open'
Author
Owner

Added subscriber: @dfelinto

Added subscriber: @dfelinto

Added subscriber: @sindra1961

Added subscriber: @sindra1961

It crashes when I perform something in the pop-up window after a warning mark appeared.
However, it does not crash when I click another place of 3dview in defiance of it.
The error of not supporting Quad-buffer in a log file is recorded.

result.txt

It crashes when I perform something in the pop-up window after a warning mark appeared. However, it does not crash when I click another place of 3dview in defiance of it. The error of not supporting Quad-buffer in a log file is recorded. [result.txt](https://archive.blender.org/developer/F173743/result.txt)
Author
Owner

Added subscriber: @ideasman42

Added subscriber: @ideasman42
Author
Owner

@ideasman42 any chance you could look at that? This seems related to context/operator getting buggy after windows duplication

@ideasman42 any chance you could look at that? This seems related to context/operator getting buggy after windows duplication

Added subscriber: @Sergey

Added subscriber: @Sergey
Author
Owner

For the records, in some systems, there is a crash that happens prior to the real issue. So for general testing the patch below helps to reproduce the issue in some linuxes too.

diff --git a/source/blender/windowmanager/intern/wm_stereo.c b/source/blender/windowmanager/intern/wm_stereo.c
index 717583f..cffcbd8 100644
--- a/source/blender/windowmanager/intern/wm_stereo.c
+++ b/source/blender/windowmanager/intern/wm_stereo.c
@@ -463,8 +463,23 @@ int wm_stereo3d_set_exec(bContext *C, wmOperator *op)
        }
 
        s3dd = op->customdata;
-       *win->stereo3d_format = s3dd->stereo3d_format;
+       //*win->stereo3d_format = s3dd->stereo3d_format;
 
+#if 1
+       if (s3dd->stereo3d_format.display_mode == S3D_DISPLAY_PAGEFLIP) {
+               /* pageflip requires a new window to be created with the proper OS flags */
+               if (wm_window_duplicate_exec(C, op) == OPERATOR_FINISHED) {
+                       wmWindow *win_new = wm->windows.last;
+                       wm_window_close(C, wm, win_new);
+                       BKE_report(op->reports, RPT_ERROR, "Quad-buffer not supported by the system");
+               }
+               else {
+                       BKE_report(op->reports, RPT_ERROR,
+                                  "Failed to create a window compatible with the time sequential display method");
+                       win->stereo3d_format->display_mode = prev_display_mode;
+               }
+       }
+#else
        if (prev_display_mode == S3D_DISPLAY_PAGEFLIP &&
            prev_display_mode != win->stereo3d_format->display_mode)
        {
@@ -497,6 +512,7 @@ int wm_stereo3d_set_exec(bContext *C, wmOperator *op)
                        win->stereo3d_format->display_mode = prev_display_mode;
                }
        }
+#endif
 
        if (wm_stereo3d_is_fullscreen_required(s3dd->stereo3d_format.display_mode)) {
                if (!is_fullscreen) {
For the records, in some systems, there is a crash that happens prior to the real issue. So for general testing the patch below helps to reproduce the issue in some linuxes too. ``` diff --git a/source/blender/windowmanager/intern/wm_stereo.c b/source/blender/windowmanager/intern/wm_stereo.c index 717583f..cffcbd8 100644 --- a/source/blender/windowmanager/intern/wm_stereo.c +++ b/source/blender/windowmanager/intern/wm_stereo.c @@ -463,8 +463,23 @@ int wm_stereo3d_set_exec(bContext *C, wmOperator *op) } s3dd = op->customdata; - *win->stereo3d_format = s3dd->stereo3d_format; + //*win->stereo3d_format = s3dd->stereo3d_format; +#if 1 + if (s3dd->stereo3d_format.display_mode == S3D_DISPLAY_PAGEFLIP) { + /* pageflip requires a new window to be created with the proper OS flags */ + if (wm_window_duplicate_exec(C, op) == OPERATOR_FINISHED) { + wmWindow *win_new = wm->windows.last; + wm_window_close(C, wm, win_new); + BKE_report(op->reports, RPT_ERROR, "Quad-buffer not supported by the system"); + } + else { + BKE_report(op->reports, RPT_ERROR, + "Failed to create a window compatible with the time sequential display method"); + win->stereo3d_format->display_mode = prev_display_mode; + } + } +#else if (prev_display_mode == S3D_DISPLAY_PAGEFLIP && prev_display_mode != win->stereo3d_format->display_mode) { @@ -497,6 +512,7 @@ int wm_stereo3d_set_exec(bContext *C, wmOperator *op) win->stereo3d_format->display_mode = prev_display_mode; } } +#endif if (wm_stereo3d_is_fullscreen_required(s3dd->stereo3d_format.display_mode)) { if (!is_fullscreen) { ```
Campbell Barton was assigned by Sergey Sharybin 2015-05-25 20:28:03 +02:00

@ideasman42, afraid you know this are better than me. Mind having a look and give some help to Dalai?

@ideasman42, afraid you know this are better than me. Mind having a look and give some help to Dalai?

This issue was referenced by d9b6768521

This issue was referenced by d9b67685210275a71bd22b4f8c35590bf795eb47

Changed status from 'Open' to: 'Resolved'

Changed status from 'Open' to: 'Resolved'
Author
Owner

@ideasman42 after your commit I get the following crash:

Program received signal EXC_BAD_ACCESS, Could not access memory.
Reason: 13 at address: 0x0000000000000000
0x00000001012f8537 in BLI_remlink (listbase=0x10b300408, vlink=0x10b65a768) at /Users/dfelinto/blender/git/blender/source/blender/blenlib/intern/listbase.c:111
111		if (link->next) link->next->prev = link->prev;
(gdb) bt
- 0  0x00000001012f8537 in BLI_remlink (listbase=0x10b300408, vlink=0x10b65a768) at /Users/dfelinto/blender/git/blender/source/blender/blenlib/intern/listbase.c:111
- 1  0x000000010001773b in wm_event_do_handlers (C=0x107f11d68) at /Users/dfelinto/blender/git/blender/source/blender/windowmanager/intern/wm_event_system.c:2468
- 2  0x000000010000bc1e in WM_main (C=0x107f11d68) at /Users/dfelinto/blender/git/blender/source/blender/windowmanager/intern/wm.c:487
- 3  0x0000000100007391 in main (argc=1, argv=0x7fff5fbff740) at /Users/dfelinto/blender/git/blender/source/creator/creator.c:1882
Current language:  auto; currently minimal

(OSX here) is it working in your computer? Do you see the error message popup?

@ideasman42 after your commit I get the following crash: ``` Program received signal EXC_BAD_ACCESS, Could not access memory. Reason: 13 at address: 0x0000000000000000 0x00000001012f8537 in BLI_remlink (listbase=0x10b300408, vlink=0x10b65a768) at /Users/dfelinto/blender/git/blender/source/blender/blenlib/intern/listbase.c:111 111 if (link->next) link->next->prev = link->prev; (gdb) bt - 0 0x00000001012f8537 in BLI_remlink (listbase=0x10b300408, vlink=0x10b65a768) at /Users/dfelinto/blender/git/blender/source/blender/blenlib/intern/listbase.c:111 - 1 0x000000010001773b in wm_event_do_handlers (C=0x107f11d68) at /Users/dfelinto/blender/git/blender/source/blender/windowmanager/intern/wm_event_system.c:2468 - 2 0x000000010000bc1e in WM_main (C=0x107f11d68) at /Users/dfelinto/blender/git/blender/source/blender/windowmanager/intern/wm.c:487 - 3 0x0000000100007391 in main (argc=1, argv=0x7fff5fbff740) at /Users/dfelinto/blender/git/blender/source/creator/creator.c:1882 Current language: auto; currently minimal ``` (OSX here) is it working in your computer? Do you see the error message popup?

@dfelinto, could you try with 95b9d6d9c2 or later?

(I had to trick Blender into thinking the OpenGL state was OK to test the patch, think its fixed now)

@dfelinto, could you try with 95b9d6d9c2 or later? (I had to trick Blender into thinking the OpenGL state was OK to test the patch, think its fixed now)
Author
Owner

@ideasman42 it's almost there. When the window is NOT in fullscreen it no longer crashes. If I set fullscreen first (Alt+F11) I then get the same segfault as above (listbase.c:111)

@ideasman42 it's almost there. When the window is NOT in fullscreen it no longer crashes. If I set fullscreen first (Alt+F11) I then get the same segfault as above (listbase.c:111)

@dfelinto, As you did before, could you make a patch which will crash? without the system having to support 3d hardware I don't have? :)

Re-opening bug so we dont forget about it for release.

@dfelinto, As you did before, could you make a patch which will crash? *without the system having to support 3d hardware I don't have?* :) Re-opening bug so we dont forget about it for release.

Changed status from 'Resolved' to: 'Open'

Changed status from 'Resolved' to: 'Open'

Removed subscriber: @sindra1961

Removed subscriber: @sindra1961
Author
Owner

Added subscriber: @ThomasDinges

Added subscriber: @ThomasDinges
Author
Owner

I can't reproduce the issue (Alt+F11) on linux, @ThomasDinges can you try that on windows to see if it's OSX specific?

How to test:

  1. Alt+F11
  2. Turn on Views
  3. Set Stereo 3D mode to Time Sequential
I can't reproduce the issue (Alt+F11) on linux, @ThomasDinges can you try that on windows to see if it's OSX specific? How to test: 1. Alt+F11 2. Turn on Views 3. Set Stereo 3D mode to Time Sequential

Managed to get a crash with the popup, should be really fixed this time. b54e95a5c8

But theres still a crash:

  • Alt+F10

  • Alt+F11

  • Set Stereo 3D -> Time Sequential

    • 0 0x43c2543 in BLI_strnlen /src/blender/source/blender/blenlib/intern/string.c:726
    • 1 0x43bee6b in BLI_strncpy /src/blender/source/blender/blenlib/intern/string.c:116
    • 2 0xa44055 in wm_window_copy /src/blender/source/blender/windowmanager/intern/wm_window.c:258
    • 3 0xa4798d in wm_window_duplicate_exec /src/blender/source/blender/windowmanager/intern/wm_window.c:622
    • 4 0xa52109 in wm_stereo3d_set_exec /src/blender/source/blender/windowmanager/intern/wm_stereo.c:484
    • 5 0x9d598b in wm_operator_exec /src/blender/source/blender/windowmanager/intern/wm_event_system.c:771
    • 6 0x9d5f79 in WM_operator_call_ex /src/blender/source/blender/windowmanager/intern/wm_event_system.c:823
    • 7 0xa1cfa1 in dialog_exec_cb /src/blender/source/blender/windowmanager/intern/wm_operators.c:1563
    • 8 0x14f7336 in ui_apply_but_funcs_after /src/blender/source/blender/editors/interface/interface_handlers.c:742
    • 9 0x1560a17 in ui_popup_handler /src/blender/source/blender/editors/interface/interface_handlers.c:9810
    • 10 0x9d2998 in wm_handler_ui_call /src/blender/source/blender/windowmanager/intern/wm_event_system.c:457
    • 11 0x9e07a8 in wm_handlers_do_intern /src/blender/source/blender/windowmanager/intern/wm_event_system.c:2008
    • 12 0x9e1112 in wm_handlers_do /src/blender/source/blender/windowmanager/intern/wm_event_system.c:2092
    • 13 0x9e36d4 in wm_event_do_handlers /src/blender/source/blender/windowmanager/intern/wm_event_system.c:2375
    • 14 0x9b5a9b in WM_main /src/blender/source/blender/windowmanager/intern/wm.c:487
    • 15 0x9b2470 in main /src/blender/source/creator/creator.c:1887
    • 16 0x7f7778edc78f in __libc_start_main (/usr/lib/libc.so.6+0x2078f)
    • 17 0x9ab4a8 in _start (/src/cmake_debug/bin/blender+0x9ab4a8)
Managed to get a crash with the popup, should be really fixed this time. b54e95a5c8 But theres still a crash: - Alt+F10 - Alt+F11 - Set Stereo 3D -> Time Sequential - 0 0x43c2543 in BLI_strnlen /src/blender/source/blender/blenlib/intern/string.c:726 - 1 0x43bee6b in BLI_strncpy /src/blender/source/blender/blenlib/intern/string.c:116 - 2 0xa44055 in wm_window_copy /src/blender/source/blender/windowmanager/intern/wm_window.c:258 - 3 0xa4798d in wm_window_duplicate_exec /src/blender/source/blender/windowmanager/intern/wm_window.c:622 - 4 0xa52109 in wm_stereo3d_set_exec /src/blender/source/blender/windowmanager/intern/wm_stereo.c:484 - 5 0x9d598b in wm_operator_exec /src/blender/source/blender/windowmanager/intern/wm_event_system.c:771 - 6 0x9d5f79 in WM_operator_call_ex /src/blender/source/blender/windowmanager/intern/wm_event_system.c:823 - 7 0xa1cfa1 in dialog_exec_cb /src/blender/source/blender/windowmanager/intern/wm_operators.c:1563 - 8 0x14f7336 in ui_apply_but_funcs_after /src/blender/source/blender/editors/interface/interface_handlers.c:742 - 9 0x1560a17 in ui_popup_handler /src/blender/source/blender/editors/interface/interface_handlers.c:9810 - 10 0x9d2998 in wm_handler_ui_call /src/blender/source/blender/windowmanager/intern/wm_event_system.c:457 - 11 0x9e07a8 in wm_handlers_do_intern /src/blender/source/blender/windowmanager/intern/wm_event_system.c:2008 - 12 0x9e1112 in wm_handlers_do /src/blender/source/blender/windowmanager/intern/wm_event_system.c:2092 - 13 0x9e36d4 in wm_event_do_handlers /src/blender/source/blender/windowmanager/intern/wm_event_system.c:2375 - 14 0x9b5a9b in WM_main /src/blender/source/blender/windowmanager/intern/wm.c:487 - 15 0x9b2470 in main /src/blender/source/creator/creator.c:1887 - 16 0x7f7778edc78f in __libc_start_main (/usr/lib/libc.so.6+0x2078f) - 17 0x9ab4a8 in _start (/src/cmake_debug/bin/blender+0x9ab4a8)
Author
Owner

@ideasman42 you don't even need Alt+F11 for this crash in string.c, "Alt+F10, Set Stereo 3D > Time Sequencial" is enough. I'll look at that. I still get the Alt + F11 crash, but it's probably OSX only.

@ideasman42 you don't even need Alt+F11 for this crash in string.c, "Alt+F10, Set Stereo 3D > Time Sequencial" is enough. I'll look at that. I still get the Alt + F11 crash, but it's probably OSX only.

@dfelinto,

Looks like making ED_screen_duplicate support non-normal screens will fix.
Just need to make sure the screen state remains valid at all times. (when using a temp screen for eg).

Note that testing different fixes here was getting problematic. Committed 962f764d58 to avoid calling operator exec to duplicate screen (so its easier to add args if we want).

@dfelinto, Looks like making `ED_screen_duplicate` support non-normal screens will fix. Just need to make sure the screen state remains valid at all times. (when using a temp screen for eg). Note that testing different fixes here was getting problematic. Committed 962f764d58 to avoid calling operator exec to duplicate screen (so its easier to add args if we want).
Campbell Barton removed their assignment 2015-06-08 17:45:45 +02:00
Dalai Felinto was assigned by Campbell Barton 2015-06-08 17:45:45 +02:00

@dfelinto, is this fixed now?

If not, would be good to note what fails exactly, AFAICS there were 2 bugs which are resolved.

@dfelinto, is this fixed now? If not, would be good to note what fails exactly, AFAICS there were 2 bugs which are resolved.
Author
Owner

@ideasman42 apart from the fullwindow (Alt + F11) issue in OSX, I believe the bug is fixed. I'm yet to confirm if we didn't break quadbuffer support for computers that can handle it, so I will wait to close this until later this week.

@ideasman42 apart from the fullwindow (Alt + F11) issue in OSX, I believe the bug is fixed. I'm yet to confirm if we didn't break quadbuffer support for computers that can handle it, so I will wait to close this until later this week.

@dfelinto. maybe am being a bit picky - but the state of this report is confusing now.
If I had OSX and wanted to fix I wouldn't even know where to start.
Maybe this report could be closed,. Then open new report with remaining issue?

Its just this is potentially holding up release, so leaving it in some unknown state means its hard keep track of what needs doing.

@dfelinto. maybe am being a bit picky - but the state of this report is confusing now. If I had OSX and wanted to fix I wouldn't even know where to start. Maybe this report could be closed,. Then open new report with remaining issue? Its just this is potentially holding up release, so leaving it in some unknown state means its hard keep track of what needs doing.
Author
Owner

Changed status from 'Open' to: 'Resolved'

Changed status from 'Open' to: 'Resolved'
Author
Owner

OK, I just tested master in a quadbuffer compatible station and things are working from either fullscreen (Alt+F11) or windowed modes.

I'm closing this now and I'll report the fullscreen + OSX issue separately later.

Out of curiosity, when in fullscreen (Alt + F11) in Linux, after toggling Pageflip mode, the new window is not fullscreen. I think this is a minor drawback, so nothing to worry about.

OK, I just tested master in a quadbuffer compatible station and things are working from either fullscreen (Alt+F11) or windowed modes. I'm closing this now and I'll report the fullscreen + OSX issue separately later. Out of curiosity, when in fullscreen (Alt + F11) in Linux, after toggling Pageflip mode, the new window is not fullscreen. I think this is a minor drawback, so nothing to worry about.
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
No Assignees
5 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#44688
No description provided.