guodong / wmii

Automatically exported from code.google.com/p/wmii
MIT License
0 stars 0 forks source link

Application hangs when launched from wimenu - python wmiirc #176

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1. start wmii with python config wrapper (wmii -r python/wmiirc)
2. launch mplayer from wimenu (M+p -> "mplayer dvdnav://")
3. after a while (few minutes) application stops responding and has to be
killed

What is the expected result? What do you see instead?
Application launched from wimenu should run without hangups.

What version of the product are you using (wmii -v)? On what operating
system?
wmii-hg 2600, Python 2.6.3, Linux 2.6.33, Xorg 1.7.5

Please provide any additional information below.
When I run mplayer from xterm or from wimenu but with stdout and stderr
redirected (mplayer dvdnav:// > /dev/null 2> /dev/null), it plays dvd
normal, ie. without any hangups. I suspect it has someting to do with heavy
console output of mplayer. Somebody else on dev mailinglist confirmed this
issue with Firefox.

When I launch mplayer from wimenu in the same way as described above when
wmiirc handled with bash (standard configuration) or lua (wmiirc-lua) it
works without any problems.

David

Original issue reported on code.google.com by dunric...@gmail.com on 30 Mar 2010 at 10:54

GoogleCodeExporter commented 8 years ago
That was me confirming the issue with Firefox.

I might be wrong but I think the python script eats all the stdout and stderr 
from 
spawned programs, which is probably unnecessary.
There is a call (defined in pygmi.util) done for "wmiir setsid wimenu ..." and 
the 
program spawned by wimenu lives inside this same subprocess.Popen, hence stdout 
and 
stderr is collected. The background switch which now only tells to not wait for 
finishing should probably extended. I attach a patch, feel free to try it.

Original comment by skwi...@googlemail.com on 30 Mar 2010 at 2:44

Attachments:

GoogleCodeExporter commented 8 years ago
Thinking a bit more about that, wimenu and the spawned program is probably 
decoupled 
from the subprocess through the "wmiir setsid". Anyway, try the patch, I don't 
have 
the time now.

Original comment by skwi...@googlemail.com on 30 Mar 2010 at 2:59

GoogleCodeExporter commented 8 years ago
Yep, I did tested the patch and it works as expected - applications freeze no 
more.
On the other hand I don't know if simple closing of stdin and stdout at process
spawning won't have some consequences (although called process is intended to 
run in
the background ).

Thx for a quick fix, skwillt

Original comment by dunric...@gmail.com on 30 Mar 2010 at 10:59

GoogleCodeExporter commented 8 years ago
Good to hear that it works.

stdout=None in subprocess.Popen means that stdout is going to stdout of the 
parent 
process, which is the wmiirc here. And stdin is empty in any case. Nothing 
wrong with 
that, I think.

Original comment by skwi...@googlemail.com on 31 Mar 2010 at 6:54

GoogleCodeExporter commented 8 years ago
After reading subprocess docs I can confirm the value None for stdin,stdout and
stderr works exactly as you described.
I'm sorry for the confusion.

Original comment by dunric...@gmail.com on 31 Mar 2010 at 6:00

GoogleCodeExporter commented 8 years ago

Original comment by sunaku on 12 Apr 2010 at 9:02

GoogleCodeExporter commented 8 years ago
This issue was closed by revision 3d03873142.

Original comment by maglion...@gmail.com on 24 May 2010 at 5:04