[Rpm-maint] rpmbuild creash.
Panu Matilainen
pmatilai at redhat.com
Tue Dec 11 09:24:20 UTC 2007
On Mon, 3 Dec 2007, Giulio Eulisse wrote:
>> Yup, lots of identical basenames is a known pathological case in rpm, it
>> gets worse when you actually try to install such beasts (in a sense
>> you're lucky it doesn't even build ;)
>>
>> Something to look at certainly, but don't expect it to get fixed
>> overnight, as you've noticed it's a long-standing issue...
>
> Ciao,
> sorry to bother you again. This is hitting us quite badly now. I'm not
> asking for a patch, but do you think that we can avoid the problem by
> skipping the insertion of basenames matching a given string? Does that
> have any bad implications?
Finally got around to have a look at this...
Build crashing with your createDirs.py file listing actually has nothing
to do with basenames as such, it's the sheer number of items that trigger
it: compressFilelist() uses stack for it's memory allocations, and with
almost a million entries in the filelist ... well :)
The attached patch (against 4.4.x) makes rpmbuild survive through that
step. It'll almost certainly blow through the roof during
install/upgrade/remove due to the basenames syndrome however.
- Panu -
-------------- next part --------------
diff -r ef3b9fefa1eb rpmdb/legacy.c
--- a/rpmdb/legacy.c Tue Nov 13 13:11:54 2007 +0200
+++ b/rpmdb/legacy.c Tue Dec 11 10:38:28 2007 +0200
@@ -298,9 +298,9 @@ void compressFilelist(Header h)
if (fileNames == NULL || count <= 0)
return;
- dirNames = alloca(sizeof(*dirNames) * count); /* worst case */
- baseNames = alloca(sizeof(*dirNames) * count);
- dirIndexes = alloca(sizeof(*dirIndexes) * count);
+ dirNames = malloc(sizeof(*dirNames) * count); /* worst case */
+ baseNames = malloc(sizeof(*dirNames) * count);
+ dirIndexes = malloc(sizeof(*dirIndexes) * count);
if (fileNames[0][0] != '/') {
/* HACK. Source RPM, so just do things differently */
@@ -354,6 +354,10 @@ exit:
}
fileNames = hfd(fileNames, fnt);
+ free(dirNames);
+ free(baseNames);
+ free(dirIndexes);
+
xx = hre(h, RPMTAG_OLDFILENAMES);
}
More information about the Rpm-maint
mailing list