Importing BGL Can Crash the BGE and Blender #29031

Closed
opened 2011-10-26 02:43:15 +02:00 by solarlune · 8 comments

%%%Importing the BGL standalone module can crash the BGE, and so crash Blender. In the example file, a script is run that simply imports the BGL module. If you play the game several times in a row (about 15 for me), the BGE crashes. This bug has been around for quite awhile, if I recall.%%%

%%%Importing the BGL standalone module can crash the BGE, and so crash Blender. In the example file, a script is run that simply imports the BGL module. If you play the game several times in a row (about 15 for me), the BGE crashes. This bug has been around for quite awhile, if I recall.%%%
Author

Changed status to: 'Open'

Changed status to: 'Open'

%%%Yep, I got it too - running on Linux, Blender 2.60. It took about 30 turns, but sure enough, it crashed. GDB spits out the following:

0x0907b2ba in type_dealloc (type=0x9744d80) at Objects/typeobject.c:2521

Maybe something is freeing memory that python thinks it should free, or maybe it's a bug in Python? I don't know ... I'll study the backtrace some more.%%%

%%%Yep, I got it too - running on Linux, Blender 2.60. It took about 30 turns, but sure enough, it crashed. GDB spits out the following: 0x0907b2ba in type_dealloc (type=0x9744d80) at Objects/typeobject.c:2521 Maybe something is freeing memory that python thinks it should free, or maybe it's a bug in Python? I don't know ... I'll study the backtrace some more.%%%
Author

%%%Thanks. Hopefully it'll get fixed soon - the BGUI module uses the BGL module, and it's quite useful...%%%

%%%Thanks. Hopefully it'll get fixed soon - the BGUI module uses the BGL module, and it's quite useful...%%%

%%%problem confirmed in OSX. I update the sample file to force restart of the game.

Campbell, can you take a look at this?
Backtrace:

  • 0 0x00000001012f12fc in type_dealloc (type=0x10295fc40) at Objects/typeobject.c:2523
  • 1 0x00000001012dd5cb in dict_dealloc (mp=0x105827ec0) at Objects/dictobject.c:1020
  • 2 0x00000001012e1a57 in module_clear (m=0x11a41a1b8) at Objects/moduleobject.c:388
  • 3 0x000000010138544f in delete_garbage [inlined] () at :739
  • 4 0x000000010138544f in collect (generation=1) at Modules/gcmodule.c:897
  • 5 0x0000000101385b5d in _PyObject_GC_Malloc (basicsize=<value temporarily unavailable, due to optimizations>) at Modules/gcmodule.c:963
  • 6 0x0000000101385c15 in _PyObject_GC_New (tp=0x102bd5240) at Modules/gcmodule.c:1472
  • 7 0x00000001012e1840 in PyCFunction_NewEx (ml=0x102960000, self=0x10a13b440, module=0x10a12b7d8) at Objects/methodobject.c:27
  • 8 0x00000001012e2319 in PyModule_Create2 (module=0x102962640, module_api_version=<value temporarily unavailable, due to optimizations>) at Objects/moduleobject.c:131
  • 9 0x000000010052c7de in BPyInit_bgl () at bgl.c:1292
  • 10 0x0000000101360eaf in init_builtin (name=0x7fff5fbfdb30 "bgl") at Python/import.c:2169
  • 11 0x000000010136122c in load_module (name=0x7fff5fbfdb30 "bgl", fp=<value temporarily unavailable, due to optimizations>, pathname=<value temporarily unavailable, due to optimizations>, type=6, loader=<value temporarily unavailable, due to optimizations>) at Python/import.c:2050
  • 12 0x000000010136198f in import_submodule (mod=0x102bd5920, subname=0x7fff5fbfe010 "bgl", fullname=0x7fff5fbfe010 "bgl") at Python/import.c:2894
  • 13 0x0000000101361f0a in load_next (mod=0x102bd5920, altmod=0x102bd5920, p_name=<value temporarily unavailable, due to optimizations>, buf=0x7fff5fbfe010 "bgl", p_buflen=0x7fff5fbfe000) at Python/import.c:2706
  • 14 0x0000000101362304 in PyImport_ImportModuleLevel (name=<value temporarily unavailable, due to optimizations>, globals=0x10fd97890, locals=<value temporarily unavailable, due to optimizations>, fromlist=0x11184bc10, level=0) at Python/import.c:2422
  • 15 0x0000000100539c4b in blender_import (UNUSED_self=0x0, args=0x11184e0b0, kw=0x0) at bpy_internal_import.c:236
  • 16 0x000000010129d5d8 in PyObject_Call (func=0x10f660bd8, arg=0x11184e0b0, kw=0x0) at Objects/abstract.c:2149
  • 17 0x000000010133f447 in PyEval_CallObjectWithKeywords (func=0x10f660bd8, arg=0x11184e0b0, kw=0x0) at Python/ceval.c:3761
  • 18 0x000000010134337d in PyEval_EvalFrameEx (f=0x10fd9c860, throwflag=<value temporarily unavailable, due to optimizations>) at Python/ceval.c:2338
  • 19 0x0000000101348cef in PyEval_EvalCodeEx (_co=0x109557718, globals=<value temporarily unavailable, due to optimizations>, locals=<value temporarily unavailable, due to optimizations>, args=0x0, argcount=0, kws=0x0, kwcount=0, defs=0x0, defcount=0, kwdefs=0x0, closure=0x0) at Python/ceval.c:3317
  • 20 0x0000000101348fcf in PyEval_EvalCode (co=<value temporarily unavailable, due to optimizations>, globals=<value temporarily unavailable, due to optimizations>, locals=<value temporarily unavailable, due to optimizations>) at Python/ceval.c:767
  • 21 0x0000000100d68845 in SCA_PythonController::Trigger (this=0x10fd9be00, logicmgr=0x10fdd11a0) at SCA_PythonController.cpp:410
  • 22 0x0000000100d5be3c in SCA_LogicManager::BeginFrame (this=0x10fdd11a0, curtime=0.20250560442606608, fixedtime=0.016666666666666666) at SCA_LogicManager.cpp:200
  • 23 0x0000000100ce94b4 in KX_Scene::LogicBeginFrame (this=0x10eb47200, curtime=0.20250560442606608) at KX_Scene.cpp:1523
  • 24 0x0000000100c946b5 in KX_KetsjiEngine::NextFrame (this=0x10fd91d40) at KX_KetsjiEngine.cpp:646
  • 25 0x0000000100b33af4 in StartKetsjiShell (C=0x104618608, ar=0x10f1c1828, cam_frame=0x7fff5fbff728, always_use_expand_framing=1) at BL_KetsjiEmbedStart.cpp:455
  • 26 0x000000010016daca in game_engine_exec (C=0x104618608, op=0x1046ba078) at view3d_view.c:1829
  • 27 0x0000000100011734 in wm_operator_invoke (C=0x104618608, ot=0x10849f9f8, event=0x1046aecb8, properties=0x10fc8b958, reports=0x0, poll_only=0) at wm_event_system.c:749
  • 28 0x0000000100013040 in wm_handler_operator_call (C=0x104618608, handlers=0x10f1c1930, handler=0x109103d38, event=0x1046aecb8, properties=0x10fc8b958) at wm_event_system.c:1309
  • 29 0x0000000100013929 in wm_handlers_do (C=0x104618608, event=0x1046aecb8, handlers=0x10f1c1930) at wm_event_system.c:1554
  • 30 0x0000000100014941 in wm_event_do_handlers (C=0x104618608) at wm_event_system.c:1909
  • 31 0x000000010000b694 in WM_main (C=0x104618608) at wm.c:386

