This is the mail archive of the gdb-patches@sourceware.cygnus.com mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: A patch for gnu-regex


On Tue, Mar 07, 2000 at 10:19:05PM -0800, J.T. Conklin wrote:
> >>>>> "hjl" == H J Lu <hjl@lucon.org> writes:
> hjl> The current master copy of GNU regex is in glibc. I'd like to be
> hjl> able to compile gdb on a known good glibc base system using the
> hjl> GNU regex in glibc. 
> 
> The problem, as I see it, with linking with a host's regex library is
> that gdb does not know whether or not it is "good".  We could write an
> autoconf test that attempts to verify the library, or some heuristic
> like __GLIBC__ && __GLIBC__ >= 2, but neither is as safe as using the
> known good version of the library that is bundled with GDB.  One could
> argue that if we're worried about regex, why aren't we worried about a
> hundred other things and provide local copies of them.  I'll concede
> that that would be silly, but I believe that historical problems with
> the regex code makes it a special case.

If you think the Linux C library is unsafe, it is the time to upgrade
your Linux C library. My points are

1. The master copy is in the Linux C library.
2. Regex in the Linux C library should be at least as safe as the
one in gdb, if not safer. Otherwise, you have many more serious
things to worry about on your system than regex in gdb.

#1 was not true before. But it is true now.

> 
> Having said all that, I'm not opposed to using the host regex.  I'd
> like to see us change the regex usage within GDB to use the POSIX.2
> API so that we can link with any modern hosts library.  But since the
> benefits are small and the risks large, I think it's not the type of
> change we want to be making while were trying to wrap up a release.
> 
> hjl> I don't want to spend time to check if gdb has the updated regex
> hjl> or not.
> 
> It doesn't matter much to me.  It's a known good implementation that
> works well enough for GDB's purposes.  
> 

It is almost entirely a Linux issue since we are the only one who
has the master copy of regex in our C library.

I can add --enable-gdb-regex if it helps.

H.J.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]