Some of my programs use regcomp/regexec on RH7 and I've not seen a
problem.  Memory problems can be most insidious .. you might want to
compile against something like efence or (if you've the luxury of a platform
supporting it), Purify.

    - Bruce


Rick Forrister wrote:

> Am having a problem with a regcomp/regex expression in a program I'm
> working on; one of the compiled regex_t structs appears to become
> corrupted after about 3 calls to regexec.  Which leads to a crash of
> the program.
>
> Wondering if anyone else has seen this behaviour; it's occuring on
> RH 7.0 with both the 2.95 & 2.96 gcc compilers.  The temporary
> workaround, of course, is to call regcomp each time regexec is
> called.  Seems a bit much.
>
> basically the code is:
>
> regex_t HEADER;
>
> rtn = regcomp(&HEADER, <reg_expression_string>, REG_EXTENDED);
>
> if (regexec(&HEADER, &Line, 0, REG_NOTEOL) == REG_NOMATCH){ ... }
>
> and looking at the address field in HEADER shows that for the first
> three calls the address is valid.  After the third call, the address
> field is corrupted.  No other areas of the code access that regex_t
> struct or reference it in any way.
>
> best
>      rickf
>
> Rick Forrister                 <[EMAIL PROTECTED]>
>
> Definition:  Honest Politician:  Once bought, stays bought."
>                                 --Robert Heinlein
>
> _______________________________________________
> Redhat-list mailing list
> [EMAIL PROTECTED]
> https://listman.redhat.com/mailman/listinfo/redhat-list



_______________________________________________
Redhat-list mailing list
[EMAIL PROTECTED]
https://listman.redhat.com/mailman/listinfo/redhat-list

Reply via email to