Crash when importing numpy. #82461

Closed
opened 2020-11-06 14:44:20 +01:00 by Peisen Wang · 24 comments

System Information
Operating system: Ubuntu 20.10 64-bit (Linux-5.8.0-26-generic-x86_64-with-debian-bullseye-sid 64 Bits)
Graphics card: AMD RENOIR (DRM 3.38.0, 5.8.0-26-generic, LLVM 11.0.0) X.Org 4.6 (Core Profile) Mesa 20.2.1

Blender Version
Broken: version: 2.83.8, branch: master, commit date: 2020-10-21 08:12, hash: 5949b796f0; 2.90.1; 2.92.0 alpha
Worked: (newest version of Blender that worked as expected)

Short description of error
Importing numpy inside blender python console cause blender to crash (Aborted).

Exact steps for others to reproduce the error
With fresh downloaded and unzipped blender, open it and switch to scripting, type into the python console:

import numpy

Blender immediately crashes. Command line output:

Aborted (core dumped)

Importing other builtin or pip-installed modules without numpy as dependency, for example requests and PIL, will not cause crashing.

Running python script including "import numpy" inside blender or passed with "--python" will crash it too, but it runs fine with "--background".

Also tried on the system package manager installed blender 2.83.5, which uses the system python from /usr/bin/python3.8, no crash occurred.

Tried on a few nearby machines with Ubuntu 16.04 and 18.04, no similar problem were encountered.

ThreadStacktrace

Stacktrace

