[tex-live] TexLive version of CWEB can't handle strings >1024 characters

Arthur O'Dwyer arthur.j.odwyer at gmail.com
Mon Sep 3 23:38:38 CEST 2012

The source-only version of CWEAVE available via CTAN
(http://mirrors.ctan.org/web/c_cpp/cweb/cweb-3.64ad.tar.gz) sets the
"longest_name" macro to 10000, which seems fine. But the TexLive
version of /usr/bin/cweave installed on my Ubuntu system (Ubuntu
11.10) seems to have been compiled with "longest_name" set to 1024.
This makes it impossible to weave some of Knuth's programs listed at

Would it be possible for the next patch-release of TexLive to build
CWEAVE with the "longest_name" macro set to at least 3000?

Here's a minimal example. (Also notice that the woven "test.tex"
starts out okay and then descends into a spew of garbage characters,
due to the fact that the output string isn't null-terminated.
Personally I would consider this a bug in CWEAVE, but I'm sure it's a
known issue, and it's not like it happens *silently*.)


ajo at ubuntu:/tmp$ cat >test.w <<EOF
@*A Simple Example.
int main(void)
   printf("You are on the edge of a breath-taking view.  Far below you is an\n\
active volcano, from which great gouts of molten lava come surging\n\
out, cascading back down into the depths.  The glowing rock fills the\n\
farthest reaches of the cavern with a blood-red glare, giving every-\n\
thing an eerie, macabre appearance.  The air is filled with flickering\n\
sparks of ash and a heavy smell of brimstone.  The walls are hot to\n\
the touch, and the thundering of the volcano drowns out all other\n\
sounds.  Embedded in the jagged roof far overhead are myriad twisted\n\
formations, composed of pure white alabaster, which scatter the murky\n\
light into sinister apparitions upon the walls.  To one side is a deep\n\
gorge, filled with a bizarre chaos of tortured rock that seems to have\n\
been crafted by the Devil himself.  An immense river of fire crashes\n\
out from the depths of the volcano, burns its way through the gorge,\n\
and plummets into a bottomless pit far off to your left.  To the\n\
right, an immense geyser...");
ajo at ubuntu:/tmp$ cweave test.w
This is CWEAVE, Version 3.64 (TeX Live 2009/Debian)
! String too long: "You are on the edge of a...
Writing the output file...*1
! String too long: "You are on the edge of a...
Writing the index...
(Pardon me, but I think I spotted something wrong.)
ajo at ubuntu:/tmp$ uname -a
Linux ubuntu 3.0.0-23-generic #39-Ubuntu SMP Thu Jul 19 19:18:53 UTC
2012 i686 i686 i386 GNU/Linux
ajo at ubuntu:/tmp$ cweave --version
CWEAVE 3.64 (TeX Live 2009/Debian)
kpathsea version 5.0.0
Copyright 2009 Silvio Levy and Donald E. Knuth.
There is NO warranty.  Redistribution of this software is
covered by the terms of both the CWEAVE copyright and
the Lesser GNU General Public License.
For more information about these matters, see the file
named COPYING and the CWEAVE source.
Primary author of CWEAVE: Silvio Levy and Donald E. Knuth.

More information about the tex-live mailing list