32 0x000000010000a99f in main (argc=1, argv=0x7fff5fbffba8) at creator.c:1266

%%%

%%%problem confirmed in OSX. I update the sample file to force restart of the game. Campbell, can you take a look at this? Backtrace: - 0 0x00000001012f12fc in type_dealloc (type=0x10295fc40) at Objects/typeobject.c:2523 - 1 0x00000001012dd5cb in dict_dealloc (mp=0x105827ec0) at Objects/dictobject.c:1020 - 2 0x00000001012e1a57 in module_clear (m=0x11a41a1b8) at Objects/moduleobject.c:388 - 3 0x000000010138544f in delete_garbage [inlined] () at :739 - 4 0x000000010138544f in collect (generation=1) at Modules/gcmodule.c:897 - 5 0x0000000101385b5d in _PyObject_GC_Malloc (basicsize=<value temporarily unavailable, due to optimizations>) at Modules/gcmodule.c:963 - 6 0x0000000101385c15 in _PyObject_GC_New (tp=0x102bd5240) at Modules/gcmodule.c:1472 - 7 0x00000001012e1840 in PyCFunction_NewEx (ml=0x102960000, self=0x10a13b440, module=0x10a12b7d8) at Objects/methodobject.c:27 - 8 0x00000001012e2319 in PyModule_Create2 (module=0x102962640, module_api_version=<value temporarily unavailable, due to optimizations>) at Objects/moduleobject.c:131 - 9 0x000000010052c7de in BPyInit_bgl () at bgl.c:1292 - 10 0x0000000101360eaf in init_builtin (name=0x7fff5fbfdb30 "bgl") at Python/import.c:2169 - 11 0x000000010136122c in load_module (name=0x7fff5fbfdb30 "bgl", fp=<value temporarily unavailable, due to optimizations>, pathname=<value temporarily unavailable, due to optimizations>, type=6, loader=<value temporarily unavailable, due to optimizations>) at Python/import.c:2050 - 12 0x000000010136198f in import_submodule (mod=0x102bd5920, subname=0x7fff5fbfe010 "bgl", fullname=0x7fff5fbfe010 "bgl") at Python/import.c:2894 - 13 0x0000000101361f0a in load_next (mod=0x102bd5920, altmod=0x102bd5920, p_name=<value temporarily unavailable, due to optimizations>, buf=0x7fff5fbfe010 "bgl", p_buflen=0x7fff5fbfe000) at Python/import.c:2706 - 14 0x0000000101362304 in PyImport_ImportModuleLevel (name=<value temporarily unavailable, due to optimizations>, globals=0x10fd97890, locals=<value temporarily unavailable, due to optimizations>, fromlist=0x11184bc10, level=0) at Python/import.c:2422 - 15 0x0000000100539c4b in blender_import (UNUSED_self=0x0, args=0x11184e0b0, kw=0x0) at bpy_internal_import.c:236 - 16 0x000000010129d5d8 in PyObject_Call (func=0x10f660bd8, arg=0x11184e0b0, kw=0x0) at Objects/abstract.c:2149 - 17 0x000000010133f447 in PyEval_CallObjectWithKeywords (func=0x10f660bd8, arg=0x11184e0b0, kw=0x0) at Python/ceval.c:3761 - 18 0x000000010134337d in PyEval_EvalFrameEx (f=0x10fd9c860, throwflag=<value temporarily unavailable, due to optimizations>) at Python/ceval.c:2338 - 19 0x0000000101348cef in PyEval_EvalCodeEx (_co=0x109557718, globals=<value temporarily unavailable, due to optimizations>, locals=<value temporarily unavailable, due to optimizations>, args=0x0, argcount=0, kws=0x0, kwcount=0, defs=0x0, defcount=0, kwdefs=0x0, closure=0x0) at Python/ceval.c:3317 - 20 0x0000000101348fcf in PyEval_EvalCode (co=<value temporarily unavailable, due to optimizations>, globals=<value temporarily unavailable, due to optimizations>, locals=<value temporarily unavailable, due to optimizations>) at Python/ceval.c:767 - 21 0x0000000100d68845 in SCA_PythonController::Trigger (this=0x10fd9be00, logicmgr=0x10fdd11a0) at SCA_PythonController.cpp:410 - 22 0x0000000100d5be3c in SCA_LogicManager::BeginFrame (this=0x10fdd11a0, curtime=0.20250560442606608, fixedtime=0.016666666666666666) at SCA_LogicManager.cpp:200 - 23 0x0000000100ce94b4 in KX_Scene::LogicBeginFrame (this=0x10eb47200, curtime=0.20250560442606608) at KX_Scene.cpp:1523 - 24 0x0000000100c946b5 in KX_KetsjiEngine::NextFrame (this=0x10fd91d40) at KX_KetsjiEngine.cpp:646 - 25 0x0000000100b33af4 in StartKetsjiShell (C=0x104618608, ar=0x10f1c1828, cam_frame=0x7fff5fbff728, always_use_expand_framing=1) at BL_KetsjiEmbedStart.cpp:455 - 26 0x000000010016daca in game_engine_exec (C=0x104618608, op=0x1046ba078) at view3d_view.c:1829 - 27 0x0000000100011734 in wm_operator_invoke (C=0x104618608, ot=0x10849f9f8, event=0x1046aecb8, properties=0x10fc8b958, reports=0x0, poll_only=0) at wm_event_system.c:749 - 28 0x0000000100013040 in wm_handler_operator_call (C=0x104618608, handlers=0x10f1c1930, handler=0x109103d38, event=0x1046aecb8, properties=0x10fc8b958) at wm_event_system.c:1309 - 29 0x0000000100013929 in wm_handlers_do (C=0x104618608, event=0x1046aecb8, handlers=0x10f1c1930) at wm_event_system.c:1554 - 30 0x0000000100014941 in wm_event_do_handlers (C=0x104618608) at wm_event_system.c:1909 - 31 0x000000010000b694 in WM_main (C=0x104618608) at wm.c:386 # 32 0x000000010000a99f in main (argc=1, argv=0x7fff5fbffba8) at creator.c:1266 %%%

%%%I can confirm this on Win64, but I don't have debug symbols for Python, so I can't get a decent backtrace.%%%

%%%I can confirm this on Win64, but I don't have debug symbols for Python, so I can't get a decent backtrace.%%%

%%%fixed%%%

%%%fixed%%%

Changed status from 'Open' to: 'Resolved'

Changed status from 'Open' to: 'Resolved'
Author

%%%It's my fear that this bug has re-appeared, as it seems like Blender 2.6.2 is doing it again. In addition, I can't use the latest Blender builds from GraphicAll, as I think the BMesh merger broke the BGE, and it crashes almost each time I use any of my personal blend files with it. This also appears to happen to anyone else using the latest BGE builds.%%%

%%%It's my fear that this bug has re-appeared, as it seems like Blender 2.6.2 is doing it again. In addition, I can't use the latest Blender builds from GraphicAll, as I think the BMesh merger broke the BGE, and it crashes almost each time I use any of my personal blend files with it. This also appears to happen to anyone else using the latest BGE builds.%%%
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#29031
No description provided.