**System Information** Operating system: Ubuntu 20.10 64-bit (Linux-5.8.0-26-generic-x86_64-with-debian-bullseye-sid 64 Bits) Graphics card: AMD RENOIR (DRM 3.38.0, 5.8.0-26-generic, LLVM 11.0.0) X.Org 4.6 (Core Profile) Mesa 20.2.1 **Blender Version** Broken: version: 2.83.8, branch: master, commit date: 2020-10-21 08:12, hash: `5949b796f0`; 2.90.1; 2.92.0 alpha Worked: (newest version of Blender that worked as expected) **Short description of error** Importing numpy inside blender python console cause blender to crash (Aborted). **Exact steps for others to reproduce the error** With fresh downloaded and unzipped blender, open it and switch to scripting, type into the python console: ``` import numpy ``` Blender immediately crashes. Command line output: ``` Aborted (core dumped) ``` Importing other builtin or pip-installed modules without numpy as dependency, for example requests and PIL, will not cause crashing. Running python script including "import numpy" inside blender or passed with "--python" will crash it too, but it runs fine with "--background". Also tried on the system package manager installed blender 2.83.5, which uses the system python from /usr/bin/python3.8, no crash occurred. Tried on a few nearby machines with Ubuntu 16.04 and 18.04, no similar problem were encountered. [ThreadStacktrace](https://archive.blender.org/developer/F9218451/ThreadStacktrace) [Stacktrace](https://archive.blender.org/developer/F9218454/Stacktrace)
Author

Added subscriber: @peisen

Added subscriber: @peisen

Added subscriber: @rjg

Added subscriber: @rjg

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

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

I can't reproduce this on Linux or Windows. Could you please start Blender with the following debug flags and try to make it crash again?

./blender --debug --debug-cycles > ~/blender_debug_output.txt 2>&1

Please attach the debug log to your ticket.

I can't reproduce this on Linux or Windows. Could you please start Blender with the following debug flags and try to make it crash again? ``` ./blender --debug --debug-cycles > ~/blender_debug_output.txt 2>&1 ``` Please attach the debug log to your ticket.
Author

Hi, this is the debug output after crashing blender 2.90.1

blender_debug_output.txt

Also FYI below is the log from the system-installed blender 2.83.5 after performing the same operations and exiting.

blender_2.83.5_debug_output.txt

Hi, this is the debug output after crashing blender 2.90.1 [blender_debug_output.txt](https://archive.blender.org/developer/F9219746/blender_debug_output.txt) Also FYI below is the log from the system-installed blender 2.83.5 after performing the same operations and exiting. [blender_2.83.5_debug_output.txt](https://archive.blender.org/developer/F9219783/blender_2.83.5_debug_output.txt)

Thank you for the log files. You've got a couple errors there that look similar to the ones reported in #81835 and here . They might not be related to Python, but this could cause some undefined behavior that just results in a crash later on.

LLVM triggered Diagnostic Handler: Illegal instruction detected: VOP* instruction violates constant bus restriction
renamable $vgpr4 = V_CNDMASK_B32_e32 32768, killed $vgpr5, implicit killed $vcc, implicit $exec
LLVM failed to compile shader
radeonsi: can't compile a main shader part
LLVM triggered Diagnostic Handler: Illegal instruction detected: VOP* instruction violates constant bus restriction
renamable $vgpr4 = V_CNDMASK_B32_e32 32768, killed $vgpr4, implicit killed $vcc, implicit $exec
LLVM failed to compile shader
radeonsi: can't compile a main shader part

Could you please download the latest build of 2.92 (if you haven't already) and then run the following command.

./blender --debug --debug-gpu --debug-python > ~/blender_debug_output.txt 2>&1

Upload the log file again and also the crash report that can be found in /tmp, if Blender is able to write it.

Thank you for the log files. You've got a couple errors there that look similar to the ones reported in #81835 and [here ](https://bugzilla.redhat.com/show_bug.cgi?id=1879404). They might not be related to Python, but this could cause some undefined behavior that just results in a crash later on. ``` LLVM triggered Diagnostic Handler: Illegal instruction detected: VOP* instruction violates constant bus restriction renamable $vgpr4 = V_CNDMASK_B32_e32 32768, killed $vgpr5, implicit killed $vcc, implicit $exec LLVM failed to compile shader radeonsi: can't compile a main shader part LLVM triggered Diagnostic Handler: Illegal instruction detected: VOP* instruction violates constant bus restriction renamable $vgpr4 = V_CNDMASK_B32_e32 32768, killed $vgpr4, implicit killed $vcc, implicit $exec LLVM failed to compile shader radeonsi: can't compile a main shader part ``` Could you please download the [latest build of 2.92 ](https://builder.blender.org/download/) (if you haven't already) and then run the following command. ``` ./blender --debug --debug-gpu --debug-python > ~/blender_debug_output.txt 2>&1 ``` Upload the log file again and also the crash report that can be found in `/tmp`, if Blender is able to write it.
Author

This is the log file after crashing from blender 2.92.0 Alpha, branch: master, commit date: 2020-11-06 06:10, hash: 9a7da1242d, launched with the provided command:

blender_2.92.0_debug_output.txt

There are no blender crash report in /tmp.

This is the log file after crashing from blender 2.92.0 Alpha, branch: master, commit date: 2020-11-06 06:10, hash: `9a7da1242d`, launched with the provided command: [blender_2.92.0_debug_output.txt](https://archive.blender.org/developer/F9223997/blender_2.92.0_debug_output.txt) There are no blender crash report in `/tmp`.

Currently there seem to be two issues, one is with your graphics driver and one with Python. If you're able to, could you please try to update the graphics driver? Mesa 20.2.1 is already fairly recent, but the errors indicate an issue with it.

Currently there seem to be two issues, one is with your graphics driver and one with Python. If you're able to, could you please try to update the graphics driver? Mesa 20.2.1 is already fairly recent, but the errors indicate an issue with it.

@peisen Have you checked if upgrading or downgrading the graphics driver makes any difference?

@peisen Have you checked if upgrading or downgrading the graphics driver makes any difference?

Added subscriber: @Mantissa

Added subscriber: @Mantissa

Can confirm this behavior with a Radeon 5700XT on Ubuntu 20.10 (also Mesa 20.2.1) with building from source 7bab87c119. Same thing happens when trying to enable an addon that imports numpy.

system-info.txt

Can confirm this behavior with a Radeon 5700XT on Ubuntu 20.10 (also Mesa 20.2.1) with building from source 7bab87c119f4. Same thing happens when trying to enable an addon that imports numpy. [system-info.txt](https://archive.blender.org/developer/F9356173/system-info.txt)

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

Changed status from 'Needs User Info' to: 'Needs Triage'
Member

Added subscriber: @lichtwerk

Added subscriber: @lichtwerk
Member

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

Changed status from 'Needs Triage' to: 'Needs User Info'
Member

Hm, also cannot reproduce.

**System Information**
Operating system: Linux-5.9.8-200.fc33.x86_64-x86_64-with-fedora-33-Thirty_Three 64 Bits
Graphics card: GeForce GTX 970M/PCIe/SSE2 NVIDIA Corporation 4.5.0 NVIDIA 455.45.01
version: 2.92.0 Alpha, branch: master, commit date: 2020-11-24 12:22, hash: `rB278011e44d43`

So, Python is at 3.7.7
Numpy should be at 1.17.5

@Mantissa : if you are building yourself: which numpy are you using? (PYTHON_NUMPY_PATH in cmake) If you are not using using the precompiled libs from https:*svn.blender.org/svnroot/bf-blender/trunk/lib/linux_centos7_x86_64, could you check if these are working? See https:*wiki.blender.org/wiki/Building_Blender/Linux/Ubuntu

Hm, also cannot reproduce. ``` **System Information** Operating system: Linux-5.9.8-200.fc33.x86_64-x86_64-with-fedora-33-Thirty_Three 64 Bits Graphics card: GeForce GTX 970M/PCIe/SSE2 NVIDIA Corporation 4.5.0 NVIDIA 455.45.01 version: 2.92.0 Alpha, branch: master, commit date: 2020-11-24 12:22, hash: `rB278011e44d43` ``` So, Python is at 3.7.7 Numpy should be at 1.17.5 @Mantissa : if you are building yourself: which numpy are you using? (PYTHON_NUMPY_PATH in cmake) If you are not using using the precompiled libs from https:*svn.blender.org/svnroot/bf-blender/trunk/lib/linux_centos7_x86_64, could you check if these are working? See https:*wiki.blender.org/wiki/Building_Blender/Linux/Ubuntu

@peisen @Mantissa could you provide the information @lichtwerk asked for? Otherwise we will have to close the ticket for inactivity as the issue cannot be reproduced with the currently provided information.

@peisen @Mantissa could you provide the information @lichtwerk asked for? Otherwise we will have to close the ticket for inactivity as the issue cannot be reproduced with the currently provided information.

I've changed hardware since this report. Unfortunately I was experiencing too many visual bugs and driver crashes using the open source AMD drivers with the 5700XT while working in Blender.

@lichtwerk Before I swapped out the gpu though, I was using the precompiled libs.

I've changed hardware since this report. Unfortunately I was experiencing too many visual bugs and driver crashes using the open source AMD drivers with the 5700XT while working in Blender. @lichtwerk Before I swapped out the gpu though, I was using the precompiled libs.

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

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

Unfortunately, we currently don't know how to reproduce the issue and therefore can't identify were the problem came from. Since this ticket has been inactive for more than a week and @Mantissa you aren't able to reproduce the problem yourself anymore and @peisen hasn't replied, I'll close this ticket for now. Should the problem reoccur please leave a comment on this ticket and we can reopen it.

Unfortunately, we currently don't know how to reproduce the issue and therefore can't identify were the problem came from. Since this ticket has been inactive for more than a week and @Mantissa you aren't able to reproduce the problem yourself anymore and @peisen hasn't replied, I'll close this ticket for now. Should the problem reoccur please leave a comment on this ticket and we can reopen it.

This might be the same problem as #84752 in which case we have identified a workaround.

This might be the same problem as #84752 in which case we have identified a workaround.

Added subscriber: @petr.dlouhy

Added subscriber: @petr.dlouhy

This issue is still present in Blender 2.92 RC (tested with Ubuntu 20.10).
Seems like big deal, because it can makes Blender unable to start (if certain add-ons are activated).

This issue is still present in Blender 2.92 RC (tested with Ubuntu 20.10). Seems like big deal, because it can makes Blender unable to start (if certain add-ons are activated).

@petr.dlouhy If you are referring to the issue in #84752, then this should be fixed in Blender 2.93 as the Python version has been upgraded to 3.9.x. This is unaddressed in 2.92 though and would require a manual tweak of 2.92/python/lib/python3.7/ctypes/__init__.py commenting / removing the lines as done in this commit . The issue is in Python and since the fix is only in 3.8.x and later this is not solved in Blender 2.92 that uses Python 3.7.7 like the previous versions.

@petr.dlouhy If you are referring to the issue in #84752, then this should be fixed in Blender 2.93 as the Python version has been upgraded to 3.9.x. This is unaddressed in 2.92 though and would require a manual tweak of `2.92/python/lib/python3.7/ctypes/__init__.py` commenting / removing the lines as done in [this commit ](https://github.com/python/cpython/commit/674e9389e9fdadd622829f4833367ac3b38475b5). The issue is in Python and since the fix is only in 3.8.x and later this is not solved in Blender 2.92 that uses Python 3.7.7 like the previous versions.

@rjg Yes, I guess, this issue is duplicate of ##84752. The description responds, the tweak works.

I can do the tweak, but I can't tell, how many other users won't be able to do it and end up with crashing Blender.

@rjg Yes, I guess, this issue is duplicate of ##84752. The description responds, the tweak works. I can do the tweak, but I can't tell, how many other users won't be able to do it and end up with crashing Blender.
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#82461
No description provided.