BorlandTalk.com Forum Index BorlandTalk.com
Borland discussion newsgroups
 
Archives   FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

CodeGuard reports "Attempt to access 156 byte(s) at address

 
Post new topic   Reply to topic    BorlandTalk.com Forum Index -> C++ Builder (WinAPI)
View previous topic :: View next topic  
Author Message
Guest






PostPosted: Tue Apr 10, 2007 2:04 pm    Post subject: CodeGuard reports "Attempt to access 156 byte(s) at address Reply with quote



Quote:
I'm working on an application that should (in theory) be made of a main
program and some modules (DLLs).
The main program is based on a set of classes and functions that are able to
load and unload the modules.

We have a class ModuleManager that must load one after the other the modules
at program startup, to get some information about their capabilities.
Everything that is returned from the module is copied in a container of the
ModuleManager class, the allocated memory is freed and the module unloaded.

Codeguard was reporting a resource leak with a previous version of that
class because we did not free the allocated memory from the module before
unloading.

Now everything works fine, we have no problem loading our 12 modules
separately.

When we are trying to load all our modules, one after the other (I repeat :
we load a module, we get some data, we free memory and we unload the
module), after an undefined number of modules, Codeguard reports an invalid
memory access, and even if we can continue the execution, the program stops
and/or crashes.

The codeguard log looks like this :

Error 00001. 0x100400 (Thread 0x060C):
Access in invalid memory: Attempt to access 156 byte(s) at 0x0381B684.
memcpy(0x01477280, 0x0381B684, 0x9C [156])

Call Tree:
0x0381850E(=IFCInterfaceLib.bpl:0x01:00750E)
0x03811095(=IFCInterfaceLib.bpl:0x01:000095)
0x77F8E723(=ntdll.dll:0x01:00D723)
0x77F87984(=ntdll.dll:0x01:006984)
0x77F8B7CA(=ntdll.dll:0x01:00A7CA)
0x77E9F377(=kernel32.dll:0x01:01E377)

We struggled on this for days and we do not understand what happens. We also
read every possible documentation about rebasing Dlls, using packing
pragmas, etc.
Our development is made under BCB5, on Windows 2000 Pro SP1.

The only solution we found now, to be able to finish this project in time is
to compile statically the whole project. We still believe it is possible to
do it (and I hope it is), but now we run out of time.

On previous projects I worked on, I never had this problem because we were
never using more than 2 or 3 dlls (even if they were bigger)

I have absolutely the same problem in BCB6. I have multiple errors
"Attempt to
access 156 byte(s) at adress XXXX" in LoadLibrary function.
Our project includes about 30 dynamicaly loaded BPLs, and some of them
cause this errors. In fact this errors occures even if we doesnt call
any functions
and create any objects from these libraries, but just load them.

Have anyone solved this problem?
This problem exists in later versions of Borland products?

-----
Valeriy Naumenko.
Back to top
Display posts from previous:   
Post new topic   Reply to topic    BorlandTalk.com Forum Index -> C++ Builder (WinAPI) All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2006 phpBB Group
SEO toolkit © 2004-2006 webmedic.