[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Reopening #218561 (libc6 relocation error)?



On Wed, Nov 05, 2003 at 11:56:57AM +0000, Colin Watson wrote:
> On Wed, Nov 05, 2003 at 12:22:26PM +0100, Martin Pitt wrote:
> > martin@donald:~/debian/epstool-3.02$ grep -r errno .
> > ./src/epstool.c:#include <errno.h>
> > ./src/epstool.c:        fprintf(stderr, "Failed to fork, error=%d\n", errno);
> > ./src/epstool.c:            fprintf(stderr, "Failed to open stdin/out/err, error=%d\n", errno);
> > ./src/epstool.c:            fprintf(stderr, "Failed to execute ghostscript, error=%d\n", errno);
> > 
> > So epstool.c is the _only_ source file requiring and using errno and
> > it properly includes <errno.h>.
> > 
> > I just found out that it works again if I include errno.h in the
> > module clfile.c.
> 
> When I run 'gcc -E clfile.c' I see that /usr/include/linux/unistd.h says
> 'extern int errno;' (for _llseek(), I think). This seems like the real
> bug, doesn't it?

Oh yes, also, clfile.c includes <linux/unistd.h>. You're not supposed to
do this from userspace. Don't include kernel headers from userspace and
you won't be vulnerable to this kind of problem.

Cheers,

-- 
Colin Watson                                  [cjwatson@flatline.org.uk]



Reply to: