Segfault / hang on shutdown when rendering from script (NVidia driver bug?) #29385

Closed
opened 2011-11-24 16:03:22 +01:00 by Paul Melis · 6 comments

%%%I was toying around with rendering a set of frames from a Python script:


t_shutdown.py

import bpy

scene = bpy.context.scene
render = scene.render

render.resolution_x = 960
render.resolution_y = 540
render.resolution_percentage = 100
render.image_settings.file_format = 'PNG'

for frame in [1, 4, 6]:

  scene.frame_current  = frame
  render.filepath = '/tmp/doh%04d.png' % frame
  bpy.ops.render.render(write_still=True, animation=False)

When I run this script with blender -b -P ./t_shutdown.py the rendering
sometimes hangs at exit, sometimes segfaults at exit and sometimes succeeds.
I tried to get some stacktraces, seems to be something to do with shutdown
and unloading NVidia libraries:

Hang (stack trace from gdb -p ):

(gdb) bt

0 0x00007f44f1754c21 in _nv012tls ()

 from /usr/lib/tls/libnvidia-tls.so.285.05.09
  • 1 0x00007f44f72bce33 in ?? () from /usr/lib/libGL.so.1
  • 2 0x00007f44f729c379 in ?? () from /usr/lib/libGL.so.1
  • 3 0x00007f44f753c3ec in _dl_fini () at dl-fini.c:248
  • 4 0x00007f44f2038262 in __run_exit_handlers (status=0) at exit.c:78
  • 5 *__GI_exit (status=0) at exit.c:100
  • 6 0x00000000007f9478 in WM_exit (C=)
  at /home/paulmlocal/c/blender-svn/source/blender/windowmanager/intern/wm_init_exit.c:463

7 0x00000000007eefb8 in main (argc=4, argv=0x7fffef4d41f8)

  at /home/paulmlocal/c/blender-svn/source/creator/creator.c:1247

Crash:

(gdb) bt

  • 0 0x00007f0011181a08 in _nv007tls () from /usr/lib/tls/libnvidia-tls.so.285.05.09
  • 1 0x00007f0015c9ea61 in __nptl_deallocate_tsd (arg=) at pthread_create.c:155
  • 2 start_thread (arg=) at pthread_create.c:307
  • 3 0x00007f0011b1270d in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:112

4 0x0000000000000000 in ?? ()

Blender info:

Blender 2.60 (sub 5)

      build date: 2011-11-24
      build time: 13:16:12
      build revision: 42122
      build platform: Linux
      build type: RelWithDebInfo
      build c flags:  -fopenmp  -msse2  -msse -pipe -fPIC -funsigned-char -fno-strict-aliasing  -Wall -Wcast-align -Werror=declaration-after-statement -Werror=implicit-function-declaration -Werror=return-type -Wstrict-prototypes -Wno-char-subscripts -Wno-unknown-pragmas -Wpointer-arith -Wunused-parameter -Wwrite-strings
      build c++ flags:  -D__STDC_CONSTANT_MACROS -fopenmp  -msse2  -msse -pipe -fPIC -funsigned-char -fno-strict-aliasing  -Wall -Wno-invalid-offsetof -Wno-sign-compare
      build link flags: -pthread
      build system: CMake

I see this behaviour on an Ubuntu 10.04, x86_64 system with NVidia 285.05.09 drivers. Tried with newer drivers, 290.10, but same problem.
This might be a driver issue, as I don't see this happening on a different system, which has NVidia 260.19.26 drivers.
%%%

