Crash when importing a file using python from the command line with an asset browser open #99313

Closed
opened 2022-07-01 07:51:38 +02:00 by Rey Leonard M. Amorato · 24 comments

System Information
Operating system: Linux-5.15.0-40-generic-x86_64-with-glibc2.35 64 Bits
Graphics card: AMD Radeon RX 5700 XT (navi10, LLVM 13.0.1, DRM 3.42, 5.15.0-40-generic) AMD 4.6 (Core Profile) Mesa 22.0.1

Blender Version
Broken: version: 3.3.0 Alpha, branch: master, commit date: 2022-06-28 22:57, hash: c0e4532331
Worked: -

Short description of error
Blender crashes with segfault when trying to import a model using blender --python-expr when the startup file or the opened file has an asset browser open.

Exact steps for others to reproduce the error
Download sample model from KhronosGroup github.

Run blender with:

blender <path/to/file/with/asswet/browser/open> --python-expr 'import bpy; bpy.ops.import_scene.gltf(filepath="/<PATH>/Sponza.gltf")'

Blender crashes with the follow stack trace:

* thread #1, name = 'blender', stop reason = signal SIGSEGV: invalid address (fault address: 0x5c0)
  * frame #0: 0x0000000004b21c10 blender`filelist_file_ex(filelist=0x0000000000000000, index=-1, use_request=true) at filelist.c:2231:36
    frame #1: 0x0000000004b22070 blender`filelist_file(filelist=0x0000000000000000, index=-1) at filelist.c:2277:10
    frame #2: 0x0000000004b2914e blender`ED_fileselect_active_asset_get(sfile=0x00007fffdaf50988) at filesel.c:472:30
    frame #3: 0x0000000004b2f636 blender`file_listener(listener_params=0x00007fffffffe7a0) at space_file.c:467:38
    frame #4: 0x0000000003ca4f3c blender`ED_area_do_listen(params=0x00007fffffffe7a0) at area.c:163:5
    frame #5: 0x0000000003259301 blender`::wm_event_do_notifiers(C=0x00007ffff3f84388) at wm_event_system.cc:619:11
    frame #6: 0x000000000324f100 blender`WM_main(C=0x00007ffff3f84388) at wm.c:626:5
    frame #7: 0x0000000002a73fe9 blender`main(argc=4, argv=0x00007fffffffe978) at creator.c:547:5
    frame #8: 0x00007ffff7dba290 libc.so.6`__libc_start_call_main + 128
    frame #9: 0x00007ffff7dba34a libc.so.6`__libc_start_main@@GLIBC_2.34 + 138
    frame #10: 0x0000000002a73ba5 blender`_start + 37

Additional information

Blender does not crash if the same command is run in the python console when blender is opened.

