Debug Error in chkesp.c 
Author Message
 Debug Error in chkesp.c

Hi all

After replacing a C++ class by a new one my program crashes with the
message

 Microsoft Visual C++ Debug Library
 Debug Error!
 Program: ...
 Module:
 File: i386\chkesp.c
 Line: 42

 The value of ESP was not properly saved across a function call.
 This is usually the result of calling a function declared with one
 calling convention with a function pointer declared with a different

 calling convention.

Looking for messages in the newsgroups I found that there are very
different situations causing this error but no explanation is given. A
curious thing is that another program using the same libraries as the
crashing one runs without any problems.

Has any one an idea what is going wrong ???

Monika



Tue, 12 Nov 2002 03:00:00 GMT  
 Debug Error in chkesp.c
Before and after calling a function, ESP should be same.
If you cannot find the cause really in your source code,
It would be good to try in assembly code.


Quote:
> Hi all

> After replacing a C++ class by a new one my program crashes with the
> message

>  Microsoft Visual C++ Debug Library
>  Debug Error!
>  Program: ...
>  Module:
>  File: i386\chkesp.c
>  Line: 42

>  The value of ESP was not properly saved across a function call.
>  This is usually the result of calling a function declared with one
>  calling convention with a function pointer declared with a different

>  calling convention.

> Looking for messages in the newsgroups I found that there are very
> different situations causing this error but no explanation is given. A
> curious thing is that another program using the same libraries as the
> crashing one runs without any problems.

> Has any one an idea what is going wrong ???

> Monika



Thu, 14 Nov 2002 03:00:00 GMT  
 Debug Error in chkesp.c
Hi Monika

Check your project settings.
As the error info suggests, the problem is the calling convention you're
using - this is a common problem when calling dll/library functions declared
as one convention, then referenced in a client app. using a different
convention. Try switching between the __cdecl and __stdcall in your
project->settings->c/c++->code generation to see if this fixes the problem.
(you might need to 'dig deeper' and do this at a function level rather than
project level)

hope this helps
Ian McQuade


Quote:
> Hi all

> After replacing a C++ class by a new one my program crashes with the
> message

>  Microsoft Visual C++ Debug Library
>  Debug Error!
>  Program: ...
>  Module:
>  File: i386\chkesp.c
>  Line: 42

>  The value of ESP was not properly saved across a function call.
>  This is usually the result of calling a function declared with one
>  calling convention with a function pointer declared with a different

>  calling convention.

> Looking for messages in the newsgroups I found that there are very
> different situations causing this error but no explanation is given. A
> curious thing is that another program using the same libraries as the
> crashing one runs without any problems.

> Has any one an idea what is going wrong ???

> Monika



Thu, 14 Nov 2002 03:00:00 GMT  
 Debug Error in chkesp.c
If one program works the library and another one doesn't, then the
two programs are probably compiled with different options
(stdcall versus cdecl) or are using different prototypes (so that
one of them is pushing the wrong number of arguments on the
stack).

Be very glad for that error message. Without that check this
type of error is about one hundred times harder to track down.

Quote:

> Hi all

> After replacing a C++ class by a new one my program crashes with the
> message

>  Microsoft Visual C++ Debug Library
>  Debug Error!
>  Program: ...
>  Module:
>  File: i386\chkesp.c
>  Line: 42

>  The value of ESP was not properly saved across a function call.
>  This is usually the result of calling a function declared with one
>  calling convention with a function pointer declared with a different

>  calling convention.

> Looking for messages in the newsgroups I found that there are very
> different situations causing this error but no explanation is given. A
> curious thing is that another program using the same libraries as the
> crashing one runs without any problems.

> Has any one an idea what is going wrong ???

> Monika

--
.Bruce Dawson, Humongous Entertainment.
http://www.humongous.com/


Sat, 16 Nov 2002 03:00:00 GMT  
 
 [ 4 post ] 

 Relevant Pages 

1. chkesp.c debug error.

2. Debug error! File:i386\chkesp.c line 42

3. Odd case of i386\chkesp.c error

4. chkesp error

5. i386\chkesp.c line 42 problem

6. Run time Release mode error but no Debug mode error

7. VC++.NET Build/Debug/Compile Error Codes: Where and How to Find

8. DEBUG ASSERT Error????

9. Runtime error in Release but not Debug

10. strange debug error

11. Rich-Error info lost on Attributed ATL project in remote debug config (again)

12. BUG: DEBUG member in enum in class syntax error C2059

 

 
Powered by phpBB® Forum Software