Re: Invalid Page Fault and Safe.e

new topic     » goto parent     » topic index » view thread      » older message » newer message

Virtual B. writes:
> This is not just a problem with my program either.  
> I've tried it with a lot of the programs that come with 
> Win32Lib and get the same results.  

Safe.e can't be used with Win32Lib.

A long time ago safe.e was able to catch subtle 
memory corruption bugs in Win32Lib-based programs,
but that is no longer possible for two reasons:

1. The implementors of Win32Lib decided not to use
Euphoria's allocate() and free() but instead to
develop their own heap routines using direct calls to 
WIN32 API routines. The reasons for this are not clear to me.

2. There are some places where Win32Lib
picks up the address of a block of memory from a call
to a C routine. They would have to call register_block()
and unregister_block() in safe.e to track this.
I'm not sure how much work would be involved here.
I've recently added a switch to safe.e that allows you
to not bother registering any external blocks, in exchange for
having a much weaker check on memory. In this case it 
only checks the "gutter" areas just before and just after
each allocated block for corruption. Addresses that are 
far removed from any allocated block would be 
assumed safe. However this requires that
allocate() and free() actually be used (point #1).

Regards,
   Rob Craig
   Rapid Deployment Software
   http://www.RapidEuphoria.com

new topic     » goto parent     » topic index » view thread      » older message » newer message

Search



Quick Links

User menu

Not signed in.

Misc Menu