Stop the presses! We have more regex problems in 3.1.6! There are at least two problems remaining with the regex tests in 3.1.6 that I just discovered. It turns out that "htfuzzy endings" has been segfaulting on me for some time, and for some reason that fact was never reported to me by the rundig script I was running. Anyway, I found two reasons for it segfaulting. First of all, back on Nov. 29, I wrote...
> 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? I don't think I ever got a response to that. This is at least part of the problem. EndingsDB.cc doesn't check HAVE_BROKEN_REGEX, so it always includes <regex.h>, but it turns out that this is still the regex.h in htlib, because of the -I../htlib flag. However, combining the htlib/regex.h with the C library regex.o can be a bad thing, because the data structures may be incompatible. This seems to be the case on my system, causing htfuzzy endings to segfault right at the start. So, problem 1: we need to fix things up so the bundled regex.h header isn't included at all by compiled code, if we're not using the corresponding bundled regex.c code. OK, I thought, I'll just rename htlib/regex.h to htlib/gregex.h so it doesn't get included, remove the defective htfuzzy/EndingsDB.o (and also htlib/HtRegex.o for good measure) and re-make. It builds fine, and so I ran htfuzzy/htfuzzy endings, and it ran further but still segfaulted. So, even with the C library regex.h AND regex.o, htfuzzy still doesn't work reliably on my system. This confirms my earlier attempts at trying Joe Jah's FAQ 5.14 fix on my system with earlier 3.1.x releases, when it failed there too. So, on my system the bundled regex code works (it certainly did in earlier 3.1.x releases where it was used unconditionally), but the C library regex code doesn't work. So, why is ./configure setting HAVE_BROKEN_REGEX, which suggests the bundled regex code failed on my system. Obviously the test failed, even though htfuzzy works correctly with the bundled regex code. (I just confirmed this by forcing 3.1.6 manually to use the bundled regex code.) So, problem 2: we need a better test for regex, that will work if htfuzzy works, and will fail if htfuzzy fails. Here is the relevant config.log output. It shows that the reason the test fails has nothing to do with any problems specific to regex.c not running on my system, but rather it seems it's because of missing definitions in the test or something like that. I suspect it might be trying to compile the bundled htlib/regex.c using the system's /usr/include/regex.h. configure:2513: checking if we should use the included regex? configure:2531: gcc -o conftest -O2 -m486 -fno-strength-reduce conftest.c -lz 1>&5 In file included from configure:2524: ./htlib/regex.c:1833: parse error before `_RE_ARGS' ./htlib/regex.c:1836: parse error before `_RE_ARGS' ./htlib/regex.c:1837: parse error before `_RE_ARGS' ./htlib/regex.c:1839: parse error before `_RE_ARGS' ./htlib/regex.c:1841: parse error before `_RE_ARGS' ./htlib/regex.c:1843: parse error before `_RE_ARGS' ./htlib/regex.c:1846: parse error before `_RE_ARGS' ./htlib/regex.c:1859: parse error before `_RE_ARGS' ./htlib/regex.c:2233: parse error before `_RE_ARGS' ./htlib/regex.c: In function `regex_compile': ./htlib/regex.c:2313: `RE_TRANSLATE_TYPE' undeclared (first use this function) ./htlib/regex.c:2313: (Each undeclared identifier is reported only once ./htlib/regex.c:2313: for each function it appears in.) ./htlib/regex.c:2313: parse error before `translate' ./htlib/regex.c:2405: structure has no member named `used' ./htlib/regex.c:2453: `translate' undeclared (first use this function) ./htlib/regex.c:2465: invalid operands to binary - ./htlib/regex.c:2465: invalid operands to binary - ./htlib/regex.c:2480: invalid operands to binary - ./htlib/regex.c:2480: invalid operands to binary - ./htlib/regex.c:2573: invalid operands to binary - ./htlib/regex.c:2573: invalid operands to binary - ./htlib/regex.c:2601: invalid operands to binary - ./htlib/regex.c:2601: invalid operands to binary - ./htlib/regex.c:2615: invalid operands to binary - ./htlib/regex.c:2615: invalid operands to binary - ./htlib/regex.c:2626: invalid operands to binary - ./htlib/regex.c:2626: invalid operands to binary - ./htlib/regex.c:3105: invalid operands to binary - ./htlib/regex.c:3105: invalid operands to binary - ./htlib/regex.c:3111: invalid operands to binary - ./htlib/regex.c:3111: invalid operands to binary - ./htlib/regex.c:3119: invalid operands to binary - ./htlib/regex.c:3119: invalid operands to binary - ./htlib/regex.c:3671: invalid operands to binary - ./htlib/regex.c:3673: invalid operands to binary - ./htlib/regex.c:3674: invalid operands to binary - ./htlib/regex.c:3684: invalid operands to binary - ./htlib/regex.c:3685: invalid operands to binary - ./htlib/regex.c:3685: invalid operands to binary - ./htlib/regex.c:3717: invalid operands to binary - ./htlib/regex.c:3717: invalid operands to binary - ./htlib/regex.c:3763: invalid operands to binary - ./htlib/regex.c:3763: invalid operands to binary - ./htlib/regex.c:3779: invalid operands to binary - ./htlib/regex.c:3779: invalid operands to binary - ./htlib/regex.c:3808: invalid operands to binary - ./htlib/regex.c:3808: invalid operands to binary - ./htlib/regex.c:3900: invalid operands to binary - ./htlib/regex.c:3900: invalid operands to binary - ./htlib/regex.c:3921: invalid operands to binary - ./htlib/regex.c:3921: invalid operands to binary - ./htlib/regex.c:4023: invalid operands to binary - ./htlib/regex.c:4023: invalid operands to binary - ./htlib/regex.c:4031: invalid operands to binary - ./htlib/regex.c:4031: invalid operands to binary - ./htlib/regex.c:4038: invalid operands to binary - ./htlib/regex.c:4038: invalid operands to binary - ./htlib/regex.c:4044: invalid operands to binary - ./htlib/regex.c:4044: invalid operands to binary - ./htlib/regex.c:4050: invalid operands to binary - ./htlib/regex.c:4050: invalid operands to binary - ./htlib/regex.c:4056: invalid operands to binary - ./htlib/regex.c:4056: invalid operands to binary - ./htlib/regex.c:4062: invalid operands to binary - ./htlib/regex.c:4062: invalid operands to binary - ./htlib/regex.c:4068: invalid operands to binary - ./htlib/regex.c:4068: invalid operands to binary - ./htlib/regex.c:4086: invalid operands to binary - ./htlib/regex.c:4086: invalid operands to binary - ./htlib/regex.c:4147: invalid operands to binary - ./htlib/regex.c:4147: invalid operands to binary - ./htlib/regex.c:4152: invalid operands to binary - ./htlib/regex.c:4152: invalid operands to binary - ./htlib/regex.c:4169: `RE_NO_POSIX_BACKTRACKING' undeclared (first use this function) ./htlib/regex.c:4170: invalid operands to binary - ./htlib/regex.c:4170: invalid operands to binary - ./htlib/regex.c:4183: structure has no member named `used' ./htlib/regex.c:4183: invalid operands to binary - ./htlib/regex.c: At top level: ./htlib/regex.c:4245: warning: type mismatch with previous implicit declaration ./htlib/regex.c:4162: warning: previous implicit declaration of `store_op1' ./htlib/regex.c:4245: warning: `store_op1' was previously implicitly declared to return `int' ./htlib/regex.c:4245: warning: `store_op1' was declared implicitly `extern' and later `static' ./htlib/regex.c:4259: warning: type mismatch with previous implicit declaration ./htlib/regex.c:3953: warning: previous implicit declaration of `store_op2' ./htlib/regex.c:4259: warning: `store_op2' was previously implicitly declared to return `int' ./htlib/regex.c:4259: warning: `store_op2' was declared implicitly `extern' and later `static' ./htlib/regex.c:4275: warning: type mismatch with previous implicit declaration ./htlib/regex.c:3780: warning: previous implicit declaration of `insert_op1' ./htlib/regex.c:4275: warning: `insert_op1' was previously implicitly declared to return `int' ./htlib/regex.c:4275: warning: `insert_op1' was declared implicitly `extern' and later `static' ./htlib/regex.c:4295: warning: type mismatch with previous implicit declaration ./htlib/regex.c:3928: warning: previous implicit declaration of `insert_op2' ./htlib/regex.c:4295: warning: `insert_op2' was previously implicitly declared to return `int' ./htlib/regex.c:4295: warning: `insert_op2' was declared implicitly `extern' and later `static' ./htlib/regex.c:4316: warning: type mismatch with previous implicit declaration ./htlib/regex.c:2464: warning: previous implicit declaration of `at_begline_loc_p' ./htlib/regex.c:4316: warning: `at_begline_loc_p' was previously implicitly declared to return `int' ./htlib/regex.c:4316: warning: `at_begline_loc_p' was declared implicitly `extern' and later `static' ./htlib/regex.c:4335: warning: type mismatch with previous implicit declaration ./htlib/regex.c:2479: warning: previous implicit declaration of `at_endline_loc_p' ./htlib/regex.c:4335: warning: `at_endline_loc_p' was previously implicitly declared to return `int' ./htlib/regex.c:4335: warning: `at_endline_loc_p' was declared implicitly `extern' and later `static' ./htlib/regex.c:4357: warning: type mismatch with previous implicit declaration ./htlib/regex.c:4082: warning: previous implicit declaration of `group_in_compile_stack' ./htlib/regex.c:4357: warning: `group_in_compile_stack' was previously implicitly declared to return `int' ./htlib/regex.c:4357: warning: `group_in_compile_stack' was declared implicitly `extern' and later `static' ./htlib/regex.c:4478: warning: type mismatch with previous implicit declaration ./htlib/regex.c:3181: warning: previous implicit declaration of `compile_range' ./htlib/regex.c:4478: warning: `compile_range' was previously implicitly declared to return `int' ./htlib/regex.c:4478: warning: `compile_range' was declared implicitly `extern' and later `static' ./htlib/regex.c: In function `compile_range': ./htlib/regex.c:4480: parse error before `RE_TRANSLATE_TYPE' ./htlib/regex.c:4525: subscripted value is neither array nor pointer ./htlib/regex.c:4531: subscripted value is neither array nor pointer ./htlib/regex.c:4535: subscripted value is neither array nor pointer ./htlib/regex.c:4535: subscripted value is neither array nor pointer ./htlib/regex.c: In function `re_compile_fastmap': ./htlib/regex.c:4593: structure has no member named `used' ./htlib/regex.c:4617: structure has no member named `can_be_null' ./htlib/regex.c:4626: structure has no member named `can_be_null' ./htlib/regex.c:4651: structure has no member named `can_be_null' ./htlib/regex.c:4728: structure has no member named `can_be_null' ./htlib/regex.c:4829: structure has no member named `can_be_null' ./htlib/regex.c:4882: structure has no member named `can_be_null' ./htlib/regex.c: In function `re_search_2': ./htlib/regex.c:4983: syntax error before `translate' ./htlib/regex.c:5001: structure has no member named `used' ./htlib/regex.c:5002: warning: dereferencing `void *' pointer ./htlib/regex.c:5002: void value not ignored as it ought to be ./htlib/regex.c:5004: warning: dereferencing `void *' pointer ./htlib/regex.c:5004: void value not ignored as it ought to be ./htlib/regex.c:5036: structure has no member named `can_be_null' ./htlib/regex.c:5051: `translate' undeclared (first use this function) ./htlib/regex.c:5075: structure has no member named `can_be_null' ./htlib/regex.c: At top level: ./htlib/regex.c:5267: parse error before `_RE_ARGS' ./htlib/regex.c:5270: parse error before `_RE_ARGS' ./htlib/regex.c:5273: parse error before `_RE_ARGS' ./htlib/regex.c:5276: parse error before `_RE_ARGS' ./htlib/regex.c: In function `re_match_2_internal': ./htlib/regex.c:5399: structure has no member named `used' ./htlib/regex.c:5407: `RE_TRANSLATE_TYPE' undeclared (first use this function) ./htlib/regex.c:5407: parse error before `translate' ./htlib/regex.c:5438: `active_reg_t' undeclared (first use this function) ./htlib/regex.c:5438: parse error before `lowest_active_reg' ./htlib/regex.c:5920: `translate' undeclared (first use this function) ./htlib/regex.c:5954: parse error before `r' ./htlib/regex.c:5954: `r' undeclared (first use this function) ./htlib/regex.c:5954: `lowest_active_reg' undeclared (first use this function) ./htlib/regex.c:5954: `highest_active_reg' undeclared (first use this function) ./htlib/regex.c:5968: parse error before `r' ./htlib/regex.c:6340: parse error before `r' ./htlib/regex.c:6525: parse error before `this_reg' ./htlib/regex.c:6525: `this_reg' undeclared (first use this function) ./htlib/regex.c:6595: parse error before `r' ./htlib/regex.c:6679: parse error before `this_reg' ./htlib/regex.c:6736: parse error before `this_reg' ./htlib/regex.c:6918: parse error before `dummy_low_reg' ./htlib/regex.c:6923: parse error before `this_reg' ./htlib/regex.c:6923: `dummy_high_reg' undeclared (first use this function) ./htlib/regex.c:6923: parse error before `fail_stack' ./htlib/regex.c:6924: `dummy_low_reg' undeclared (first use this function) ./htlib/regex.c:6924: parse error before `fail_stack' ./htlib/regex.c:6966: parse error before `this_reg' ./htlib/regex.c:6979: parse error before `this_reg' ./htlib/regex.c:7184: parse error before `r' ./htlib/regex.c:7193: parse error before `r' ./htlib/regex.c:7209: parse error before `this_reg' ./htlib/regex.c:7209: parse error before `fail_stack' ./htlib/regex.c:7210: parse error before `fail_stack' ./htlib/regex.c: At top level: ./htlib/regex.c:7276: warning: type mismatch with previous implicit declaration ./htlib/regex.c:6360: warning: previous implicit declaration of `group_match_null_string_p' ./htlib/regex.c:7276: warning: `group_match_null_string_p' was previously implicitly declared to return `int' ./htlib/regex.c:7276: warning: `group_match_null_string_p' was declared implicitly `extern' and later `static' ./htlib/regex.c:7388: warning: type mismatch with previous implicit declaration ./htlib/regex.c:7358: warning: previous implicit declaration of `alt_match_null_string_p' ./htlib/regex.c:7388: warning: `alt_match_null_string_p' was previously implicitly declared to return `int' ./htlib/regex.c:7388: warning: `alt_match_null_string_p' was declared implicitly `extern' and later `static' ./htlib/regex.c:7425: warning: type mismatch with previous implicit declaration ./htlib/regex.c:7409: warning: previous implicit declaration of `common_op_match_null_string_p' ./htlib/regex.c:7425: warning: `common_op_match_null_string_p' was previously implicitly declared to return `int' ./htlib/regex.c:7425: warning: `common_op_match_null_string_p' was declared implicitly `extern' and later `static' ./htlib/regex.c:7513: warning: `bcmp_translate' was declared implicitly `extern' and later `static' ./htlib/regex.c: In function `bcmp_translate': ./htlib/regex.c:7515: parse error before `RE_TRANSLATE_TYPE' ./htlib/regex.c:7526: subscripted value is neither array nor pointer ./htlib/regex.c:7526: subscripted value is neither array nor pointer ./htlib/regex.c: In function `re_compile_pattern': ./htlib/regex.c:7549: argument `length' doesn't match prototype /usr/include/rx.h:1737: prototype declaration ./htlib/regex.c: In function `regcomp': ./htlib/regex.c:7698: structure has no member named `used' ./htlib/regex.c:7708: `RE_TRANSLATE_TYPE' undeclared (first use this function) ./htlib/regex.c:7708: parse error before `malloc' ./htlib/regex.c: In function `regfree': ./htlib/regex.c:7898: structure has no member named `used' configure: failed program was: #line 2522 "configure" #include "confdefs.h" #include "./htlib/regex.c" int main() { regex_t re; return regcomp(&re, "ht.*Dig", REG_ICASE); } -- Gilles R. Detillieux E-mail: <[EMAIL PROTECTED]> 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 _______________________________________________ htdig-dev mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/htdig-dev