Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Opening preferences crashes Blender 4.2 in version 0.0.22 #191

Open
dsaltm opened this issue Sep 5, 2024 · 18 comments
Open

Opening preferences crashes Blender 4.2 in version 0.0.22 #191

dsaltm opened this issue Sep 5, 2024 · 18 comments
Labels
bug Something isn't working
Milestone

Comments

@dsaltm
Copy link

dsaltm commented Sep 5, 2024

Just testing the updated extension (version 0.0.22) and in Blender 4.2.0 and 4.2.1 trying to open the preferences crashes Blender with an error.

Windows 11
Error : EXCEPTION_ACCESS_VIOLATION
Address : 0x00007FFFB194562A
Module : python311.dll
Thread : 00005ab8
Writing: C:\Users\Dan\AppData\Local\Temp\blender.crash.txt

@dsaltm
Copy link
Author

dsaltm commented Sep 5, 2024

(Also tried with the portable version and same result)

@Mateusz-Grzelinski Mateusz-Grzelinski added the bug Something isn't working label Sep 5, 2024
@Mateusz-Grzelinski
Copy link
Collaborator

In my case 4.2.0 works fine.

I just downloaded newest 4.2.1 and it is also fine.

I will need more info to debug the issue.
You can also try https://github.com/JacquesLucke/blender_vscode?tab=readme-ov-file#how-can-i-separate-development-environment-from-my-daily-work

@Mateusz-Grzelinski Mateusz-Grzelinski added this to the 0.0.23 milestone Sep 5, 2024
@F-Brar
Copy link

F-Brar commented Sep 6, 2024

I can confirm this bug on Blender 4.2.1 in macOS (14.6.1). Here is the crash report:


# Blender 4.2.1, Commit date: 2024-08-19 11:21, Hash 396f546c9d82

# backtrace
0   Blender                             0x000000010573d0a8 BLI_system_backtrace + 56
1   Blender                             0x0000000104e73904 _ZL16sig_handle_crashi + 364
2   libsystem_platform.dylib            0x0000000193ebb584 _sigtramp + 56
3   Blender                             0x000000010964f43c module_getattro + 112
4   Blender                             0x000000010964f43c module_getattro + 112
5   Blender                             0x0000000109651604 _PyObject_LookupAttr + 140
6   Blender                             0x00000001096d713c builtin_getattr + 84
7   Blender                             0x000000010964d138 cfunction_vectorcall_FASTCALL + 260
8   Blender                             0x0000000109602bb0 PyObject_Vectorcall + 80
9   Blender                             0x00000001096e29f4 _PyEval_EvalFrameDefault + 33812
10  Blender                             0x00000001096da540 _PyEval_Vector + 200
11  Blender                             0x0000000105d6b3d4 _ZL14bpy_class_callP8bContextP10PointerRNAP11FunctionRNAP13ParameterList + 1240
12  Blender                             0x0000000105d02118 _ZL10panel_drawPK8bContextP5Panel + 120
13  Blender                             0x0000000105d86644 _ZL13ed_panel_drawPK8bContextP7ARegionP8ListBaseP9PanelTypeP5PaneliiPcPKc21wmOperatorCallContext + 1024
14  Blender                             0x0000000105d85e2c _Z26ED_region_panels_layout_exPK8bContextP7ARegionP8ListBase21wmOperatorCallContextPPKcS8_ + 756
15  Blender                             0x0000000106827b34 _ZL27userpref_main_region_layoutPK8bContextP7ARegion + 168
16  Blender                             0x0000000105d80a60 _Z19ED_region_do_layoutP8bContextP7ARegion + 132
17  Blender                             0x0000000105795ed8 _Z14wm_draw_updateP8bContext + 1212
18  Blender                             0x0000000105791bb0 _Z7WM_mainP8bContext + 52
19  Blender                             0x0000000104e6ec94 main + 884
20  dyld                                0x0000000193b020e0 start + 2360

# Python backtrace
  File "/Applications/Blender421.app/Contents/Resources/4.2/scripts/modules/addon_utils.py", line 1818 in _extensions_warnings_get
  File "/Applications/Blender421.app/Contents/Resources/4.2/scripts/addons_core/bl_pkg/bl_extension_ui.py", line 453 in addons_panel_draw_items
  File "/Applications/Blender421.app/Contents/Resources/4.2/scripts/addons_core/bl_pkg/bl_extension_ui.py", line 713 in addons_panel_draw_impl
  File "/Applications/Blender421.app/Contents/Resources/4.2/scripts/addons_core/bl_pkg/bl_extension_ui.py", line 792 in addons_panel_draw
  File "/Applications/Blender421.app/Contents/Resources/4.2/scripts/modules/bpy_types.py", line 1034 in draw_ls

