From: Chris DiTrani <cditrani@livedata.com>
To: fluca1978@infinito.it
Cc: linux-admin@vger.kernel.org
Subject: Re: zip error: out of memory
Date: Wed, 28 Jul 2004 15:40:31 -0400 [thread overview]
Message-ID: <1091043631.25522.259.camel@chris.livedata.com> (raw)
In-Reply-To: <200407281735.56937.fluca1978@infinito.it>
On Wed, 2004-07-28 at 11:35, Luca Ferrari wrote:
> Hi,
> I was doing a backup of a NFS partition (about 300 MB) using zip but I got the
> error:
> Zip error: Out of memory (allocating temp filename)
All assuming you are running recent stuff...
Either this code is failing:
tempzip = malloc(4);
if (tempzip == NULL) {
ZIPERR(ZE_MEM, "allocating temp filename");
}
or this code (both from info-zip's zip.c source).
if ((tempzip = tempname(zipfile)) == NULL) {
ZIPERR(ZE_MEM, "allocating temp filename");
}
On Linux (if I'm preprocessing the MANY #if(n)defs in info-zip's
fileio.c properly) tempname() runs mktemp() after malloc'ing up a 12
byte buffer. Either malloc is failing, or mktemp() is returning a null
pointer.
But here's the calling code:
...
if ((t = malloc(12)) == NULL)
return NULL;
*t = 0;
...
strcat(t, "ziXXXXXX"); /* must use lowercase for Linux dos file system
*/
return mktemp(t);
And here's the glibc mktemp() code:
mktemp (template)
char *template;
{
if (__gen_tempname (template, __GT_NOCREATE) < 0)
/* We return the null string if we can't find a unique file name.
*/
template[0] = '\0';
return template;
}
So I can't see how tempname() returns a NULL pointer under any
circumstance other than malloc failing. Which could be a side-effect of
the heap getting buggered by other code, or maybe you really are out of
mem. Looks like zip allocates mem for every file it finds and only frees
it after it's done, so it's not the size of the backup set so much as it
is the number of files that impact memory use.
If you can build the source I'd put some printf() calls in zip.c and
especially filio.c and run again.
CD
next prev parent reply other threads:[~2004-07-28 19:40 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2004-07-28 15:35 zip error: out of memory Luca Ferrari
2004-07-28 19:40 ` Chris DiTrani [this message]
2004-07-29 17:06 ` Glynn Clements
2004-07-28 20:17 ` chuck gelm
2004-07-29 13:11 ` Luca Ferrari
2004-07-29 14:20 ` Chris DiTrani
2004-07-29 21:57 ` chuck gelm
2004-07-30 8:50 ` Luca Ferrari
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1091043631.25522.259.camel@chris.livedata.com \
--to=cditrani@livedata.com \
--cc=fluca1978@infinito.it \
--cc=linux-admin@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).