Crash with some add-ons using OpenMP (conflict initializing) #125255
Labels
No Label
Interest
Alembic
Interest
Animation & Rigging
Interest
Asset System
Interest
Audio
Interest
Automated Testing
Interest
Blender Asset Bundle
Interest
BlendFile
Interest
Code Documentation
Interest
Collada
Interest
Compatibility
Interest
Compositing
Interest
Core
Interest
Cycles
Interest
Dependency Graph
Interest
Development Management
Interest
EEVEE
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
Viewport & EEVEE
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
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
Module
Viewport & EEVEE
Platform
FreeBSD
Platform
Linux
Platform
macOS
Platform
Windows
Severity
High
Severity
Low
Severity
Normal
Severity
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
12 Participants
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: blender/blender#125255
Loading…
Reference in New Issue
Block a user
No description provided.
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
EDIT since reporting, this looks to be a conflict with an add-ons use of OpenMP, not directly related to bevel ~ideasman42.
System Information
Operating system: MacOS 14.5
Graphics card: M3Max
Blender Version
Broken: 3.6.13, & 4.2
Worked: Neither
The second I hit CTRL + B and move the mouse to bevel an edge loop Blender immediately crashes before any visual representation of the bevel operation and goes straight to my desktop in both LTS versions of Blender.
Exact steps for others to reproduce the error
Add Cylinder
Select top or bottom edge loop
CTRL + B
move mouse
Crash straight to desktop
Also happens with mesh circle if I fill and extrude to be a cylinder shape (that's how it first started happening)
If I select all in edit mode and then bevel it works but that's not a fix
Hi, thanks for the report. Unable to confirm the crash. Could you share crash logs?: https://docs.blender.org/manual/en/dev/troubleshooting/crash.html#macos
Just in case here is the issue happening:
I can confirm that Blender also crashes to desktop in the same scenario on an Intel based machine.
System Information
Operating system: MacOS 14.5
Graphics card: AMD Radeon RX 6800 XT 16 GB
Blender Version
Broken: 4.2
Works as expected in Blender 4.1.1
Thanks, still unable to confirm. From logs, crash occurred during matrix calculation:
adjust_the_cycle_or_chain() -> EIG_linear_solver_solve()
@Alaska hi, can you replicate this on mac?
I am personally unable to reproduce the issue in Blender 4.2.0.
Does the issue occur if you use default settings?
File -> Default -> Load Factory Settings
Yes. It happens with Factory settings in both 3.6 and 4.2
Maybe there's some issue in macOS 14.5? I'm still on 14.4. I'll try updating and see how it goes.
Nope, updating to 14.5 didn't change the results for me.
@lichtwerk or @iss can you reproduce the issue on your Macs?
Nope can't repro here
This is disappointing. It is weird that it's also happening in 3.6 LTS. Maybe it's limited to M3 or maybe I need to completely remove blender from my system and reinstall?
You can try that but i don't think it would make any difference.
In 3.6, does it work with OpenGL backend? 🤔
No. Immediate crash.
I just did a test and it's working fine in Blender 4.1. So I guess that's my fix for now.
I also tried multiple 3.6 versions including 3.6.0 and they all crash immediately.
No crash here as well with MacOS 14.5 and 5700 XT
Bevel in Edit Modeto Crash with Bevel toolOperating system: MacOS 15.0
Graphics card: M3Pro
Blender Version 4.1
Hi, relatively new to Blender, and having the same issue, was working fine until recently but now whenever I try to bevel an edge Blender immediately crashes.
@Shane-Murphy-4 Does the issue occur in 4.2? And if it does, can you share a crash log? https://docs.blender.org/manual/en/dev/troubleshooting/crash.html#macos
@Alaska It occurs in 4.2 as well, I am attaching a crash log. Thank you.
Hello, I am experiencing the same issue. Strangely, the command works when I create a cube, for example, or even with Suzanne. However, as soon as I extrude something, Blender crashes immediately. I am attaching the crash log for reference.
On my Windows PC, I have the same add-ons and preferences, but no problems occur.
Oh, and when i use a bevel modifier it crashes too.
Thank you for sharing the information.
Considering we've now got 3 reports of the same issue, all with the same crash log, I believe we can confirm this issue. And since it is a crash, we should set it to high severity. Sadly it may not be fixed quickly as so far we haven't been able to confirm the issue.
I tried it on Blender 4.2.3 (the LTS) on MacOS 15.0.1, on a Macbook Pro with M3 silicon. It didn't crash.
The crash log shows it crashing in the Eigen routine that is called when trying to optimize the offsets when "loop slide" is on. But when I tested, loop slide was on, so I don't know what is going on.
Seeing people start to confirm this issue. I just want to update that’s it’s still happens in 4.2.3 with M3max.
The current fix is using blender 4.1.0.
It’s very strange. It doesn’t seem to be consistent under the same conditions.
I’m using an M2 Pro.
Erick-Phillips: I have an M3max too (but MacOS 15.0.1), and can't make it crash. Does it happen for you on the current Alpha build? https://builder.blender.org/download/daily/
Looking at a similar crash dump in imagemagick, I wonder if the issue is similar to what is discussed there -- that MacOS has an open MP library dynamic library (libomp.dylib) and it has already initialized openMP when we try to do it again.
Erick-Phllips, perhaps you could try this:
when Blender is running, in a command window, type
ps x | grep Blender
There should be two lines of output. The first one (has Blender.app in it) starts is a process id, e.g., 34922. Next type
lsof -p 34922 | grep libomp.dynlib
(replace 34922 with your actual process id)
and report the results here.
I don't have a Mac to check, but this issue is likely caused by the molecular + add-on, all the crash reports listed in this issue contain a library
core.cpython-311-darwin.so
UUID=93c964b4-c344-38a6-bdbc-ff9f8d748b9a
from an add-on in their image list. This UUID matches with the library in version 1.17.20 of the add-on. This library contains a statically linked copy of OpenMP which conflicts with Blender's version. Somebody already reported this issue to the add-on before: u3dreal/molecular-plus#43, but it doesn't seem like it got properly addressed there.I just removed the Molecular + add-on and everything is working fine again, thanks so much!
It was molecular+. Thank you.
Thanks for tracking this down everyone. I will see if there's a way to check for this and use a workaround for bevel that avoids using the linear solver if this problem exists. But likely there are other areas of Blender that use openmp (e.g., I suspect motion matching), that will also fail under such circumstances,
Crash with Bevel toolto Crash with some add-ons using OpenMP (conflict initializing)I think I just had the same problem, when I clicked "Solve Camera Motion" I got
I uninstalled the molecular+ addon and the crash didn't occur any more after that.
@howardt I don't think we should be adding code that checks for potential conflicts. Bevel is one potential user of OpenMP. There are other usages in Blender (Mataflow, Bullet, Libmv, quadriflow). There might be other usages that are out of our control (in libraries we use in Blender). It will be very messy to add checks in all those places.
I also don't think it is solvable on Blender side. Maybe if OpenMP was linked statically we could hide symbols and that would have avoided the issue. But it could cause other issues (the things that the error message mentions). And the same issue with conflict could happen with other libraries.
Additionally, even if we find something we can do from Blender side to work around Molecular+ issues, if some other add-on pulls in another copy of OpenMP we'll be back to the original issue.
I don't see why OpenMP is a requirement for Molecular+. The only related call is see is the call for
omp_set_max_active_levels(1)
. A commit message does not add clarity about why it is needed. From what I can see, there is nothing really essential and the OpenMP dependency can be removed form the add-on.If i am missing something and the dependency is required, then there are few possible solutions:
numpy
can take care of some heavy calculations?In any case, thanks everyone for the investigation. The issue needs to be reported to the Molecular+ repository. As long as it does the thing that is explicitly reported as very bad, we can not solve things form Blender side.
@Sergey It seems that molecular + uses OpenMP through Cython (
cython.parallel
), so that is probably why it links to it.Also, it might be useful to initialize OpenMP when Blender starts to make sure that this error is caught early when somebody tries to use their own OpenMP library. Something like calling
omp_get_max_threads()
in Blender's main might work to do that.Can it just assume dynamic linking and use our OpenMP? To ensure ABI compatibility can use headers from our precompiled libraries: https://projects.blender.org/blender/lib-macos_arm64/src/branch/main/openmp
That could help indeed! Not sure, maybe would need to have some
#ifdef
, as OpenMP is an optional dependency.Is it something you can help us looking into and create a PR?
@Sergey I made a pull request to call
omp_get_max_threads
in main: !130407. I don't have a macOS device to test with, but I was able to recreate the issue on Linux by using a modified libomp. The PR causes Blender to crash as soon as an add-on tries to initialize a second libomp, which in the case of molecular+ happens as soon as it loads.I was able to make the add-on link to Blender's libomp on Linux; I assume the same can be done on macOS as well. The libomp runtime shipped by Blender on macOS being an older version (9.0.1 I think) might cause issues when compiling with a newer Clang however, since it may try to link to symbols not present in the older runtime.
@jorn Thanks for the PR!
For the macOS I am not sure i fully understand. We ship the same exact libraries versions on Linux and macOS. So there shouldn't be any discrepancy between platforms.
The library we ship is also something we're using for Blender. So you "just" need to use header and dylib/so from the precompiled mcos/linux libraries to ensure there is no conflict?
On Linux blender normally uses libgomp (from GCC) statically instead of libomp (from LLVM). That's why I had to make blender use libomp on Linux to test the pr. Currently blender only ships with libomp on macOS, but if compiling using clang on Linux/Windows you can make it use libomp as well. The prebuilt libraries for those platforms do not have libomp so you'll have to use the toolchain's version. libgomp (GCC) and vcomp140 (MSVC) don't seem to care about duplicate runtimes.
About the version being older, there is this in
versions.cmake
:(But v9.0.1 is not in
lib-source
for some reason)Clang might try to use an internal runtime function not present in older versions of the runtime sometimes, for example clang-19 uses a symbol not in v9.0.1 of libomp sometimes (
__kmpc_dispatch_deinit
), but there might be more of those I'm not aware of. This would then cause missing symbols errors during linking or while loading the module. You can probably avoid this by not using OpenMP 5 features and not using a very recent clang when building an add-on.The lib-source is generated on Linux, so is likely why it doesn't include the OpenMP 9.
I was trying to go back to the root of the reason why OpenMP library is present in the molecular. You've mentioned this is because of
cpython.parallel
. We do shipcython.parallel
by the looks of it, but not thecython.cimports
(which is present in the OpenMP example). What happens in Blender isWouldn't it be easier if we make
cython.parallel
more complete, with the environment we control so people wouldn't need to go into all those extents of bundling own OPenMP libraries and such? Or maybe it's just a bug which we need to solve?