@dsaltm dsaltm changed the title Opening preferences crashes Blender 4.2 in version 0.0.22 on Windows 11 Opening preferences crashes Blender 4.2 in version 0.0.22 Sep 6, 2024
@dsaltm
Copy link
Author

dsaltm commented Sep 6, 2024

After inspecting the crash txt file, this was the python backtrace on Windows 11 as well...

# Python backtrace
  File "C:\Program Files\Blender Foundation\blender-4.2.0-candidate+v42.4d6ba7604dcc-windows.amd64-release\4.2\scripts\modules\addon_utils.py", line 1647 in _extensions_warnings_get
  File "C:\Program Files\Blender Foundation\blender-4.2.0-candidate+v42.4d6ba7604dcc-windows.amd64-release\4.2\scripts\addons_core\bl_pkg\bl_extension_ui.py", line 436 in addons_panel_draw_items
  File "C:\Program Files\Blender Foundation\blender-4.2.0-candidate+v42.4d6ba7604dcc-windows.amd64-release\4.2\scripts\addons_core\bl_pkg\bl_extension_ui.py", line 681 in addons_panel_draw_impl
  File "C:\Program Files\Blender Foundation\blender-4.2.0-candidate+v42.4d6ba7604dcc-windows.amd64-release\4.2\scripts\addons_core\bl_pkg\bl_extension_ui.py", line 759 in addons_panel_draw
  File "C:\Program Files\Blender Foundation\blender-4.2.0-candidate+v42.4d6ba7604dcc-windows.amd64-release\4.2\scripts\modules\bpy_types.py", line 1034 in draw_ls

@F-Brar
Copy link

F-Brar commented Sep 6, 2024

For some reason, now the same happens in version 0.0.21. I am almost 100% certain that I was able to open preferences in Blender just fine before installing 0.0.22 the first time... I used Blender for a month without noticing such crashes.

@F-Brar
Copy link

F-Brar commented Sep 6, 2024

The crash only happens when clicking on the extensions or add-on tab in blenders settings.

I did more testing and the crash happens even with version 0.0.21 in a fresh portable install of Blender 4.2.1. I am still pretty sure that this worked fine, but in all my tests I wasn't able to open the extensions tab without crashing. I also tested using the BLENDER_USER_RESOURCES folder, but with the same result.
The following warnings showed up using both methods, but I guess that's not the cause of the bug:

Warning: extensions.blender.org: [Errno 2] No such file or directory: './blender_vscode_development/extensions/blender_org'
Warning: User Default: [Errno 2] No such file or directory: './blender_vscode_development/extensions/user_default'

Let me know if you need me to test anything else.

@F-Brar
Copy link

F-Brar commented Sep 6, 2024

I am not sure if this is related but in the vscode tasks output, the following error prints (twice) whenever I execute Blender: Start:

Error: there is no registered task type '9710d853e5'. Did you miss installing an extension that provides a corresponding task provider?
Error: there is no registered task type '9710d853e5'. Did you miss installing an extension that provides a corresponding task provider?

@F-Brar
Copy link

F-Brar commented Sep 6, 2024

Btw: After the crash, everything seems to work fine, when I start Blender without vscode.

@Mateusz-Grzelinski
Copy link
Collaborator

Mateusz-Grzelinski commented Sep 6, 2024

Warning: extensions.blender.org: [Errno 2] No such file or directory: './blender_vscode_development/extensions/blender_org'

I have seen it multiple times during development, should not be an issue.

Error: there is no registered task type '9710d853e5'. Did you miss installing an extension that provides a corresponding task provider?

this is a new one.

I just reproduced the crash on 4.2.1. As the same as you the backtrace fails on _extensions_warnings_get -> that mean there is an error with extensions that causes blender to crash.

Even better: after disabling check for updates on startup I can not even open the preferences.

I tried also disabling the code for creating dedicated repo, enabling --log-level -1 --debug-all, it crashes consistantly. It does not matter if I want to develop addon or extension (i removed the blender_manifest.toml)

