Menu

Linux/Windows pcreposix Seg Faulting

Help
2005-11-11
2012-07-26
  • Nobody/Anonymous

    I have prebuilt static libraries for *nix and for Windows which I got http://gnuwin32.sourceforge.net/packages/pcre.htm
    I am trying to use recomp, regexec and regfree to do some quick and dirty text parsing. Here is a rough snippet of code

    regex_t reg;
    regmatch_t regm[1];
    res = regcomp(&reg, "are", 0);
    res = regexec(&reg, "how are you", 1, regm, 0);
    regfree(&reg);

    Debugging through it, shows that both calls to regcomp and regexec are successful and "are" is correctly spotted. Disaster strikes when I call regfree though. On RHEL, it seg faults and on Windows XP it asserts.

    Now I can see why it would do that assuming regcomp returned res != 0 but everything is fine.

    Anybody have any ideas??? :(

     
    • Nobody/Anonymous

      regfree() crashes on me too with PCRE6 from GnuWin32. PCRE5 doesn't crash in the same situation.

      I was searching the archives to see it was a known issue... Maybe someone will have a suggestion this time (file a bug report?).

       
MongoDB Logo MongoDB