very long operator name crashes upon addon activation #70000

Closed
opened 3 years ago by JakubUhlik · 10 comments

System Information
Operating system: Darwin-16.7.0-x86_64-i386-64bit 64 Bits
Graphics card:

Blender Version
Broken: version: 2.80 (sub 75), branch: master, commit date: 2019-07-29 14:47, hash: f6cb5f5449
Worked: (optional)

Short description of error
very long operator name crashes upon addon activation

Exact steps for others to reproduce the error
install example addon, try to enable in preferences

example.py

**System Information** Operating system: Darwin-16.7.0-x86_64-i386-64bit 64 Bits Graphics card: **Blender Version** Broken: version: 2.80 (sub 75), branch: master, commit date: 2019-07-29 14:47, hash: `f6cb5f5449` Worked: (optional) **Short description of error** very long operator name crashes upon addon activation **Exact steps for others to reproduce the error** install example addon, try to enable in preferences [example.py](https://archive.blender.org/developer/F7754152/example.py)
Poster

Added subscriber: @JakubUhlik

Added subscriber: @JakubUhlik
Collaborator

Added subscribers: @ideasman42, @BrendonMurphy

Added subscribers: @ideasman42, @BrendonMurphy
Collaborator

@ideasman42 this seems a little like a forced error, users should not do this nor expect it to work. It deliberately defies pep8 just to prove a point.
Unfortunately it's a real thing I guess, so users should be prevented from taking this action?

@ideasman42 this seems a little like a forced error, users should not do this nor expect it to work. It deliberately defies pep8 just to prove a point. Unfortunately it's a real thing I guess, so users should be prevented from taking this action?
Collaborator

Added subscriber: @JacquesLucke

Added subscriber: @JacquesLucke
Collaborator

Changed status from 'Open' to: 'Resolved'

Changed status from 'Open' to: 'Resolved'
JacquesLucke closed this issue 3 years ago
JacquesLucke self-assigned this 3 years ago
Collaborator

I get the following error message:

Traceback (most recent call last):
  File "/Text", line 31, in <module>
  File "/Text", line 22, in register
RuntimeError: Error: Registering operator class: 'EXAMPLE_OT_some_quite_a_long_name_for_an_operator_to_handle_and_a_bit_more_characters_to_make_sure_it_crashes', invalid bl_idname 'example_ops.some_quite_a_long_name_for_an_operator_to_handle_an', is too long, maximum length is 61

This is a perfectly valid limitation imo (could be improved in the future, but I don't see a big benefit).
This is not a bug in Blender but in the addon.

I get the following error message: ``` Traceback (most recent call last): File "/Text", line 31, in <module> File "/Text", line 22, in register RuntimeError: Error: Registering operator class: 'EXAMPLE_OT_some_quite_a_long_name_for_an_operator_to_handle_and_a_bit_more_characters_to_make_sure_it_crashes', invalid bl_idname 'example_ops.some_quite_a_long_name_for_an_operator_to_handle_an', is too long, maximum length is 61 ``` This is a perfectly valid limitation imo (could be improved in the future, but I don't see a big benefit). This is not a bug in Blender but in the addon.
Collaborator

Added subscriber: @deadpin

Added subscriber: @deadpin
Collaborator

I get a crash here. How did you try the addon? I did a real Install from preferences and then attempted to enable it, leading to the following.

The stack based idname_bl array has been overrun:

Run-Time Check Failure #2 - Stack around the variable 'idname_bl' was corrupted.

blender.exe!WM_operatortype_find(const unsigned char * idname, bool quiet) Line 90	C
blender.exe!rna_Operator_register(Main * bmain, ReportList * reports, void * data, const unsigned char * identifier, int(*)(PointerRNA *, void *, int *) validate, int(*)(bContext *, PointerRNA *, FunctionRNA *, ParameterList *) call, void(*)(void *) free) Line 1506	C
blender.exe!pyrna_register_class(_object * UNUSED_self, _object * py_class) Line 8630	C
[External Code]	
blender.exe!bpy_class_call(bContext * C, PointerRNA * ptr, FunctionRNA * func, ParameterList * parms) Line 8313	C
blender.exe!rna_operator_execute_cb(bContext * C, wmOperator * op) Line 1299	C
blender.exe!wm_operator_invoke(bContext * C, wmOperatorType * ot, wmEvent * event, PointerRNA * properties, ReportList * reports, const bool poll_only, bool use_last_properties) Line 1451	C
blender.exe!wm_operator_call_internal(bContext * C, wmOperatorType * ot, PointerRNA * properties, ReportList * reports, const short context, const bool poll_only, wmEvent * event) Line 1652	C
blender.exe!WM_operator_name_call_ptr(bContext * C, wmOperatorType * ot, short context, PointerRNA * properties) Line 1701	C
blender.exe!ui_apply_but_funcs_after(bContext * C) Line 845	C
blender.exe!ui_handler_region_menu(bContext * C, const wmEvent * event, void * UNUSED_userdata) Line 10222	C
blender.exe!wm_handler_ui_call(bContext * C, wmEventHandler_UI * handler, const wmEvent * event, int always_pass) Line 622	C
blender.exe!wm_handlers_do_intern(bContext * C, wmEvent * event, ListBase * handlers) Line 2731	C
blender.exe!wm_handlers_do(bContext * C, wmEvent * event, ListBase * handlers) Line 2977	C
blender.exe!wm_event_do_handlers(bContext * C) Line 3356	C
blender.exe!WM_main(bContext * C) Line 420	C


I get a crash here. How did you try the addon? I did a real Install from preferences and then attempted to enable it, leading to the following. The stack based `idname_bl` array has been overrun: ``` Run-Time Check Failure #2 - Stack around the variable 'idname_bl' was corrupted. blender.exe!WM_operatortype_find(const unsigned char * idname, bool quiet) Line 90 C blender.exe!rna_Operator_register(Main * bmain, ReportList * reports, void * data, const unsigned char * identifier, int(*)(PointerRNA *, void *, int *) validate, int(*)(bContext *, PointerRNA *, FunctionRNA *, ParameterList *) call, void(*)(void *) free) Line 1506 C blender.exe!pyrna_register_class(_object * UNUSED_self, _object * py_class) Line 8630 C [External Code] blender.exe!bpy_class_call(bContext * C, PointerRNA * ptr, FunctionRNA * func, ParameterList * parms) Line 8313 C blender.exe!rna_operator_execute_cb(bContext * C, wmOperator * op) Line 1299 C blender.exe!wm_operator_invoke(bContext * C, wmOperatorType * ot, wmEvent * event, PointerRNA * properties, ReportList * reports, const bool poll_only, bool use_last_properties) Line 1451 C blender.exe!wm_operator_call_internal(bContext * C, wmOperatorType * ot, PointerRNA * properties, ReportList * reports, const short context, const bool poll_only, wmEvent * event) Line 1652 C blender.exe!WM_operator_name_call_ptr(bContext * C, wmOperatorType * ot, short context, PointerRNA * properties) Line 1701 C blender.exe!ui_apply_but_funcs_after(bContext * C) Line 845 C blender.exe!ui_handler_region_menu(bContext * C, const wmEvent * event, void * UNUSED_userdata) Line 10222 C blender.exe!wm_handler_ui_call(bContext * C, wmEventHandler_UI * handler, const wmEvent * event, int always_pass) Line 622 C blender.exe!wm_handlers_do_intern(bContext * C, wmEvent * event, ListBase * handlers) Line 2731 C blender.exe!wm_handlers_do(bContext * C, wmEvent * event, ListBase * handlers) Line 2977 C blender.exe!wm_event_do_handlers(bContext * C) Line 3356 C blender.exe!WM_main(bContext * C) Line 420 C ```
Collaborator

I can reproduce the crash when the addon is loaded (I just run it in the text editor).
While this can be considered a security issue in Blender (due to the buffer overflow), we generally cannot avoid security issues when people run arbitrary Python code.

Addons resulting in a crash, because they use the Python API incorrectly, is generally not considered to be a bug in Blender.

I can reproduce the crash when the addon is loaded (I just run it in the text editor). While this can be considered a security issue in Blender (due to the buffer overflow), we generally cannot avoid security issues when people run arbitrary Python code. Addons resulting in a crash, because they use the Python API incorrectly, is generally not considered to be a bug in Blender.
Owner

Fixed the crash 4e9aadac5e

Fixed the crash 4e9aadac5e
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/Collada
Interest/Compositing
Interest/Core
Interest/Cycles
Interest/Dependency Graph
Interest/Development Management
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/Modeling
Interest/Modifiers
Interest/Motion Tracking
Interest/Nodes & Physics
Interest/Overrides
Interest/Performance
Interest/Performance
Interest/Physics
Interest/Pipeline, Assets & I/O
Interest/Platforms, Builds, Tests & Devices
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
legacy module/Animation & Rigging
legacy module/Core
legacy module/Development Management
legacy module/Eevee & Viewport
legacy module/Grease Pencil
legacy module/Modeling
legacy module/Nodes & Physics
legacy module/Pipeline, Assets & IO
legacy module/Platforms, Builds, Tests & Devices
legacy module/Python API
legacy module/Rendering & Cycles
legacy module/Sculpt, Paint & Texture
legacy module/Triaging
legacy module/User Interface
legacy module/VFX & Video
legacy project/1.0.0-beta.2
legacy project/Asset Browser (Archived)
legacy project/BF Blender: 2.8
legacy project/BF Blender: After Release
legacy project/BF Blender: Next
legacy project/BF Blender: Regressions
legacy project/BF Blender: Unconfirmed
legacy project/Blender 2.70
legacy project/Code Quest
legacy project/Datablocks and Libraries
legacy project/Eevee
legacy project/Game Animation
legacy project/Game Audio
legacy project/Game Data Conversion
legacy project/Game Engine
legacy project/Game Logic
legacy project/Game Physics
legacy project/Game Python
legacy project/Game Rendering
legacy project/Game UI
legacy project/GPU / Viewport
legacy project/GSoC
legacy project/Infrastructure: Websites
legacy project/LibOverrides - Usability and UX
legacy project/Milestone 1: Basic, Local Asset Browser
legacy project/Nodes
legacy project/OpenGL Error
legacy project/Papercut
legacy project/Pose Library Basics
legacy project/Retrospective
legacy project/Tracker Curfew
legacy project/Wintab High Frequency
Meta/Good First Issue
Meta/Papercut
migration/requires-manual-verification
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 & Devices
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 Information 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

No due date set.

Dependencies

No dependencies set.

Reference: blender/blender#70000
Loading…
There is no content yet.