[pcre-dev] confusion about crash in regfree in pcreposix3.dl…

トップ ページ
このメッセージを削除
著者: Seth Grover
日付:  
To: Pcre-dev
題目: [pcre-dev] confusion about crash in regfree in pcreposix3.dll in windows
Hello. First off, my apologies what I'm about to ask is a stupid question,
or if it's been answered somewhere else I didn't see. I did search the
mailing list and bugzilla but I didn't see the exact issue I'm having.

I've got a 32-bit Windows XP development environment where I'm using
mingw's gcc to try to use pcreposix3.dll. I got the .dll and the .h files
from here: http://sourceforge.net/projects/gnuwin32/files/pcre/7.0/

I've got an incredibly simple test program in a directory with the .h file
and the .dll.

====================================
#include <stdio.h>
#include "pcreposix.h"

int main() {
int pcreresult = 0;
regex_t pcrehandle;

char* regex = "\\w+\\s+\\w+";
char* name = "Seth Grover";

pcreresult = regcomp(&pcrehandle, regex, 0);
fprintf(stderr, "comp result: %d\n", pcreresult);

pcreresult = regexec(&pcrehandle, name, 0, 0x0, REG_NOSUB);
fprintf(stderr, "match result: %d\n", pcreresult);

regfree(&pcrehandle);
fprintf(stderr, "done\n");
}
====================================

Which I am compiling like this:

gcc -I. -L. -g -O0 -o test1 test1.c -lpcreposix3

The call to regcomp works great, and the call to regexec works find and
reports the match, as it should.

However, the call to regfree causes an access violation.

I hate to log a bug because with something this brain-numbingly simple, I
must be doing something wrong, but it's not apparent to me. Could one of
you fine people fill me in on what it is?

Thanks for your time,

Seth Grover
sethdgrover@???

--
Seth Grover

ΜΟΛΩΝ ΛΑΒΕ