Problems running self-building code with Unicode
From: Toby Sharp (toby_sharp)
Date: 06/09/04
- Next message: Alexander Grigoriev: "Re: CPU real frequency"
- Previous message: Tubinson: "Emulating runas"
- Next in thread: Ivan Brugiolo [MSFT]: "Re: Problems running self-building code with Unicode"
- Reply: Ivan Brugiolo [MSFT]: "Re: Problems running self-building code with Unicode"
- Messages sorted by: [ date ] [ thread ]
Date: Wed, 9 Jun 2004 15:05:47 +0100
I have an app developed with C++ and inline assembly, compiled with MSDEV
.NET.
In the program, I generate code in memory at run-time which is then
executed. The memory where the code is built is allocated with VirtualAlloc
with PAGE_EXECUTE_READWRITE access. After building the code I call
FlushInstructionCache(::GetCurrentProcess(), NULL, 0);
The program runs very well in all but one circumstance. It works in Debug
mode, in Release mode, in Unicode Debug mode. It works in Unicode Release
mode if run from within the debugger (F5). But if run outside the debugger
in Unicode Release mode, it crashes with:
"Runtime Error!
Program: <appname>.exe
This application has requested the Runtime to terminate in an unusual way.
Please contact the application's support team for more information."
Then:
"The instruction at 0x7c2b88b5 referenced memory at 0x0000001c. The memory
could not be read. Click on OK to terminate the program."
Then:
"Runtime Error!
Program: <appname>.exe
R6025 - pure virtual function call"
I use the same code in a test app and it works fine. The only substantial
difference that I can think of is that in the real app (where it crashes),
this code is executed in a separate thread.
Does the FlushInstructionCache call work OK with threads?
Any ideas on this would be really welcome.
Thanks,
Toby.
- Next message: Alexander Grigoriev: "Re: CPU real frequency"
- Previous message: Tubinson: "Emulating runas"
- Next in thread: Ivan Brugiolo [MSFT]: "Re: Problems running self-building code with Unicode"
- Reply: Ivan Brugiolo [MSFT]: "Re: Problems running self-building code with Unicode"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|
|