Re: [xmonad] Strange spawnPipe error

On Sat, Dec 26, 2009 at 9:47 PM, Ferenc Wagner
Sorry, I can't find any trace of xmonad in the output. I'd recommend changing the xmonad call in your startup file to something like
I chenged my ~/.xinitrc entry to exec strace -f xmonad -o xmonad.strace Output contains errors "createSession: permission denied (Operation not permitted)" (attached). Hope it will help.
Please check that it contains the erring setsid call. But even given a proper strace output, I can't guarantee a solution. :)
Anyway, thanks :)

Viktor Deryagin
On Sat, Dec 26, 2009 at 9:47 PM, Ferenc Wagner
wrote: Sorry, I can't find any trace of xmonad in the output. I'd recommend changing the xmonad call in your startup file to something like
I chenged my ~/.xinitrc entry to
exec strace -f xmonad -o xmonad.strace
Output contains errors "createSession: permission denied (Operation not permitted)" (attached). Hope it will help.
Very strange, all the setsid() syscalls are doubled like for example [pid 11584] setsid() = 11584 [pid 11584] setsid() = -1 EPERM (Operation not permitted) [pid 11584] write(2, "xmonad-i386-linux: ", 19) = 19 [pid 11584] write(2, "createSession: permission denied"..., 58) = 58 [pid 11584] write(2, "\n", 1) = 1 setsid() should indeed work as above: after a fork(), one setsid() should succeed, but further ones should fail. What is your GHC version? What is your unix package version? Please compile the following test program, run it under strace -f and send the output back:
import System.Posix.Process
child = do createSession putStrLn "child done" -- remove this line if the program hangs
main = do pid <- forkProcess child putStrLn $ "forked " ++ show pid status <- getProcessStatus True False pid putStrLn $ "child status: " ++ show status -- Regards, Feri.

On Sun, Dec 27, 2009 at 12:56 AM, Ferenc Wagner
Very strange, all the setsid() syscalls are doubled like for example
[pid 11584] setsid() = 11584 [pid 11584] setsid() = -1 EPERM (Operation not permitted) [pid 11584] write(2, "xmonad-i386-linux: ", 19) = 19 [pid 11584] write(2, "createSession: permission denied"..., 58) = 58 [pid 11584] write(2, "\n", 1) = 1
Xmonad should run four instances of dzen2 (4 spawnPipe entries in xmonad.hs), maybe this is the reason?
What is your GHC version?
$ ghc --version The Glorious Glasgow Haskell Compilation System, version 6.10.4
What is your unix package version?
What is "unix package"? Sorry for stupid question :)
Please compile the following test program, run it under strace -f and send the output back:
Attached.

* On Sunday, December 27 2009, Viktor Deryagin wrote:
On Sun, Dec 27, 2009 at 12:56 AM, Ferenc Wagner
wrote: ... What is your unix package version?
What is "unix package"? Sorry for stupid question :)
$ ghc-pkg list unix I'm not sure how to help with the rest of this troubleshooting, however. -- Adam

Adam Vogt
* On Sunday, December 27 2009, Viktor Deryagin wrote:
On Sun, Dec 27, 2009 at 12:56 AM, Ferenc Wagner
wrote: ... What is your unix package version?
What is "unix package"? Sorry for stupid question :)
$ ghc-pkg list unix
I'm not sure how to help with the rest of this troubleshooting, however.
Nevermind, I've found the bug. spawnPipe changed from forkProcess to xfork. xfork contains createSession, but spawnPipe also kept its own, so there're two in the code path now. The latter should be removed. -- Regards, Feri.

On Sun, Dec 27, 2009 at 01:25:40AM +0100, Ferenc Wagner wrote:
Adam Vogt
writes: * On Sunday, December 27 2009, Viktor Deryagin wrote:
On Sun, Dec 27, 2009 at 12:56 AM, Ferenc Wagner
wrote: ... What is your unix package version?
What is "unix package"? Sorry for stupid question :)
$ ghc-pkg list unix
I'm not sure how to help with the rest of this troubleshooting, however.
Nevermind, I've found the bug. spawnPipe changed from forkProcess to xfork. xfork contains createSession, but spawnPipe also kept its own, so there're two in the code path now. The latter should be removed.
Thanks for tracking this down, it was my mistake when adding xfork. I've pushed a patch that fixes the issue. Cheers, Spencer Janssen

Spencer Janssen
On Sun, Dec 27, 2009 at 01:25:40AM +0100, Ferenc Wagner wrote:
Nevermind, I've found the bug. spawnPipe changed from forkProcess to xfork. xfork contains createSession, but spawnPipe also kept its own, so there're two in the code path now. The latter should be removed.
Thanks for tracking this down, it was my mistake when adding xfork. I've pushed a patch that fixes the issue.
By the way, what's the point in Xmonad calling createSession any time at all? -- Thanks, Feri.

On Sat, Dec 26, 2009 at 06:41:59PM -0600, Spencer Janssen wrote:
On Sun, Dec 27, 2009 at 01:25:40AM +0100, Ferenc Wagner wrote:
Adam Vogt
writes: * On Sunday, December 27 2009, Viktor Deryagin wrote:
On Sun, Dec 27, 2009 at 12:56 AM, Ferenc Wagner
wrote: ... What is your unix package version?
What is "unix package"? Sorry for stupid question :)
$ ghc-pkg list unix
I'm not sure how to help with the rest of this troubleshooting, however.
Nevermind, I've found the bug. spawnPipe changed from forkProcess to xfork. xfork contains createSession, but spawnPipe also kept its own, so there're two in the code path now. The latter should be removed.
Thanks for tracking this down, it was my mistake when adding xfork. I've pushed a patch that fixes the issue.
Have you actually pushed this yet? I don't get any patches when doing a darcs pull. -Brent

On Sun, Dec 27, 2009 at 01:19:37AM -0500, Brent Yorgey wrote:
On Sat, Dec 26, 2009 at 06:41:59PM -0600, Spencer Janssen wrote:
On Sun, Dec 27, 2009 at 01:25:40AM +0100, Ferenc Wagner wrote:
Adam Vogt
writes: * On Sunday, December 27 2009, Viktor Deryagin wrote:
On Sun, Dec 27, 2009 at 12:56 AM, Ferenc Wagner
wrote: ... What is your unix package version?
What is "unix package"? Sorry for stupid question :)
$ ghc-pkg list unix
I'm not sure how to help with the rest of this troubleshooting, however.
Nevermind, I've found the bug. spawnPipe changed from forkProcess to xfork. xfork contains createSession, but spawnPipe also kept its own, so there're two in the code path now. The latter should be removed.
Thanks for tracking this down, it was my mistake when adding xfork. I've pushed a patch that fixes the issue.
Have you actually pushed this yet? I don't get any patches when doing a darcs pull.
My mistake, I was confused and was looking for a patch to core rather than contrib. The fix works for me, thanks! -Brent

Viktor Deryagin
On Sun, Dec 27, 2009 at 12:56 AM, Ferenc Wagner
wrote: Very strange, all the setsid() syscalls are doubled like for example
[pid 11584] setsid() = 11584 [pid 11584] setsid() = -1 EPERM (Operation not permitted) [pid 11584] write(2, "xmonad-i386-linux: ", 19) = 19 [pid 11584] write(2, "createSession: permission denied"..., 58) = 58 [pid 11584] write(2, "\n", 1) = 1
Xmonad should run four instances of dzen2 (4 spawnPipe entries in xmonad.hs), maybe this is the reason?
There are four such pairs of setsid calls in your strace output, corresponding to the four spawnPipes, but I don't understand why they are *pairs*, like above...
$ ghc --version The Glorious Glasgow Haskell Compilation System, version 6.10.4
Same as mine.
What is your unix package version?
What is "unix package"? Sorry for stupid question :)
Here's the way to find out: $ ghc-pkg describe unix | grep version version: 2.3.2.0
Please compile the following test program, run it under strace -f and send the output back:
Attached.
Thanks, this contains a simple setsid() call, as it should. Please test another short program the same way:
import XMonad.Util.Run main = spawnPipe "cat" -- Thanks, Feri.
participants (5)
-
Adam Vogt
-
Brent Yorgey
-
Ferenc Wagner
-
Spencer Janssen
-
Viktor Deryagin