[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: malloc, etc. bugs in GNU tar 1.13.25
From: |
Bruce Lilly |
Subject: |
Re: malloc, etc. bugs in GNU tar 1.13.25 |
Date: |
Thu, 03 Oct 2002 14:48:34 -0400 |
User-agent: |
Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.2a) Gecko/20020910 |
Paul Eggert wrote:
From: Bruce Lilly <address@hidden>
Date: Tue, 27 Aug 2002 17:20:12 -0400
The malloc, etc. functions in the lib subdirectory
of GNU tar 1.13.25 are broken. In particular, the
allocation functions are supposed to return a block
of memory suitably aligned for storage of any type
(see The Open Group's Single UNIX Specification).
They do not, and that's a problem which causes the
getdents() function in Doug Gwyn's dirent library
to fail.
Sorry, I don't see the bug. For example, here's the malloc function
that you mention:
char *
rpl_malloc (size_t n)
{
if (n == 0)
n = 1;
return malloc (n);
}
That's not what I meant by a malloc replacement.
I don't recall all of the details, but there was some bizarre configure
stuff that generated a malloc() function, which did not return
aligned blocks.
If the underlying malloc returns a suitably-aligned block, then
rpl_malloc will do so too.
Also, GNU tar doesn't invoke getdents, so I don't see why that's
relevant.
It does call opendir(), etc, and when linked with Doug Gwyn's
dirent library (which provides a getdents() which is called by
readdir, etc.), the non-alligned block returned by the GNU tar
malloc() cased getdents() to fail. I think I had to resort to
editing config.h to work around the problem. That was over a
month ago, and I no longer have the modified files, so I can't
be more specific.