wm_window_make_drawable: set drawable 1
UI_menutype_draw: opening menu "TOPBAR_MT_editor_menus"
UI_menutype_draw: opening menu "TIME_MT_editor_menus"
UI_menutype_draw: opening menu "VIEW3D_MT_editor_menus"
wm_window_make_drawable: set drawable 2
Repository data: C:\Users\grzel\AppData\Roaming\Blender Foundation\Blender\4.2\extensions\blender_org not found, sync required!
fake_module C:\Users\grzel\AppData\Roaming\Blender Foundation\Blender\4.2\extensions\user_default\leagacy_and_extension\__init__.py bl_ext.user_default.leagacy_and_extension
Warning: add-on missing manifest, this can cause poor performance!: 'C:\\Users\\grzel\\AppData\\Roaming\\Blender Foundation\\Blender\\4.2\\extensions\\user_default\\leagacy_and_extension\\blender_manifest.toml'
Error   : EXCEPTION_ACCESS_VIOLATION
Address : 0x00007FFC4AE3562A
Module  : python311.dll
Thread  : 00004734
Writing: C:\Users\grzel\AppData\Local\Temp\blender.crash.txt

 *  The terminal process "E:\BlenderProjects\bledner.exe\blender-4.2.1-windows-x64\blender-4.2.1-windows-x64\blender.exe '--python', 'e:\BlenderProjects\blender_vscode\pythonFiles\launch.py', '--debug-all', '--log-level', '-1'" terminated with exit code: 11. 

Also tried older version of debugpy-1.7.0

I dont think this is something we can resolve here. Lets check with blender developers.

@Mateusz-Grzelinski Mateusz-Grzelinski modified the milestones: 0.0.23, 0.0.24 Sep 7, 2024
@F-Brar
Copy link

F-Brar commented Sep 8, 2024

Thanks again for looking into this. I filed a bug report in the Blender repo: https://projects.blender.org/blender/blender/issues/127309

@Mateusz-Grzelinski
Copy link
Collaborator

Mateusz-Grzelinski commented Sep 9, 2024

Found an issue: it is dependency of dependency that is broken: dependency of flask called werkzeug:

werkzeug-3.0.4.dist-info - broken
Werkzeug-3.0.3.dist-info - works

stored in AppData\Roaming\Blender Foundation\Blender\4.2\scripts\modules

In order to fix do something like (not tested extensively):

E:\BlenderProjects\bledner.exe\blender-4.2.1-windows-x64\blender-4.2.1-windows-x64\4.2\python\bin\python.exe -m pip install werkzeug==2.2.3 --target "C:\Users\grzel\AppData\Roaming\Blender Foundation\Blender\4.2\scripts\modules"

A proper fix is not obvious as we can not remove/downgrade loaded python modules: https://projects.blender.org/blender/blender/issues/125049

@F-Brar
Copy link

F-Brar commented Sep 10, 2024

Yes, after replacing werkzeug 3.x with 2.2.3 I am able to open settings too on macOS. 👏

Mateusz-Grzelinski added a commit that referenced this issue Sep 11, 2024
Werkzeug 3.0.4 causes blender to crash when opening preferences. Werkzeug is flask dependency.
Pin also falsk, just to be sure.

This change will not fix existing setups.
Mateusz-Grzelinski added a commit to Mateusz-Grzelinski/blender_vscode that referenced this issue Sep 11, 2024
- use one pip call to install dependencies. It allows to correctly handle constraints.
- when package is outside of constraints, perform clean installation. Clean installation in most cases is not necessary but with --target it has strange corner cases.
- commit semver dependency with code
@blastframe
Copy link

blastframe commented Sep 12, 2024

Same here with Blender 4.3 - Edit > Preferences crashes Blender with Blender Development enabled

System Information
Operating system: macOS-14.5-arm64-arm-64bit 64 Bits
Graphics card: Metal API Apple M1 Max 1.2

Blender Version
Broken: version: 4.3.0 Alpha, branch: main, commit date: 2024-09-08 20:54, hash: 1bc0ec1b80a1