**System Information** Operating system: Linux-5.15.0-40-generic-x86_64-with-glibc2.35 64 Bits Graphics card: AMD Radeon RX 5700 XT (navi10, LLVM 13.0.1, DRM 3.42, 5.15.0-40-generic) AMD 4.6 (Core Profile) Mesa 22.0.1 **Blender Version** Broken: version: 3.3.0 Alpha, branch: master, commit date: 2022-06-28 22:57, hash: `c0e4532331` Worked: - **Short description of error** Blender crashes with segfault when trying to import a model using `blender --python-expr` when the startup file or the opened file has an asset browser open. **Exact steps for others to reproduce the error** Download [sample model ](https://github.com/KhronosGroup/glTF-Sample-Models/tree/master/2.0/Sponza) from KhronosGroup github. Run blender with: ``` blender <path/to/file/with/asswet/browser/open> --python-expr 'import bpy; bpy.ops.import_scene.gltf(filepath="/<PATH>/Sponza.gltf")' ``` Blender crashes with the follow stack trace: ``` * thread #1, name = 'blender', stop reason = signal SIGSEGV: invalid address (fault address: 0x5c0) * frame #0: 0x0000000004b21c10 blender`filelist_file_ex(filelist=0x0000000000000000, index=-1, use_request=true) at filelist.c:2231:36 frame #1: 0x0000000004b22070 blender`filelist_file(filelist=0x0000000000000000, index=-1) at filelist.c:2277:10 frame #2: 0x0000000004b2914e blender`ED_fileselect_active_asset_get(sfile=0x00007fffdaf50988) at filesel.c:472:30 frame #3: 0x0000000004b2f636 blender`file_listener(listener_params=0x00007fffffffe7a0) at space_file.c:467:38 frame #4: 0x0000000003ca4f3c blender`ED_area_do_listen(params=0x00007fffffffe7a0) at area.c:163:5 frame #5: 0x0000000003259301 blender`::wm_event_do_notifiers(C=0x00007ffff3f84388) at wm_event_system.cc:619:11 frame #6: 0x000000000324f100 blender`WM_main(C=0x00007ffff3f84388) at wm.c:626:5 frame #7: 0x0000000002a73fe9 blender`main(argc=4, argv=0x00007fffffffe978) at creator.c:547:5 frame #8: 0x00007ffff7dba290 libc.so.6`__libc_start_call_main + 128 frame #9: 0x00007ffff7dba34a libc.so.6`__libc_start_main@@GLIBC_2.34 + 138 frame #10: 0x0000000002a73ba5 blender`_start + 37 ``` **Additional information** Blender does not crash if the same command is run in the python console when blender is opened.

Added subscriber: @RL

Added subscriber: @RL

#100237 was marked as duplicate of this issue

#100237 was marked as duplicate of this issue

Added subscriber: @deadpin

Added subscriber: @deadpin

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

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

I'm not able to reproduce this issue using the latest build of 3.3.0. The model gets imported correctly and there's no indication of an issue:

./blender --python-expr 'import bpy; bpy.ops.import_scene.gltf(filepath="/home/jesse/source/fx-gltf/test/data/glTF-Sample-Models/2.0/Sponza/glTF/Sponza.gltf")'

Data are loaded, start creating Blender stuff
glTF import finished in 1.64s

If blender is crashing, it may write out a file like so. Is there a *crash.txt file in your /tmp directory that corresponds to the crash you are seeing?

Writing: /tmp/T99317.crash.txt
Segmentation fault (core dumped)
I'm not able to reproduce this issue using the latest build of 3.3.0. The model gets imported correctly and there's no indication of an issue: ``` ./blender --python-expr 'import bpy; bpy.ops.import_scene.gltf(filepath="/home/jesse/source/fx-gltf/test/data/glTF-Sample-Models/2.0/Sponza/glTF/Sponza.gltf")' Data are loaded, start creating Blender stuff glTF import finished in 1.64s ``` If blender is crashing, it may write out a file like so. Is there a *crash.txt file in your /tmp directory that corresponds to the crash you are seeing? ``` Writing: /tmp/T99317.crash.txt Segmentation fault (core dumped) ```

Crash log
blender.crash.txt

Output of blender --debug-all --python-expr
blender-output.txt

Crash log [blender.crash.txt](https://archive.blender.org/developer/F13251513/blender.crash.txt) Output of `blender --debug-all --python-expr` [blender-output.txt](https://archive.blender.org/developer/F13251516/blender-output.txt)

Can you try with the latest version of 3.3?

Can you try with the latest version of 3.3?
Same outcome [blender.crash.txt](https://archive.blender.org/developer/F13252555/blender.crash.txt) [blender-output.txt](https://archive.blender.org/developer/F13252556/blender-output.txt)

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

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

Unsure what's going on but that crash file is the old one; the version it prints out is the one from a few days ago: # Blender 3.3.0, Commit date: 2022-06-28 22:57, Hash c0e453233132

Will set back to Needs Triage in hopes that someone else might be able to confirm the issue.

Unsure what's going on but that crash file is the old one; the version it prints out is the one from a few days ago: `# Blender 3.3.0, Commit date: 2022-06-28 22:57, Hash c0e453233132` Will set back to Needs Triage in hopes that someone else might be able to confirm the issue.

My bad, uploaded the wrong file.

blender.crash.txt

My bad, uploaded the wrong file. [blender.crash.txt](https://archive.blender.org/developer/F13252813/blender.crash.txt)
Member

Added subscriber: @OmarEmaraDev

Added subscriber: @OmarEmaraDev
Member

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

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

Can't reproduce myself either. Does moving the file somewhere else before importing makes a difference?

blender(BLI_system_backtrace+0x37) [0x55e8f01a88a7]
blender(+0x1ecf197) [0x55e8e51fd197]
/lib/x86_64-linux-gnu/libc.so.6(+0x42520) [0x7f4d19237520]
blender(filelist_file_ex+0x12) [0x55e8e6536592]
blender(ED_fileselect_active_asset_get+0x28) [0x55e8e6539c98]
blender(+0x3210b09) [0x55e8e653eb09]
blender(wm_event_do_notifiers+0x354) [0x55e8e576bcc4]
blender(WM_main+0x28) [0x55e8e575e1f8]
blender(main+0x342) [0x55e8e50f9cf2]
/lib/x86_64-linux-gnu/libc.so.6(+0x29d90) [0x7f4d1921ed90]
/lib/x86_64-linux-gnu/libc.so.6(__libc_start_main+0x80) [0x7f4d1921ee40]
blender(_start+0x25) [0x55e8e51f95c5]
Can't reproduce myself either. Does moving the file somewhere else before importing makes a difference? ``` blender(BLI_system_backtrace+0x37) [0x55e8f01a88a7] blender(+0x1ecf197) [0x55e8e51fd197] /lib/x86_64-linux-gnu/libc.so.6(+0x42520) [0x7f4d19237520] blender(filelist_file_ex+0x12) [0x55e8e6536592] blender(ED_fileselect_active_asset_get+0x28) [0x55e8e6539c98] blender(+0x3210b09) [0x55e8e653eb09] blender(wm_event_do_notifiers+0x354) [0x55e8e576bcc4] blender(WM_main+0x28) [0x55e8e575e1f8] blender(main+0x342) [0x55e8e50f9cf2] /lib/x86_64-linux-gnu/libc.so.6(+0x29d90) [0x7f4d1921ed90] /lib/x86_64-linux-gnu/libc.so.6(__libc_start_main+0x80) [0x7f4d1921ee40] blender(_start+0x25) [0x55e8e51f95c5] ```

No, no change unfortunately.

blender --python-expr 'import bpy; bpy.ops.import_scene.gltf(filepath="/home/workstation/Desktop/glTF/Sponza.gltf")'
Read prefs: /home/workstation/.config/blender/3.3/config/userpref.blend
[ALSOFT] (EE) Failed to set real-time priority for thread: Operation not permitted (1)
[ALSOFT] (EE) Failed to set real-time priority for thread: Operation not permitted (1)
Data are loaded, start creating Blender stuff
glTF import finished in 0.73s
Writing: /tmp/blender.crash.txt
Segmentation fault (core dumped)
# Blender 3.3.0, Commit date: 2022-07-02 23:55, Hash e86c2f728872
bpy.ops.import_scene.gltf(filepath="/home/workstation/Desktop/glTF/Sponza.gltf", loglevel=50)  # Operator

# backtrace
blender(BLI_system_backtrace+0x37) [0x55d2e08af8a7]
blender(+0x1ecf197) [0x55d2d5904197]
/lib/x86_64-linux-gnu/libc.so.6(+0x42520) [0x7f2217673520]
blender(filelist_file_ex+0x12) [0x55d2d6c3d592]
blender(ED_fileselect_active_asset_get+0x28) [0x55d2d6c40c98]
blender(+0x3210b09) [0x55d2d6c45b09]
blender(wm_event_do_notifiers+0x354) [0x55d2d5e72cc4]
blender(WM_main+0x28) [0x55d2d5e651f8]
blender(main+0x342) [0x55d2d5800cf2]
/lib/x86_64-linux-gnu/libc.so.6(+0x29d90) [0x7f221765ad90]
/lib/x86_64-linux-gnu/libc.so.6(__libc_start_main+0x80) [0x7f221765ae40]
blender(_start+0x25) [0x55d2d59005c5]

# Python backtrace

No, no change unfortunately. ``` blender --python-expr 'import bpy; bpy.ops.import_scene.gltf(filepath="/home/workstation/Desktop/glTF/Sponza.gltf")' Read prefs: /home/workstation/.config/blender/3.3/config/userpref.blend [ALSOFT] (EE) Failed to set real-time priority for thread: Operation not permitted (1) [ALSOFT] (EE) Failed to set real-time priority for thread: Operation not permitted (1) Data are loaded, start creating Blender stuff glTF import finished in 0.73s Writing: /tmp/blender.crash.txt Segmentation fault (core dumped) ``` ``` # Blender 3.3.0, Commit date: 2022-07-02 23:55, Hash e86c2f728872 bpy.ops.import_scene.gltf(filepath="/home/workstation/Desktop/glTF/Sponza.gltf", loglevel=50) # Operator # backtrace blender(BLI_system_backtrace+0x37) [0x55d2e08af8a7] blender(+0x1ecf197) [0x55d2d5904197] /lib/x86_64-linux-gnu/libc.so.6(+0x42520) [0x7f2217673520] blender(filelist_file_ex+0x12) [0x55d2d6c3d592] blender(ED_fileselect_active_asset_get+0x28) [0x55d2d6c40c98] blender(+0x3210b09) [0x55d2d6c45b09] blender(wm_event_do_notifiers+0x354) [0x55d2d5e72cc4] blender(WM_main+0x28) [0x55d2d5e651f8] blender(main+0x342) [0x55d2d5800cf2] /lib/x86_64-linux-gnu/libc.so.6(+0x29d90) [0x7f221765ad90] /lib/x86_64-linux-gnu/libc.so.6(__libc_start_main+0x80) [0x7f221765ae40] blender(_start+0x25) [0x55d2d59005c5] # Python backtrace ```
Member

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

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

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

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

Can you try with blender --factory-startup --python-expr 'import bpy; bpy.ops.import_scene.gltf(filepath="/home/workstation/Desktop/glTF/Sponza.gltf")'? That is, with factory setup.
It seems to me that this code path only executes when there is an asset browser editor open. Maybe your startup file have one opened?

Can you try with `blender --factory-startup --python-expr 'import bpy; bpy.ops.import_scene.gltf(filepath="/home/workstation/Desktop/glTF/Sponza.gltf")'`? That is, with factory setup. It seems to me that this code path only executes when there is an asset browser editor open. Maybe your startup file have one opened?

Very astute! My startup file does have an asset browser editor open and running blender with --factory-startup produces no error and the gltf file gets imported as expected. We seem to have this narrowed down. Thank you!

Very astute! My startup file does have an asset browser editor open and running blender with `--factory-startup` produces no error and the gltf file gets imported as expected. We seem to have this narrowed down. Thank you!
Member

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

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

Can replicate with a blend file that has an asset browser open.

* thread #1, name = 'blender', stop reason = signal SIGSEGV: invalid address (fault address: 0x5c0)
  * frame #0: 0x0000000004b21c10 blender`filelist_file_ex(filelist=0x0000000000000000, index=-1, use_request=true) at filelist.c:2231:36
    frame #1: 0x0000000004b22070 blender`filelist_file(filelist=0x0000000000000000, index=-1) at filelist.c:2277:10
    frame #2: 0x0000000004b2914e blender`ED_fileselect_active_asset_get(sfile=0x00007fffdaf50988) at filesel.c:472:30
    frame #3: 0x0000000004b2f636 blender`file_listener(listener_params=0x00007fffffffe7a0) at space_file.c:467:38
    frame #4: 0x0000000003ca4f3c blender`ED_area_do_listen(params=0x00007fffffffe7a0) at area.c:163:5
    frame #5: 0x0000000003259301 blender`::wm_event_do_notifiers(C=0x00007ffff3f84388) at wm_event_system.cc:619:11
    frame #6: 0x000000000324f100 blender`WM_main(C=0x00007ffff3f84388) at wm.c:626:5
    frame #7: 0x0000000002a73fe9 blender`main(argc=4, argv=0x00007fffffffe978) at creator.c:547:5
    frame #8: 0x00007ffff7dba290 libc.so.6`__libc_start_call_main + 128
    frame #9: 0x00007ffff7dba34a libc.so.6`__libc_start_main@@GLIBC_2.34 + 138
    frame #10: 0x0000000002a73ba5 blender`_start + 37
Can replicate with a blend file that has an asset browser open. ``` * thread #1, name = 'blender', stop reason = signal SIGSEGV: invalid address (fault address: 0x5c0) * frame #0: 0x0000000004b21c10 blender`filelist_file_ex(filelist=0x0000000000000000, index=-1, use_request=true) at filelist.c:2231:36 frame #1: 0x0000000004b22070 blender`filelist_file(filelist=0x0000000000000000, index=-1) at filelist.c:2277:10 frame #2: 0x0000000004b2914e blender`ED_fileselect_active_asset_get(sfile=0x00007fffdaf50988) at filesel.c:472:30 frame #3: 0x0000000004b2f636 blender`file_listener(listener_params=0x00007fffffffe7a0) at space_file.c:467:38 frame #4: 0x0000000003ca4f3c blender`ED_area_do_listen(params=0x00007fffffffe7a0) at area.c:163:5 frame #5: 0x0000000003259301 blender`::wm_event_do_notifiers(C=0x00007ffff3f84388) at wm_event_system.cc:619:11 frame #6: 0x000000000324f100 blender`WM_main(C=0x00007ffff3f84388) at wm.c:626:5 frame #7: 0x0000000002a73fe9 blender`main(argc=4, argv=0x00007fffffffe978) at creator.c:547:5 frame #8: 0x00007ffff7dba290 libc.so.6`__libc_start_call_main + 128 frame #9: 0x00007ffff7dba34a libc.so.6`__libc_start_main@@GLIBC_2.34 + 138 frame #10: 0x0000000002a73ba5 blender`_start + 37 ```
Omar Emara changed title from Blender crashes when trying to import file using python to Crash when importing a file using python from the command line with an asset browser open 2022-07-08 13:05:44 +02:00
Member

Added subscribers: @NovanByworks, @EAW, @rjg, @Harvester

Added subscribers: @NovanByworks, @EAW, @rjg, @Harvester
Member

Cannot reproduce (not even in c0e4532331 as reported here and with a file with an asset browser open).

Can you re-check if this is still a problem in fresh builds from https://builder.blender.org/download/daily/ ?

Cannot reproduce (not even in c0e4532331 as reported here and with a file with an asset browser open). Can you re-check if this is still a problem in fresh builds from https://builder.blender.org/download/daily/ ?
Philipp Oeser added
Status
Needs Information from User
and removed
Status
Confirmed
labels 2024-02-28 11:39:45 +01:00
Member

No activity for more than a week. As per the tracker policy we assume the issue is gone and can be closed.

Thanks again for the report. If the problem persists please open a new report with the required information.

No activity for more than a week. As per the tracker policy we assume the issue is gone and can be closed. Thanks again for the report. If the problem persists please open a new report with the required information.
Blender Bot added
Status
Archived
and removed
Status
Needs Information from User
labels 2024-04-04 08:47:41 +02:00
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#99313
No description provided.