From: Gilles D. <gr...@sc...> - 2001-11-29 17:55:24
|
According to Joe R. Jah: > On Tue, 27 Nov 2001, Gilles Detillieux wrote: > > OK, so for either 3.2.0b4 or 3.1.6, you need to manually override > > things to get rid of the bundled regex code, right? > > That's right. There are two files left in 3.1.6 that use system's > regex.h: > > HtRegex.h > EndingsDB.cc > > I suspect HtRegex.h to be the cause of tripling dig time in 3.1.6;-/ Wait a minute. I'm almost positive that the problem on BSDi was not the use of the system's regex.h, but rather the use of the regex code that's bundled with htdig! Can you do me a favour and have a look at what the value of HAVE_BROKEN_REGEX is in include/htconfig.h? If it's #define'd, please try to #undef it and recompile/reinstall htdig, and let us know how that impacts digging time. The selection of the regex code has to be an all or nothing thing. If you use the bundled code, all source files that use regex.h should use the bundled one, but if you use the C library regex code, then all source files should use the system's regex.h. If you mix and match the two, you're likely to run into problems. I think we need to fix htfuzzy/EndingsDB.cc to check the setting of HAVE_BROKEN_REGEX and use the appropriate header file. Come to think of it, I think there's a problem with how HAVE_BROKEN_REGEX is handled in htlib/HtRegex.h too, because simply using #include <regex.h> doesn't guarantee that the compiler won't use the bundled one instead, as the Makefile.config file puts a -I../htlib in the compiler flags. I think to make this all work, we need to rename the bundled regex.h to something like htregex.h to avoid conflicts, as well as put some hooks in the bundled regex.c code to disable it all if you need to use the C library code instead. What do you think, Geoff? However, Joe, if you did remove both htlib/regex.c and htlib/regex.h as you said you did, then you should be safely using all the C library code, and not the bundled code, so it should be good. I also had a look at the HAVE_BROKEN_REGEX on my Red Hat 4.2 system, and surprisingly it was defined. I say surprisingly because previously I had tried to manually force it to use the C library regex, as Joe does by removing the bundled code and removing the reference to regex.o in htlib/Makefile, and that had caused htfuzzy and htsearch to crash. That was on 3.1.4 or 2.1.5, I think. Anyway, 3.1.6 isn't crashing on this system, so I'd see this as further evidence that the HAVE_BROKEN_REGEX handling is not working. So, we need to fix the usage of the flag. We also need to fix the test for this situation, because it should not be defining this flag on my RH 4.2 system. Finally, I think we need a better name for it, as it implies that the C library regex is broken, when in fact the problem on BSDi systems is that the bundled regex code conflicts with the libraries in some way. In the end, it might make sense to have a configure option to override the automatic test for this, because I'm not convinced it will work in all cases. (However, to the best of my recollection, it is only BSDi systems that have a problem with the bundled regex code.) -- Gilles R. Detillieux E-mail: <gr...@sc...> Spinal Cord Research Centre WWW: http://www.scrc.umanitoba.ca/~grdetil Dept. Physiology, U. of Manitoba Phone: (204)789-3766 Winnipeg, MB R3E 3J7 (Canada) Fax: (204)789-3930 |