1. RE: Program crash with regex wrapper after translation

Robert Craig wrote:
> Andy Serpa writes:
> > I've been using Karl Bochert's wrappers (regex.zip in the archive) for 
> > the PCRE regular expression library, which work great under the 
> > interpreter, but when translated to C causes a crash whenever the 
> > regex_free function is called (which frees up memory when you are done 
> > with a compiled pattern).
> 
> Check the argument that's passed to regex_free().
> It's possible that it's wrong when you use the interpreter,
> but it just doesn't cause a crash. If it looks ok,
> then please send me a small program that works
> with the 2.3 alpha interpreter, but not with the 2.3 alpha translator.
> If you are still using the 2.2 translator, please install 2.3 alpha,
> interpreter and translator.
> 
> Regards,
>    Rob Craig
>    Rapid Deployment Software
>    http://www.RapidEuphoria.com
> 
> 
You don't even need to have regex_free in your code to cause the crash 
-- if you don't use the regex_compile function before using regex_find, 
regex_find calls regex_compile itself, performs the find, and then calls 
regex_free.

So ANY call in ANY program to regex_find without regex_compile in your 
own code (or with it, but then you have to call regex_free yourself) 
will cause the crash.  I should have mentioned I'm using all the latest 
versions of the interpreter & translator (unregistered) and am on a 
WinME system.  I tried compiling with both Borland & lccWin, same 
result.

new topic     » topic index » view message » categorize

2. RE: Program crash with regex wrapper after translation

Robert Craig wrote:
> Karl Bochert writes:
> > I compiled the pcre.dll from the publicly available C sources using
> > the LCC compiler. The sources do not have 'cdecl" in them. 
> 
> I believe _cdecl is the default with Lcc and most other compilers.
> 
> > Perhaps the dll should be compiled with Watcom? That would at least
> > speed it up considerably.
> 
> The important thing is to declare all the C routines as __stdcall.
> Be aware that the exported names might change as a result.
> 

Well, seeing as I picked up Euphoria as a way to avoid learning C, you 
guys have gone over my head.  But please keep me informed of any fixes 
you come with for this problem...

Andy Serpa
renegade at earthling.net

new topic     » goto parent     » topic index » view message » categorize

Search



Quick Links

User menu

Not signed in.

Misc Menu