Blender doesn't quit after python script/render in background mode (stuck trying to close OpenAL device) #50623

Closed
opened 2017-02-08 15:37:02 +01:00 by Jonathan Hale · 26 comments

System Information
Linux Mint 17.2 Rafaela (GNU/Linux 3.16.0-38-generic x86_64), Pulseaudio
(Mate Desktop Environment)

Blender Version
Broken: Blender 2.78 (sub 0) e8299c8
Worked: Same version on Windows 10 64bit and Antergos Linux 64 Bit (with GNOME 3.22.2)

Short description of error
When blender is run through a background command like

./blender -b -f 0

on a system on which the current desktop session is inactive (user logged on, but "switch user" was performed), blender does not quit after completing the render. Same holds for "--python" and "--python-expr" options.

I have a gitlab-ci-runner (build slave for gilab-ci) installed on this operating system to test some blender python scripts. Logging in via SSH and running blender also leaves blender running.

Exact steps for others to reproduce the error

No blend file needed.

  1. Download "blender-2.78a-linux-glibc211-x86_64.tar.bz2" from blender.org/download
  2. Extract
  3. "Switch User"
  4. Log in to same user account via SSH
  5. Run "./blender -b -f 0"

Thanks for being so awesome! :)
Regards, Jonathan.

**System Information** Linux Mint 17.2 Rafaela (GNU/Linux 3.16.0-38-generic x86_64), Pulseaudio (Mate Desktop Environment) **Blender Version** Broken: Blender 2.78 (sub 0) e8299c8 Worked: Same version on Windows 10 64bit and Antergos Linux 64 Bit (with GNOME 3.22.2) **Short description of error** When blender is run through a background command like ./blender -b -f 0 on a system on which the current desktop session is inactive (user logged on, but "switch user" was performed), blender does not quit after completing the render. Same holds for "--python" and "--python-expr" options. I have a gitlab-ci-runner (build slave for gilab-ci) installed on this operating system to test some blender python scripts. Logging in via SSH and running blender also leaves blender running. **Exact steps for others to reproduce the error** No blend file needed. 1. Download "blender-2.78a-linux-glibc211-x86_64.tar.bz2" from blender.org/download 2. Extract 3. "Switch User" 4. Log in to same user account via SSH 5. Run "./blender -b -f 0" Thanks for being so awesome! :) Regards, Jonathan.
Author

Changed status to: 'Open'

Changed status to: 'Open'
Author

Added subscriber: @Squareys

Added subscriber: @Squareys
Author

Oh, well.

I forgot to test the nightly build. 69dbeeca48 works! (Sorry, I was confused, the build was running on the Antergos runner instead.) Latest build also doesn't work.

Oh, well. I forgot to test the nightly build. ~~69dbeeca48 works!~~ (Sorry, I was confused, the build was running on the Antergos runner instead.) Latest build also doesn't work.
Member

Added subscriber: @TheOnlyJoey

Added subscriber: @TheOnlyJoey
Member

Changed status from 'Open' to: 'Resolved'

Changed status from 'Open' to: 'Resolved'
Joey Ferwerda self-assigned this 2017-02-08 18:11:39 +01:00
Member

No problem, can happen.
Will close.

No problem, can happen. Will close.
Author

@TheOnlyJoey Sorry there was a misunderstanding, I had edited the comment shortly after posting it, you may have only read the original unedited comment sent via email notification?

The problem does still occur with the latest build.

@TheOnlyJoey Sorry there was a misunderstanding, I had edited the comment shortly after posting it, you may have only read the original unedited comment sent via email notification? The problem does still occur with the latest build.
Author

Changed status from 'Resolved' to: 'Open'

Changed status from 'Resolved' to: 'Open'

Added subscriber: @mont29

Added subscriber: @mont29

I cannot confirm that, here with latest master, it quits as expected with that command.

I cannot confirm that, here with latest master, it quits as expected with that command.

On a side note, please note that running blender -b -f 0 will run your system’s blender, not the one you extracted from archive (unless you properly set paths of course?).

And please also do try the latest build from our buildbot.