%%%I was toying around with rendering a set of frames from a Python script: ---------------------------------------------------- t_shutdown.py ---------------------------------------------------- import bpy scene = bpy.context.scene render = scene.render render.resolution_x = 960 render.resolution_y = 540 render.resolution_percentage = 100 render.image_settings.file_format = 'PNG' for frame in [1, 4, 6]: ``` scene.frame_current = frame render.filepath = '/tmp/doh%04d.png' % frame bpy.ops.render.render(write_still=True, animation=False) ``` ---------------------------------------------------- When I run this script with blender -b -P ./t_shutdown.py the rendering sometimes hangs at exit, sometimes segfaults at exit and sometimes succeeds. I tried to get some stacktraces, seems to be something to do with shutdown and unloading NVidia libraries: Hang (stack trace from gdb -p <pid>): (gdb) bt # 0 0x00007f44f1754c21 in _nv012tls () ``` from /usr/lib/tls/libnvidia-tls.so.285.05.09 ``` - 1 0x00007f44f72bce33 in ?? () from /usr/lib/libGL.so.1 - 2 0x00007f44f729c379 in ?? () from /usr/lib/libGL.so.1 - 3 0x00007f44f753c3ec in _dl_fini () at dl-fini.c:248 - 4 0x00007f44f2038262 in __run_exit_handlers (status=0) at exit.c:78 - 5 *__GI_exit (status=0) at exit.c:100 - 6 0x00000000007f9478 in WM_exit (C=<value optimized out>) ``` at /home/paulmlocal/c/blender-svn/source/blender/windowmanager/intern/wm_init_exit.c:463 ``` # 7 0x00000000007eefb8 in main (argc=4, argv=0x7fffef4d41f8) ``` at /home/paulmlocal/c/blender-svn/source/creator/creator.c:1247 ``` Crash: (gdb) bt - 0 0x00007f0011181a08 in _nv007tls () from /usr/lib/tls/libnvidia-tls.so.285.05.09 - 1 0x00007f0015c9ea61 in __nptl_deallocate_tsd (arg=<value optimized out>) at pthread_create.c:155 - 2 start_thread (arg=<value optimized out>) at pthread_create.c:307 - 3 0x00007f0011b1270d in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:112 # 4 0x0000000000000000 in ?? () Blender info: Blender 2.60 (sub 5) ``` build date: 2011-11-24 build time: 13:16:12 build revision: 42122 build platform: Linux build type: RelWithDebInfo build c flags: -fopenmp -msse2 -msse -pipe -fPIC -funsigned-char -fno-strict-aliasing -Wall -Wcast-align -Werror=declaration-after-statement -Werror=implicit-function-declaration -Werror=return-type -Wstrict-prototypes -Wno-char-subscripts -Wno-unknown-pragmas -Wpointer-arith -Wunused-parameter -Wwrite-strings build c++ flags: -D__STDC_CONSTANT_MACROS -fopenmp -msse2 -msse -pipe -fPIC -funsigned-char -fno-strict-aliasing -Wall -Wno-invalid-offsetof -Wno-sign-compare build link flags: -pthread build system: CMake ``` I see this behaviour on an Ubuntu 10.04, x86_64 system with NVidia 285.05.09 drivers. Tried with newer drivers, 290.10, but same problem. This might be a driver issue, as I don't see this happening on a different system, which has NVidia 260.19.26 drivers. %%%
Author

Changed status to: 'Open'

Changed status to: 'Open'

Changed status from 'Open' to: 'Archived'

Changed status from 'Open' to: 'Archived'
Author
%%%Seems to be a driver bug, i.e. see http://www.nvnews.net/vbulletin/showthread.php?t=164775 http://code.google.com/p/clementine-player/issues/detail?id=2113%%%
Author

%%%Setting __GL_SINGLE_THREADED=1 seems to work as a work-around for me (got that one from https://bugs.gentoo.org/show_bug.cgi?id=375615)%%%

%%%Setting __GL_SINGLE_THREADED=1 seems to work as a work-around for me (got that one from https://bugs.gentoo.org/show_bug.cgi?id=375615)%%%

%%%Indeed there's posts about this bug crashing various applications. NVidia supposedly fixed an issue with this in 285.05.09, but maybe it only works when you have a newer X.org version. Moving to the OpenGL errors tracker, this is not something we can solve in Blender.%%%

%%%Indeed there's posts about this bug crashing various applications. NVidia supposedly fixed an issue with this in 285.05.09, but maybe it only works when you have a newer X.org version. Moving to the OpenGL errors tracker, this is not something we can solve in Blender.%%%

%%%Moved from Blender 2.5 Bug Tracker to OpenGL errors%%%

%%%Moved from Blender 2.5 Bug Tracker to OpenGL errors%%%
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
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
3 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#29385
No description provided.