Subject: FVWM: Trouble with FvwmCommand / FvwmCommandS (fwd)

From: Jarkko Lietolahti <[email-masked]>
Date: Fri, 30 Apr 1999 18:51:29 +0300 (EEST)

Hello,
I've been trying to get FvwmCommand to work but to no avail. 

I load FvwmCommandS from my InitFunction in .fvwm2rc. But it refuses to
work returning "dead pipe message": "FvwmCommandS: dead pipe". 
 
I've tried both from source and fvwm2-2.2-5.i386.rpm but both ended up
same.

Here's little ptrace from running forced FvwmCommandS 1 1 1 1 1, plus i've
added few printfs.

Any idea what might be causing this?
I'm running Linux 2.2.6, glibc-2.1.1-5 and the rest..

atexit(0x4000a180)                                = 0
__libc_init_first(7, 0xbffffb3b, 0xbffffb4a, 0xbffffb4c, 0xbffffb4e) = 0x4000a180
__register_frame_info(0x0804a8fc, 0x0804aa80, 0xbffff9b8, 0x08048645, 0x40012b28) = 0x40103640
atexit(0x08049610)                                = 0
signal(13, 0x080489d0)                            = NULL
signal(2, 0x080489f4)                             = NULL
signal(3, 0x080489f4)                             = NULL
signal(1, 0x080489f4)                             = NULL
signal(15, 0x080489f4)                            = NULL
__strtol_internal("1", NULL, 10)                  = 1
__strtol_internal("1", NULL, 10)                  = 1
printf("fd0: %i\nfd1:%i\n", 1, 1)                 = 13
printf("fifoname: %i\n", -1073743020)             = 22
__strtol_internal("1", NULL, 10)                  = 1
__strtol_internal("1", NULL, 10)                  = 1
printf("fifoname: %s\n", "1")                     = 12
malloc(3)                                         = 0x0804aac8
malloc(3)                                         = 0x0804aad8
strcpy(0x0804aac8, "1")                           = 0x0804aac8
strcpy(0x0804aad8, "1")                           = 0x0804aad8
strcat("1", "C")                                  = "1C"
strcat("1", "M")                                  = "1M"
printf("doing mystical open: %s\n", "1C")         = 24
open("1C", 2050, 01001113624)                     = -1
unlink("1M")                                      = -1
unlink("1C")                                      = -1
printf("opening fifo :%s\n", "1M")                = 17
mkfifo("1M", 0600)                                = 0
printf("opening fifo :%s\n", "1C")                = 17
mkfifo("1C", 0600)                                = 0
printf("all fifos created\n")                     = 18
printf("opening fifos")                           = 13
open("1C", 2562, 01001113722)                     = 4
printf("command fifo opened\n")                   = 20
free(0x0804aac8)                                  = <void>
open("1M", 2562, 01001125310)                     = 5
printf("message fifo opened\n")                   = 20
free(0x0804aad8)                                  = <void>
malloc(3)                                         = 0x0804aac8
strcpy(0x0804aac8, "1")                           = 0x0804aac8
printf("returning 0\n")                           = 12
printf("trying to send text\n")                   = 20
write(1, "", 4)                                   = 4
write(1, "", 4)                                   = 4
write(1, "\001", 4)                               = 4
printf("after sending text\n")                    = 19
printf("loooping .. ")                            = 12
select(1024, 0xbffff924, 0, 0, 0)                 = 1
__errno_location()                                = 0x40103660
read(1, "\n", 16)                                 = 1
__errno_location()                                = 0x40103660
fprintf(0x0804aa28, "%s: dead pipe\n", "FvwmCommandS"FvwmCommandS: dead pipe
) = 24
close(1)                                          = 0
close(1)                                          = -1
close(5)                                          = 0
close(4)                                          = 0
strcat("1", "C")                                  = "1C"
unlink("1C")                                      = 0
unlink("1M")                                      = 0
unlink("1R")                                      = -1
free(0x0804aac8)                                  = <void>
exit(0)                                           = <void>
__deregister_frame_info(0x0804a8fc, 0xbffff288, 0x08049625, 0x40102b34, 0xbffff29c) = 0x0804aa80
+++ exited (status 0) +++
--
[email-masked]

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

---

From: [email-masked] (Paul D. Smith)
Date: 30 Apr 1999 12:21:24 -0400

%% Jarkko Lietolahti <[email-masked]> writes:

  jl> I've been trying to get FvwmCommand to work but to no avail. 

  jl> I load FvwmCommandS from my InitFunction in .fvwm2rc. But it refuses to
  jl> work returning "dead pipe message": "FvwmCommandS: dead pipe". 

Are you _sure_ you started as a module, as described in the man page?

This sounds like what you'd see if you just started it normally.  When
reporting bugs it's always best to cut and paste the problem
code/text/whatever; in this case please show us your InitFunction.  It
should contain something like:

  + "I" Module FvwmCommandS

Note the "Module" here, not "Exec" or similar.

  jl> Here's little ptrace from running forced FvwmCommandS 1 1 1 1 1,

You can't do that.  You can't invoke a module from the command line like
that.  Modules and FVWM uses pipes to talk to each other; a module
_MUST_ be spawned by the fvwm program so that these pipes exist
properly.  There's no way to test a module by running it from the
command line; the error you got is exactly what I'd expect to see.

HTH.

-- 
-------------------------------------------------------------------------------
 Paul D. Smith <[email-masked]>         Network Management Development
 "Please remain calm...I may be mad, but I am a professional." --Mad Scientist
-------------------------------------------------------------------------------
   These are my opinions---Nortel Networks takes no responsibility for them.
--
Visit the official FVWM web page at <URL: http://www.fvwm.org/>.
To unsubscribe from the list, send "unsubscribe fvwm" in the body of a
message to [email-masked].
To report problems, send mail to [email-masked].

---

From: Jarkko Lietolahti <[email-masked]>
Date: Fri, 30 Apr 1999 19:33:55 +0300 (EEST)

> Are you _sure_ you started as a module, as described in the man page?

 Yes, at least i think so. Here's snippet from my .fvrm2rv
AddToFunc InitFvwmCommand "I" Module FvwmCommandS
+                         "I" Exec exec $HOME/scripts/focus-link.pl
+                         "I" Exec exec $HOME/scripts/focus-Netscape.pl

AddToFunc InitFunction    "I" Module FvwmAudio
+                         "I" Module FvwmButtons
+                         "I" InitFvwmCommand
+                         "I" exec rxvt -fn nh10 &
+                         "I" exec kohta 10 xscreensaver &
+                         "I" exec kohta 5 /home/jappe/bin/xsetroot &

 I did try to replace InitFvwmCommand with Module FvwmCommandS but it
resulted the same.

 Could you send your .fvwm2rc snippet to me? (Just in case ;))

> command line; the error you got is exactly what I'd expect to see.

 I know, i known...

--
[email-masked]

---

From: Dominik Vogt <[email-masked]>
Date: Fri, 30 Apr 1999 18:39:14 +0200

On Fri, Apr 30, 1999 at 06:51:29PM +0300, [email-masked] wrote:
>...

It's a known bug that surfaced with recent Linux kernels. There's
an easy fix if you don't mind to patch the sources. In the file
modules/FvwmCommand/FvwmCommandS.c you will find a line like

  SendText(Fd,"",0); /* tell fvwm that we are here */
             ^^^^
This has to be replaced with

  SendText(Fd," ",0); /* tell fvwm that we are here */
             ^^^^^

This has been fixed in the current stable fvwm release (2.2).
I has been in the development source in the current betas for
a few weeks.

Bye

Dominik ^_^

-- 
Dominik Vogt, Hewlett-Packard GmbH, Dept. BVS
Herrenberger Str.130, 71034 Boeblingen, Germany
phone: 07031/14-4596, fax: 07031/14-3883, [email-masked]
--
Visit the official FVWM web page at <URL: http://www.fvwm.org/>.
To unsubscribe from the list, send "unsubscribe fvwm" in the body of a
message to [email-masked].
To report problems, send mail to [email-masked].

---

From: [email-masked] (Paul D. Smith)
Date: 30 Apr 1999 12:48:27 -0400

jl>  Could you send your .fvwm2rc snippet to me? (Just in case ;))

I don't actually use this; I just use FvwmConsole if I want to talk to
fvwm (I don't have scripts that need to talk to it).

See Dominik's response.

---

From: Jarkko Lietolahti <[email-masked]>
Date: Fri, 30 Apr 1999 20:02:17 +0300 (EEST)

>   SendText(Fd," ",0); /* tell fvwm that we are here */

	Thanks, it made it work... 

--
[email-masked]