On a side note, please note that running `blender -b -f 0` will run your system’s blender, not the one you extracted from archive (unless you properly set paths of course?). And please also do try the latest build from [our buildbot](https://builder.blender.org/download).
Author

Hi @mont29!

please note that running blender -b -f 0

Yes, sorry, that should have been ./blender -b -f 0. I don't have any other blender installed on that system.

And please also do try the latest build from

I did that on 8th of February (see above comments). Will try a newer one.

I cannot confirm that, here with latest master

Just to be certain: This only happens on Mint 17.2.

Hi @mont29! > please note that running blender -b -f 0 Yes, sorry, that should have been `./blender -b -f 0`. I don't have any other blender installed on that system. > And please also do try the latest build from I did that on 8th of February (see above comments). Will try a newer one. > I cannot confirm that, here with latest master Just to be certain: This only happens on Mint 17.2.
Author

The newest build from the buildbot (blender-2.78-38155c7d3c-linux-glibc219-x86_64.tar.bz2) also does not work for me.

The newest build from the buildbot (blender-2.78-38155c7d3c-linux-glibc219-x86_64.tar.bz2) also does not work for me.

Just as follow up, had quick chat over IRC with @Squareys, tried a few more things (like running with debug mode, or with factory-startup) over ssh, nothing new. Here is a result from command line over ssh: http://pasteall.org/241216.

Note that the ultimate Blender quit line is missing, which seems to indicates that Blender is indeed not terminating for some weird reason… :/

More on Monday, test shall be done directly on site in front of the machine, in a regular Bash shell…

Just as follow up, had quick chat over IRC with @Squareys, tried a few more things (like running with debug mode, or with factory-startup) over ssh, nothing new. Here is a result from command line over ssh: http://pasteall.org/241216. Note that the ultimate `Blender quit` line is missing, which seems to indicates that Blender is indeed **not** terminating for some weird reason… :/ More on Monday, test shall be done directly on site in front of the machine, in a regular Bash shell…
Author

@mont29 This kept wondering around in my mind, so I created a Virtual Box with Mint 17.2 and here are my findings:

  • Running from bash works.
  • Running via SSH does not work
  • BUT running via SSH works if the same user is logged on via desktop environment.

This gave me an idea, you won't believe: Force-terminating pulse-audio solves the problem. Yeah, for some reason it waits for a device shutdown I guess? Because the user is not logged on, pulse audio does not react.
Explains why this wasn't a problem on the other systems :D

I hope that helps. Maybe this bug will propagate to openal-soft.

@mont29 This kept wondering around in my mind, so I created a Virtual Box with Mint 17.2 and here are my findings: - Running from bash works. - Running via SSH does not work - **BUT** running via SSH works **if the same user is logged on via desktop environment.** This gave me an idea, you won't believe: Force-terminating pulse-audio solves the problem. Yeah, for some reason it waits for a device shutdown I guess? Because the user is not logged on, pulse audio does not react. Explains why this wasn't a problem on the other systems :D I hope that helps. Maybe this bug will propagate to openal-soft.
Author

Slight correction:

It only doesn't work, if there is a inactive mate-session running (User is logged on, but "switched user"). It works, if the user is not logged on at all (except for SSH) and if the user is logged on with an active session. I am guessing because for SSH-only pulseaudio is not started and openal uses a different device while for active session, puseaudio responds adequately.

I think for me this is good enough, there is no reason why I'd need to have an inactive session, hence if you want to close this as "won't fix", that is fine with me.

Slight correction: It only doesn't work, if there is a inactive mate-session running (User is logged on, but "switched user"). It works, if the user is not logged on at all (except for SSH) and if the user is logged on with an active session. I am guessing because for SSH-only pulseaudio is not started and openal uses a different device while for active session, puseaudio responds adequately. I think for me this is good enough, there is no reason why I'd need to have an inactive session, hence if you want to close this as "won't fix", that is fine with me.
Author

And if you're interested, here's a quick stack trace with gdb while it stalls:

(gdb) backtrace
- 0  0x00007ffff771a66b in pthread_join (threadid=140737353905920, thread_return=0x7fffffffdeb8) at pthread_join.c:92
- 1  0x0000000002adfc22 in ?? ()
- 2  0x0000000002accb54 in ?? ()
- 3  0x0000000002ab796d in alcDestroyContext ()
- 4  0x0000000001e5f612 in AUD_OpenALDevice::~AUD_OpenALDevice() ()
- 5  0x0000000001e5f659 in AUD_OpenALDevice::~AUD_OpenALDevice() ()
- 6  0x0000000001e478a9 in AUD_exit ()
- 7  0x00000000017eb100 in BKE_sound_exit ()
- 8  0x00000000010620fd in WM_exit_ext ()
- 9  0x00000000010624de in WM_exit ()
#10 0x0000000000ff1b68 in main ()
And if you're interested, here's a quick stack trace with gdb while it stalls: ``` (gdb) backtrace - 0 0x00007ffff771a66b in pthread_join (threadid=140737353905920, thread_return=0x7fffffffdeb8) at pthread_join.c:92 - 1 0x0000000002adfc22 in ?? () - 2 0x0000000002accb54 in ?? () - 3 0x0000000002ab796d in alcDestroyContext () - 4 0x0000000001e5f612 in AUD_OpenALDevice::~AUD_OpenALDevice() () - 5 0x0000000001e5f659 in AUD_OpenALDevice::~AUD_OpenALDevice() () - 6 0x0000000001e478a9 in AUD_exit () - 7 0x00000000017eb100 in BKE_sound_exit () - 8 0x00000000010620fd in WM_exit_ext () - 9 0x00000000010624de in WM_exit () #10 0x0000000000ff1b68 in main () ```
Joey Ferwerda was unassigned by Bastien Montagne 2017-02-10 15:06:02 +01:00
Joerg Mueller was assigned by Bastien Montagne 2017-02-10 15:06:02 +01:00

Added subscriber: @neXyon

Added subscriber: @neXyon

Nice catch!

@neXyon, not sure whether we consider this a bug in Blender or not? Will let you decide here. :)