# backtrace
0   Blender                             0x000000010364870c BLI_system_backtrace + 56
1   Blender                             0x0000000102d801e4 _ZL16sig_handle_crashi + 360
2   libsystem_platform.dylib            0x000000019589b584 _sigtramp + 56
3   Blender                             0x000000010767c56c module_getattro + 112
4   Blender                             0x000000010767c56c module_getattro + 112
5   Blender                             0x000000010767e734 _PyObject_LookupAttr + 140
6   Blender                             0x00000001077045f8 builtin_getattr + 84
7   Blender                             0x000000010767a268 cfunction_vectorcall_FASTCALL + 260
8   Blender                             0x000000010762fbe4 PyObject_Vectorcall + 80
9   Blender                             0x000000010770fe98 _PyEval_EvalFrameDefault + 33788
10  Blender                             0x00000001077079fc _PyEval_Vector + 200
11  Blender                             0x0000000103cb2924 _ZL14bpy_class_callP8bContextP10PointerRNAP11FunctionRNAP13ParameterList + 1240
12  Blender                             0x0000000103c48e60 _ZL10panel_drawPK8bContextP5Panel + 120
13  Blender                             0x0000000103ccd6ac _ZL13ed_panel_drawPK8bContextP7ARegionP8ListBaseP9PanelTypeP5PaneliiPcPKc21wmOperatorCallContext + 1024
14  Blender                             0x0000000103ccce94 _Z26ED_region_panels_layout_exPK8bContextP7ARegionP8ListBase21wmOperatorCallContextPPKcS8_ + 756
15  Blender                             0x0000000104842dc8 _ZL27userpref_main_region_layoutPK8bContextP7ARegion + 168
16  Blender                             0x0000000103cc7cd8 _Z19ED_region_do_layoutP8bContextP7ARegion + 132
17  Blender                             0x00000001036a1168 _Z14wm_draw_updateP8bContext + 1196
18  Blender                             0x000000010369cd24 _Z7WM_mainP8bContext + 52
19  Blender                             0x0000000102d7b534 main + 916
20  dyld                                0x00000001954e20e0 start + 2360

# Python backtrace
  File "/Applications/Blender 4.3.app/Contents/Resources/4.3/scripts/modules/addon_utils.py", line 1818 in _extensions_warnings_get
  File "/Applications/Blender 4.3.app/Contents/Resources/4.3/scripts/addons_core/bl_pkg/bl_extension_ui.py", line 1462 in extensions_panel_draw_impl
  File "/Applications/Blender 4.3.app/Contents/Resources/4.3/scripts/addons_core/bl_pkg/bl_extension_ui.py", line 2067 in extensions_panel_draw
  File "/Applications/Blender 4.3.app/Contents/Resources/4.3/scripts/modules/bpy_types.py", line 1037 in draw_ls

@Mateusz-Grzelinski
Copy link
Collaborator

Mateusz-Grzelinski commented Sep 12, 2024

The issue is not fixed by developers yet even in newest version, so this is expected. I asked Jack to release hotfix (look above) but there is dependency improvement upcoming, also look above

@zhuoqun-chen
Copy link

zhuoqun-chen commented Sep 28, 2024

Found an issue: it is dependency of dependency that is broken: dependency of flask called werkzeug:

werkzeug-3.0.4.dist-info - broken
Werkzeug-3.0.3.dist-info - works

stored in AppData\Roaming\Blender Foundation\Blender\4.2\scripts\modules

In order to fix do something like (not tested extensively):

E:\BlenderProjects\bledner.exe\blender-4.2.1-windows-x64\blender-4.2.1-windows-x64\4.2\python\bin\python.exe -m pip install werkzeug==2.2.3 --target "C:\Users\grzel\AppData\Roaming\Blender Foundation\Blender\4.2\scripts\modules"

A proper fix is not obvious as we can not remove/downgrade loaded python modules: https://projects.blender.org/blender/blender/issues/125049

Thx @Mateusz-Grzelinski, I had the same issue here during testing my extension in blender 4.2.2 and downgrade to Werkzeug==2.2.3 solved my problem!

@jdknox
Copy link

jdknox commented Sep 30, 2024

The issue is not fixed by developers yet even in newest version, so this is expected. I asked Jack to release hotfix (look above) but there is dependency improvement upcoming, also look above

But wasn't the official fix already done in August as a workaround where open modules are flagged for deletion, and then they are deleted when Blender starts up the next time? Are they planning on a different fix? It's seems like their hands are probably tied because of Win32.

Campbell Barton's fix from August.
Issue closed here

@Mateusz-Grzelinski
Copy link
Collaborator

The issues you linked are related to uninstalling extension on windows.
The issues that I am observing are those ones:
https://projects.blender.org/blender/blender/issues/127282
https://projects.blender.org/blender/blender/issues/127097

@Mateusz-Grzelinski
Copy link
Collaborator

Should be fixed according to https://projects.blender.org/blender/blender/commit/9a252c2e73b9303d4c2c493c7a80a75a4b1629bc
Todo: Check which blender versions will get this fix

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

6 participants