SAP Knowledge Base Article - Preview

3335119 - A call to PInvoke function 'Sap.Data.SQLAnywhere.v4.5!Sap.Data.SQLAnywhere.PInvokeMethods::Unmanaged_Init' has unbalanced the stack - SQL Anywhere


  • Trying to compile a 32-bit .Net application using the .Net provider returns the following error:

    Managed Debugging Assistant 'PInvokeStackImbalance' : 'A call to PInvoke function 'Sap.Data.SQLAnywhere.v4.5!Sap.Data.SQLAnywhere.PInvokeMethods::Unmanaged_Init' has unbalanced the stack. This is likely because the managed PInvoke signature does not match the unmanaged target signature. Check that the calling convention and parameters of the PInvoke signature match the target unmanaged signature.'

  • Previously working 32-bit .Net applications may fail with the following errors in the Event log:

    Source: .NET Runtime
    Event ID: 1023
    Application: w3wp.exeFramework Version: v4.0.30319
    Description: The process was terminated due to an internal error in the .NET Runtime at IP <hex address> (<decimal address>) with exit code 80131506.

    Source: WAS
    Event ID: 5011
    A process serving application pool 'MyApp' suffered a fatal communication error with the Windows Process Activation Service. The process id was 'XXXX'. The data field contains the error number.



  • SAP SQL Anywhere to
  • .Net applications


SAP SQL Anywhere all versions


KBA , BC-SYB-SQA , SQL Anywhere (on premise, on demand) , Problem

About this page

This is a preview of a SAP Knowledge Base Article. Click more to access the full version on SAP for Me (Login required).

Search for additional results

Visit SAP Support Portal's SAP Notes and KBA Search.