Click here to Skip to main content
15,915,319 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: variable problem Pin
Bob Stanneveld24-May-05 7:18
Bob Stanneveld24-May-05 7:18 
Generalplease help with my attempt to edit subitem of CListCtrl Pin
lucy24-May-05 5:48
lucy24-May-05 5:48 
GeneralRe: please help with my attempt to edit subitem of CListCtrl Pin
lucy24-May-05 9:15
lucy24-May-05 9:15 
GeneralRe: please help with my attempt to edit subitem of CListCtrl Pin
PJ Arends24-May-05 9:26
professionalPJ Arends24-May-05 9:26 
GeneralRe: please help with my attempt to edit subitem of CListCtrl Pin
lucy25-May-05 3:11
lucy25-May-05 3:11 
Generalicons Pin
Dennis L24-May-05 5:42
Dennis L24-May-05 5:42 
GeneralRe: icons Pin
David Crow24-May-05 7:57
David Crow24-May-05 7:57 
GeneralRuntime Error on PCRE library, really need help! Pin
tomfd3s24-May-05 5:07
tomfd3s24-May-05 5:07 
I'm trying to port the FreeLing (Natural Language Processor) from linux to windows platform. The FreeLing used the PCRE library for reg-ex.

The FreeLing is built on C++ (normal STL) langauage. And I know that it's required a C++ Wrapper for PCRE. BTW, FreeLing have included C++ Wrapper in their project. I'm trying to use its built-in wrapper because it is modify to suitable for their code. If I change to another wrapper for PCRE, I think I could have a lot of work to modify the wrapper.

Let's see the error here. The Runtime error occur when the "void clone();" in "regexp.h" in FreeLing is running.


Here's the part of "regexp.h" in FreeLing.
The error is on "pcre_fullinfo(y.re, y.pe, PCRE_INFO_STUDYSIZE, &size);" Line.

<br />
private:		<br />
<br />
		void clone(const RegEx &y) {<br />
			size_t size;<br />
            if (!y.re) return;<br />
            <br />
			pcre_fullinfo(y.re, 0, PCRE_INFO_SIZE, &size);<br />
            re=(pcre*) new char[size];<br />
            if (!re) {<br />
                throw "not enough memory";<br />
			} else {<br />
                std::cout << std::endl << "**** Making new re pointer Allocation successful.. *****" << std::endl;<br />
            }<br />
			memcpy(re, y.re, size);<br />
<br />
            // Run time error on pcre_fullinfo();<br />
            pcre_fullinfo(y.re, y.pe, PCRE_INFO_STUDYSIZE, &size);<br />
            pe = (pcre_extra *) new char[size];<br />
<br />
            if (!pe) throw "not enough memory";<br />
            memcpy(pe, y.pe, size);<br />
<br />
            substrcount = y.substrcount;<br />
            ovector = new int[3*substrcount];<br />
            matchlist = NULL;<br />
		}<br />


And the error in pcre_fullinfo(); in PCRE.C is below.
On the line "*((size_t *)where) = (study == NULL)? 0 : study->size;" below "CASE:PCRE_INFO_STUDYSIZE";

<br />
int pcre_fullinfo(const pcre *external_re, const pcre_extra *extra_data, int what, void *where) {<br />
const real_pcre *re = (const real_pcre *)external_re;<br />
const pcre_study_data *study = NULL;<br />
<br />
if (re == NULL || where == NULL) return PCRE_ERROR_NULL;<br />
if (re->magic_number != MAGIC_NUMBER) return PCRE_ERROR_BADMAGIC;<br />
if (extra_data != NULL && (extra_data->flags & PCRE_EXTRA_STUDY_DATA) != 0)<br />
  study = extra_data->study_data;<br />
<br />
switch (what) {<br />
  case PCRE_INFO_OPTIONS:<br />
  *((unsigned long int *)where) = re->options & PUBLIC_OPTIONS; break;<br />
<br />
  case PCRE_INFO_SIZE:<br />
  *((size_t *)where) = re->size; break;<br />
<br />
  case PCRE_INFO_STUDYSIZE:<br />
  *((size_t *)where) = (study == NULL)? 0 : study->size;<br />
  break;<br />
  // more code here<br />
<br />


I'm using VS.NET 2003 and the error-popup say "
Unhandled exception at 0x0053d42d in TestFreeLing.exe: 0xC0000005: Access violation reading location 0xabababab.

I've try to navigate and understand the code for a week. But I don't know how to figure it.

Anybody please help me solve this problem.
Thank you very much.

GeneralRe: Runtime Error on PCRE library, really need help! Pin
tomfd3s24-May-05 5:12
tomfd3s24-May-05 5:12 
GeneralRe: Runtime Error on PCRE library, really need help! Pin
jmkhael24-May-05 6:55
jmkhael24-May-05 6:55 
GeneralRe: Runtime Error on PCRE library, really need help! Pin
tomfd3s24-May-05 20:57
tomfd3s24-May-05 20:57 
GeneralMDI Toolbar switch Pin
act_x24-May-05 4:29
act_x24-May-05 4:29 
GeneralRe: MDI Toolbar switch Pin
PJ Arends24-May-05 9:04
professionalPJ Arends24-May-05 9:04 
General_CrtIsValidHeapPointer Pin
Bob Stanneveld24-May-05 4:23
Bob Stanneveld24-May-05 4:23 
GeneralRe: _CrtIsValidHeapPointer Pin
jmkhael24-May-05 6:43
jmkhael24-May-05 6:43 
GeneralRe: _CrtIsValidHeapPointer Pin
Bob Stanneveld25-May-05 21:16
Bob Stanneveld25-May-05 21:16 
GeneralProblem in handling menu :( Pin
nripun24-May-05 4:07
nripun24-May-05 4:07 
QuestionFilmstrip control? Pin
Obliterator24-May-05 2:53
Obliterator24-May-05 2:53 
GeneralDynamic memomory error Pin
evgumin24-May-05 2:26
evgumin24-May-05 2:26 
GeneralRe: Dynamic memomory error Pin
toxcct24-May-05 2:30
toxcct24-May-05 2:30 
GeneralRe: Dynamic memory error Pin
evgumin24-May-05 4:25
evgumin24-May-05 4:25 
GeneralRe: Dynamic memory error Pin
wb24-May-05 4:41
wb24-May-05 4:41 
GeneralRe: Dynamic memory error Pin
doublebug24-May-05 9:22
doublebug24-May-05 9:22 
GeneralRe: Dynamic memomory error Pin
Cedric Moonen24-May-05 2:56
Cedric Moonen24-May-05 2:56 
GeneralRe: Dynamic memomory error Pin
evgumin24-May-05 4:42
evgumin24-May-05 4:42 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.