Nice catch! @neXyon, not sure whether we consider this a bug in Blender or not? Will let you decide here. :)
Bastien Montagne changed title from Blender doesn't quit after python script/render in background mode to Blender doesn't quit after python script/render in background mode (stuck trying to close OpenAL device) 2017-02-10 15:06:40 +01:00
Member

Hmm, sounds like a problem of OpenAL/pulseaudio, so I guess there's nothing I can do here. It works fine for me, but then again I don't have pulseaudio even installed. ;-)

There is a workaround however, just use -noaudio and you should be fine.

Hmm, sounds like a problem of OpenAL/pulseaudio, so I guess there's nothing I can do here. It works fine for me, but then again I don't have pulseaudio even installed. ;-) There is a workaround however, just use -noaudio and you should be fine.
Author

@neXyon

just use -noaudio and you should be fine.

Oooh, nice! Thanks!

@neXyon > just use -noaudio and you should be fine. Oooh, nice! Thanks!
Author

Tried it out to be 100% sure (not that there'd be anything left to still cause this issue) and can verify that blender quits normally when using -noaudio.
Thanks again everyone. :)

Tried it out to be 100% sure (not that there'd be anything left to still cause this issue) and can verify that blender quits normally when using `-noaudio`. Thanks again everyone. :)
Member

Changed status from 'Open' to: 'Archived'

Changed status from 'Open' to: 'Archived'
Member

Cool will archive the report then, thanks for the report!

Cool will archive the report then, thanks for the report!

Added subscriber: @zutxita

Added subscriber: @zutxita

I don't know why but it happens to me this

error_blender.PNG

After several ours working on the program (v2.80 release) when I quit this prompt window stays open forever and it doesn't close itself. I can't close it with the X key. I have to close it by forcing it. If I open blender and quit again, it doesn't happen. It seems to happen when working a lot with the program? maybe? I don't know.

system-info.txt

I don't know why but it happens to me this ![error_blender.PNG](https://archive.blender.org/developer/F7809778/error_blender.PNG) After several ours working on the program (v2.80 release) when I quit this prompt window stays open forever and it doesn't close itself. I can't close it with the X key. I have to close it by forcing it. If I open blender and quit again, it doesn't happen. It seems to happen when working a lot with the program? maybe? I don't know. [system-info.txt](https://archive.blender.org/developer/F7809793/system-info.txt)
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#50623
No description provided.