[Rpm-maint] RPM macros and tag size limit

Panu Matilainen pmatilai at redhat.com
Thu Jan 10 14:29:54 UTC 2008

On Sat, 22 Dec 2007, Giulio Eulisse wrote:

> Ciao,
> I mean the lenght of the string. We have a (automatically generated)
> Requires line that looks like this:
> Requires: external+zlib+1.2.3-cms external+expat+2.0.0-cms
> external+openssl+0.9.7d-cms external+bz2lib+1.0.2-cms
> external+db4+4.4.20-cms external+gdbm+1.8.3-wt external+libjpg+6b-ge
> external+mysql+5.0.45-wt external+oracle+
> external+cmake+2.4.6-ge external+python+2.4.2-wt
> external+boost-build+2.0-m12-ge external+castor+2.1.1-4-ge
> external+dcap+1.2.35-ge external+gsl+1.8-ge external+libungif+4.1.4-ge
> external+p5-uri+1.35-ge external+pcre+4.4-ge external+qt+3.3.6-ge
> external+xrootd+20071001-0000a-ge external+libpng+1.2.10-ge
> external+gccxml+0.7.0_20070615-ge external+libtiff+3.8.2-ge
> external+clhep+ cms+cms-env+1.0-ge
> external+cppunit+1.10.2-ge external+gmake+3.81-ge
> cms+oracle-env+1.8-ge external+p5-template-toolkit+2.15-ge
> external+p5-xml-parser+2.34-ge external+systemtools+18-ge
> external+uuid+1.38-ge external+p5-libwww-perl+1.41-ge
> external+boost+1.34.1-ge lcg+root+5.14.00g-ge external+p5-dbi+1.50-ge
> lcg+SCRAMV1+V1_0_3-p3-ge cms+seal-tool-conf+CMS_151-ge
> external+sqlite+3.4.0-ge external+xerces-c+2.7.0-ge
> external+p5-dbd-oracle+1.17-ge external+frontier_client+2.7.4-ge
> cms+seal+SEAL_1_9_3-ge

Eek :) Not really what you asked, by why not split that into one require 
per line? Me thinks that'd be somewhat easier on the eyes...
Since it's autogenerated, might be easiest to stuff the (huge) requires 
list into a separate file and %include from the spec.

> and rpm chockes with:
> sh: line 0: echo: write error: Broken pipe
> error: line 11: Unknown tag: l-conf/CMS_151-ge
> external/sqlite/3.4.0-ge  external/xerces-c/2.7.0-ge
> external/p5-dbd-oracle/1.17-ge  external/frontier_client/2.7.4-ge
> cms/seal/SEAL_1_9_3-ge
> error: query of specfile
> /Users/ktf/work/leopardBuilds/tmp/tmpspec-coral-tool-conf failed,
> can't parse
> when we try to do:
> rpm -q --specfile spec -i
> Notice that the error seems to appear when the line lenght is greater
> than 1024 chars and appears for both "Requires" and %defines and as
> far as I can tell it used to work on

Hmm, the only somewhat related change between and that I 
can think of was plugging a couple of potential buffer overflows in macro 
handling. The maximum length of macro names has "always" been 1024 
characters, or to be precise, that was the longest name key used for 
finding macros in expansion. dynamically allocates the space.
But I can't think of anything that would've changed the spec parse 

Of course we can bump the limits up short term, longer term goal is to 
get rid of any static buffers, but ... I simply can't imagine why anybody 
would want to use > 1024 macro name (and of course 640K is enough for 
everybody ;)

 	- Panu -

More information about the Rpm-maint mailing list