Do not use on any
shared computer
July 25, 2008 02:33pm pdt
null
[x]
Attachment Details

The value of ESP was not properly saved across a function call

Tags: esp, value, properly, saved, across
Hi,

i am keeping getting this error:

Debug Error !
Program : myfile.EXE
Module :
File : i386\chkesp.c
Line : 42
The value of ESP was not properly saved across a function call. This is usually a result of calling a function declared with one calling convention with a function pointer declared with a different calling convention."

this is the call stack:

TNSERVER! _chkesp + 46 bytes
ACE_Task<ACE_Thread_Mutex,ACE_Condition_Thread_Mutex>::putq(ACE_Message_Block * 0x009f2828, ACE_Time_Value * 0x00000000) line 40
CLogFile::log(e_log_level e_debug, const char * 0x0048dbb8 `string') line 142
CRequestMgr::svc() line 74 + 28 bytes
ACE_Task_Base::svc_run(void * 0x004a4018) line 254 + 11 bytes
ACE_Thread_Adapter::invoke_i() line 151 + 7 bytes
ACE_Thread_Adapter::invoke() line 95 + 11 bytes
ace_thread_adapter(void * 0x009e99c0) line 137 + 11 bytes
_threadstartex(void * 0x009e9a38) line 212 + 13 bytes
KERNEL32! 77e6608b()

this is the function:

int CLogFile::log(e_log_level level,const char *format, ...)
{
      char message[1024] = "";
      int ret = 0;
      va_list args;
      char serverName[256]="";
      ACE_TCHAR tmpValue[256];

      T_LOG_DATA log;

      /*ML-10/22/07*/
      try
      {
            ACE_OS::memset(&log, 0, sizeof(log));
            ACE_OS::memset(tmpValue,0,sizeof(tmpValue));

            /* check log level, only send configured type of log to logger */
            if ( m_glogLevel >= level )
            {
                  ret = CConfiguration::get_section_string((ACE_TCHAR*)GENERAL_SECTION,TNSERVER_NAME,tmpValue,256);
                  if ( ret < 0 ) //not found, just assign default name
                        ACE_OS::sprintf(serverName,"%s", APPLICATION_NAME);
                  else ACE_OS::sprintf(serverName,"%s",ACE_TEXT_ALWAYS_CHAR(tmpValue));

                  va_start( args, format );
                  _vsnprintf( message, sizeof(message), format,args );
                  va_end( args );

                  _snprintf( log.message, sizeof(log.message), "%s | %d.%d | %s\n",
                  serverName,TN_SERVER_MAJOR_VERSION,TN_SERVER_MINOR_VERSION,message );
                  log.logLevel = map_to_ace_error_type(level);
                  ACE_Message_Block *mb;

                  ACE_NEW_RETURN
                        (mb, ACE_Message_Block(sizeof(log)), -1);

                  ACE_OS::memcpy ( mb->wr_ptr (), &log, sizeof(log) );

                  m_plogMgr->putq( mb );
            
            }
      }
      catch(std::exception& e)
      {
            char exceptionbuff[150];
            strcpy(exceptionbuff, "EXCEPTION in CLogFile::log(): ");
            strcat(exceptionbuff, e.what());
            fprintf(stderr,"%s\n", exceptionbuff);
      }
      catch(...)
      {
            fprintf(stderr,"EXCEPTION in CLogFile::log()\n");
      }
      return 0;
}

and it's being called this way:

      try{

            CLogFile::log(e_debug, "Line:(%d),File:(%s), request_receiver():Entering",
                  __LINE__,__FILE__);

...

anyway, according to some online forums, it's due to:

Most probably its the different calling conventions you are using for the function exported from DLL and how you declare the function pointer to it.
but i don't see any different calling conventions, and i am not exporting the function from a dll.  can someone help me?
thanks.

Start your free trial to view this solution
[x]
The Solution Rating System

With so many solutions, how can you tell which solutions are most likely to help you and which ones are not? To provide you with a tool to use, we rate our solutions based on various elements that most accurately determine if a solution is a quality solution. To explain what factors affect the solution rating, here are the elements we take into consideration when formulating our solution rating.

  • The Grade of the Solution
  • The Zone Rank of the Expert Providing the Solution
  • The Number of Author and Expert Comments
  • The Number of Experts Contributing
  • The Feedback of the Community

Your Input Matters
Because of the way the system is set up, the most important variable in this equation is you. As a member of Experts Exchange, you are able to cast your vote on the quality of the solutions in regard to how complete, accurate, helpful and easy to understand each solution is. When you provide your feedback, each rating is adjusted accordingly. So, if you see a solution that has a poor rating that you think is a good solution, let us know by rating it. As you do, the rating will be adjusted and will become more accurate for other members of our site.

If you have any suggestions that you would like to make for our rating system, please ask a question in the Suggestions Zone of Community Support.

Thank you!

Question Stats
Zone: Programming
Question Asked By: mmingfeilam
Solution Provided By: Infinity08
Participating Experts: 2
Solution Grade: B
Views: 135
Translate:
Loading Advertisement...
 
[+][-]Expert Comment by jkr

Rank: Genius

Expert Comment by jkr:

All comments and solutions are available to Premium Service Members only.

Start your 7-day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
 
[+][-]Author Comment by mmingfeilam
Author Comment by mmingfeilam:

All comments and solutions are available to Premium Service Members only.

Start your 7-day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
 
[+][-]Expert Comment by Infinity08

Rank: Genius

Expert Comment by Infinity08:

All comments and solutions are available to Premium Service Members only.

Start your 7-day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
 
[+][-]Author Comment by mmingfeilam
Author Comment by mmingfeilam:

All comments and solutions are available to Premium Service Members only.

Start your 7-day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
 
[+][-]Expert Comment by Infinity08

Rank: Genius

Expert Comment by Infinity08:

All comments and solutions are available to Premium Service Members only.

Start your 7-day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
 
[+][-]Author Comment by mmingfeilam
Author Comment by mmingfeilam:

All comments and solutions are available to Premium Service Members only.

Start your 7-day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
 
[+][-]Expert Comment by Infinity08

Rank: Genius

Expert Comment by Infinity08:

All comments and solutions are available to Premium Service Members only.

Start your 7-day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
 
[+][-]Author Comment by mmingfeilam
Author Comment by mmingfeilam:

All comments and solutions are available to Premium Service Members only.

Start your 7-day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
 
[+][-]Accepted Solution by Infinity08

Rank: Genius

Accepted Solution by Infinity08:

All comments and solutions are available to Premium Service Members only.

Start your 7-day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
 
Loading Advertisement...
20080723-EE-VQP-34 / EE_QW_1_20070628