bug-glibc
[Top][All Lists]
Advanced

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

Re: segfault in stat


From: Nathan Straz
Subject: Re: segfault in stat
Date: Fri, 29 Sep 2000 16:45:56 -0500
User-agent: Mutt/1.2.5i

On Fri, Sep 29, 2000 at 11:07:23PM +0200, address@hidden wrote:
>     >>>>> Nathan Straz writes:
> 
>      > I was doing some negative testing of stat(2) on Linux with glibc 2.1.3
>      > and I was able to provoke a segfault.  Here is the code:

Okay, it seems that everyone seemed to miss the point that is was doing
"negative testing."  That means I MEANT to send a bad pointer to see
that the results are correct.  

>      > It appears to me that when vers != _STAT_VER_KERNEL in __xstat() that
> 
> _STAT_VER_KERNEL?
> __xstat?
> 
> Seems like you are looking at the internals of one particular implementation.

Yes, since the code is available I looked at it to get a better
understanding of the system.  The path is this:

stat() --> __stat() --> __xstat() --> syscall stat --> xstat_conv()

I called stat() with the offending parameters.  But it looks that stat()
is a wrapper around a syscall, that doesn't behave like the syscall it
is wrapping.  I have been told that this inconsistency has been debated
before, and I have looked into the discussion.  I'm not going to debate
the results further, I just want to make sure the ported test case is
appropriate.

> So, maybe nothing is wrong here, not with glibc, not with stat(2).

So I guess the correct test case would have to capture the SIGSEGV and
recover from it, or find EFAULT if it wasn't hit by a signal.  That's
all I needed to know.

-- 
Nate Straz                                              address@hidden
sgi, inc                                           http://www.sgi.com/
Linux Test Project                    http://oss.sgi.com/projects/ltp/



reply via email to

[Prev in Thread] Current Thread [Next in Thread]