Re: FVWM: large PipeReads

From: Dominik Vogt <fvwm_at_fvwm.org>
Date: Thu, 18 Apr 2002 12:10:16 +0200

On Wed, Apr 17, 2002 at 07:29:25PM -0600, Gregg Dameron wrote:
> Running 2.4.5 on Solaris.
>
> It seems that as a PipeRead script increases in size, fvwm2 struggles to
> read and execute it. The maximum seems to be 1024 bytes, measured by
> the string output in debug mode that begins:
>
> <<DEBUG>> about to attempt '<script here>'.
>
> Larger than that, and things get strange. Reading in the file
> containing the PipeRead may give an error such as:
>
> <<DEBUG>> Module switch -1, about to exec: '<truncated PipeRead script>'
>
> <<DEBUG>> Module switch -1, about to exec: '<characters after truncation
> point>'
> <<ERROR>> No such command '<characters after truncation point>'
>
> Or, at runtime, Bourne may report an unexpected end-of-file, or other
> syntax error, where none exists.
>
> I haven't studied the source code in detail, but in read.c, I see:
>
> char line[1024];
>
> More than a coincidence?

In fvwm, a single command line can not be longer than 1022
characters (1024 minus 1 for the string end minus 1 for the
trailing newline).

> I suppose one workaround is to Exec a separate script and FvwmCommand
> the output, but I'm anxious to optimize performance.

No, the limit is everywhere, not just in piperead. If that's too
small, the limit can be increased, but I wonder how you manage to
generate single commands that are bigger than 1k.

> Any help is
> appreciated. I guess my preference would be dynamic memory allocation
> supporting arbitrarily large PipeReads.
>
> BTW, I noticed that the "about to exec" debug messages chop off the last
> character of the line read in. In read.c:
>
> if (debugging)
> fvwm_msg(DBG,"ReadSubFunc","Module switch %d, about to exec:
> '%.*s'",
> Module,strlen(tline)-1,tline);
>
> Perhaps the "-1" shouldn't be there?

It's the trailing newline that gets cut off.

Bye

Dominik ^_^ ^_^

-- 
Dominik Vogt, email: d.vogt_at_lifebits.de
LifeBits Aktiengesellschaft, Albrechtstr. 9, D-72072 Tuebingen
fon: ++49 (0) 7071/7965-0, fax: ++49 (0) 7071/7965-20
--
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 majordomo_at_fvwm.org.
To report problems, send mail to fvwm-owner_at_fvwm.org.
Received on Thu Apr 18 2002 - 05:11:04 BST

This archive was generated by hypermail 2.3.0 : Mon Aug 29 2016 - 19:37:53 BST