Thread View: gnu.gdb.bug
3 messages
3 total messages
Started by Marcus Brinkmann
Mon, 29 Apr 2002 20:45
segfaults on i386-gnu
Author: Marcus Brinkmann
Date: Mon, 29 Apr 2002 20:45
Date: Mon, 29 Apr 2002 20:45
43 lines
2845 bytes
2845 bytes
Hi,
the CVS version from 20020401 (actually, the version that Debian
packages currently), has the following change to gdb_realpath:
2002-03-14 Richard Henderson <rth@redhat.com>
* configure.in: Detect declaration for canonicalize_file_name.
* utils.c (canonicalize_file_name): Declare, if needed.
(gdb_realpath): Prefer realpath if available and
usable.
* config.in, configure: Rebuild.
However, the code doesn't check correctly if realpath is usable.
On the GNU/Hurd, realpath exists but it is _not_ usable, because there
is no limit to filenames, and neither PATH_MAX nor MAXHOSTNAMELEN is
defined, and pathconf on _PC_PATH_MAX returns -1.
# elif defined (HAVE_UNISTD_H) && defined(HAVE_ALLOCA)
char *buf = alloca ((size_t)pathconf ("/", _PC_PATH_MAX));
# define USE_REALPATH
alloca(-1) fails of course, and this leads to 0 being returned.
I see no reason to prefer realpath over canonicalize_path_name, its
interface is horrible broken (and not fixable, there is always the
possibility of a buffer overflow when using realpath on the Hurd)
I see no reason to prefer realpath over canonicalize_path_name, its
interface is horrible broken (and not fixable, eg there is no way
to use it "properly" on the Hurd, as its behaviour is not well
defined if PATH_MAX is not available.) There is no rationale in the
ChangeLog, my suggestion is to revert the change and prefer
canonicalize_file_name if it is available, unless there is a reason
not to do so I don't know about. But in any case, on the *-*-gnu*
platform, canonicalize_file_name must be used. (That is the platform
I care about, but the current code is obviously broken on all
systems where _PC_PATH_MAX on / returns -1. As I said, there is no
real portable fix for a system that does this and doesn't have
canonicalize_file_name, because realpath is quite broken).
Thanks,
Marcus
Re: segfaults on i386-gnu
Author: Andrew Cagney
Date: Mon, 29 Apr 2002 23:51
Date: Mon, 29 Apr 2002 23:51
16 lines
1575 bytes
1575 bytes
> Hi, > > the CVS version from 20020401 (actually, the version that Debian > packages currently), has the following change to gdb_realpath: > > 2002-03-14 Richard Henderson <rth@redhat.com> > > * configure.in: Detect declaration for canonicalize_file_name. > * utils.c (canonicalize_file_name): Declare, if needed. > (gdb_realpath): Prefer realpath if available and > usable. > * config.in, configure: Rebuild. I belive this is fixed in gdb 5.2. Andrew
Re: segfaults on i386-gnu
Author: Marcus Brinkmann
Date: Tue, 30 Apr 2002 00:09
Date: Tue, 30 Apr 2002 00:09
25 lines
1866 bytes
1866 bytes
On Mon, Apr 29, 2002 at 07:51:22PM -0400, Andrew Cagney wrote: > >Hi, > > > >the CVS version from 20020401 (actually, the version that Debian > >packages currently), has the following change to gdb_realpath: > > > >2002-03-14 Richard Henderson <rth@redhat.com> > > > >* configure.in: Detect declaration for canonicalize_file_name. > > * utils.c (canonicalize_file_name): Declare, if needed. > > (gdb_realpath): Prefer realpath if available and > > usable. > > * config.in, configure: Rebuild. > > I belive this is fixed in gdb 5.2. I just downloaded gdb 5.2 from ftp.gnu.org, and did not see any relevant changes between 5.2 and the version I used. In fact, the same wrong code is in utils.c gdb_realpath, and I don't see anything that would it make not to use realpath on the GNU system. What makes you think that this is fixed? Thanks, Marcus
Thread Navigation
This is a paginated view of messages in the thread with full content displayed inline.
Messages are displayed in chronological order, with the original post highlighted in green.
Use pagination controls to navigate through all messages in large threads.
Back to All Threads