Subject: Rxvt 2.7.9 invoked with no stdin

From: Dan Espen <[email-masked]>
Date: Wed, 05 Feb 2003 09:12:08 -0500

Hi,

I'm not subscribed, cc fvwm-workers if you have questions.

We recently changed fvwm so that when it launches a process,
it first closes STDIN.  We did this for gmplayer as discussed
in this thread:

http://www.hpc.uh.edu/fvwm/archive/0301/msg00305.html

We just got a problem report from someone using rxvt version
2.7.9.  He reports that when launching rxvt from fvwm,
using the fvwm command:

Exec rxvt

he sees the messages:

Xlib: sequence lost (0x10808 > 0x5a) in reply type 0x8!
or
Xlib: sequence lost (0x10d4b > 0x5a) in reply type 0x1b!

and rxvt doesn't start.

I was able to reproduce the problem, but wasn't able to pin
down the cause.  The problem seemed to come and go.

I see recent changes in src/init.c that look a little suspicious,
but I can't say what the exact problem is.

I'm going to close our bug report and consider this an rxvt
problem.

-- 
Dan Espen                               E-mail: [email-masked]
--
Visit the official FVWM web page at <URL:http://www.fvwm.org/>.
To unsubscribe from the list, send "unsubscribe fvwm-workers" in the
body of a message to [email-masked].
To report problems, send mail to [email-masked]

---

From: Alexander Kotelnikov <[email-masked]>
Date: Wed, 05 Feb 2003 19:23:10 +0300

>>>>> On Wed, 05 Feb 2003 09:12:08 -0500
>>>>> "DE" == Dan Espen <[email-masked]> wrote:
DE> 
DE> Hi,
DE> I'm not subscribed, cc fvwm-workers if you have questions.
DE> 
DE> We recently changed fvwm so that when it launches a process,
DE> it first closes STDIN.  We did this for gmplayer as discussed
DE> in this thread:
DE> 
DE> http://www.hpc.uh.edu/fvwm/archive/0301/msg00305.html
DE> 

I believe that the solution I have proposed about a year ago, and
which I apply to my debian package is more obvious and correct:

--- fvwm/builtins.c.orig        Sun Jan 13 02:04:00 2002
+++ fvwm/builtins.c     Sun Jan 13 04:00:43 2002
@@ -782,6 +782,11 @@
   /* Not everyone has vfork! */
   if (!(fork())) /* child process */
   {
+    if ( setpgrp() == -1 )
+    {
+      fvwm_msg(ERR,"exec_function","setpgrp failed (%s)",strerror(errno));
+      exit(100);
+    }
     if (execl(exec_shell_name, exec_shell_name, "-c", cmd, NULL)==-1)
     {
       fvwm_msg(ERR,"exec_function","execl failed (%s)",strerror(errno));

The patch does not apply to the current fvwm, since close(0) appeared
(which should definetly replaced with close(STDIN_FILENO))

-- 
Alexander Kotelnikov
Saint-Petersburg, Russia

---

From: Dan Espen <[email-masked]>
Date: Wed, 05 Feb 2003 11:38:26 -0500

> +++ fvwm/builtins.c     Sun Jan 13 04:00:43 2002

The setpgrp change has been in Fvwm since 2002-01-29.
The user reported this problem against fvwm 2.5.5 which started
on 2002-10-29.  (Plus I'm pretty sure I created it this AM.)

I'll apply the STDIN_FILENO change.