none
ICorDebug::CreateProcess crash on Windows 8 in .Net 4.5? RRS feed

  • Question

  • Hi,

    I have a program in .Net 4.5 using "ICorDebug::CreateProcess" (http://msdn.microsoft.com/en-us/library/vstudio/ms232508.aspx). It work on Windows XP, Vista, 7, but not on Windows 8 : my program stop without any message, even in debug mode. But, the same program, in .Net 4.0, work correctly on Windows 8.

    Any idea about this?

    Thank in advance :)
    Thursday, October 11, 2012 5:21 PM

Answers

  • Hi Veler,

    Welcome to the MSDN Forum.

    Could you email us at netfx45compat at Microsoft dot com with following information.

      • Code that reproduces the problem.
      • Operating System

    Thanks.

    Best regards,


    Mike Feng
    MSDN Community Support | Feedback to us
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.

    • Marked as answer by Veler Wednesday, October 17, 2012 7:38 AM
    Friday, October 12, 2012 10:11 AM
    Moderator
  • Hi everybody,

    Sorry for the time to answer. My problem is solved. There was a problem of type of two arguments in my __CreateProcess function, and it was a problem only on Windows 8.

    Thank you very much Mike Feng for your help by email.

    Have a nice day everybody :)

    Wednesday, October 17, 2012 7:38 AM

All replies

  • Hi Veler,

    Welcome to the MSDN Forum.

    Could you email us at netfx45compat at Microsoft dot com with following information.

      • Code that reproduces the problem.
      • Operating System

    Thanks.

    Best regards,


    Mike Feng
    MSDN Community Support | Feedback to us
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.

    • Marked as answer by Veler Wednesday, October 17, 2012 7:38 AM
    Friday, October 12, 2012 10:11 AM
    Moderator
  • ICorDebug::CreateProcess is used by a debugger when launching a debuggee, so presumably there are at least two processes involved (debugger and debuggee).

    1) Which of these processes is the one that stops?

    2) Stop could mean a few different things... what kind of symptoms do you observe?

         a) The UI for the application is not-responsive to mouse and keyboard events

         b) The UI for the application vanishes from the screen

         c) The process has exited (as determined by using process monitor, tlist, process explorer, etc and seeing an entry removed from the list of processes)

         d) The ICorDebugManagedCallback::ProcessExited event callback is raised in the debugger

         e) Something else?

    3) Have you used managed code to implement the debugger, the debuggee, or both?

    Thanks,

     -Noah

    Monday, October 15, 2012 12:34 AM
    Moderator
  • Hi everybody,

    Sorry for the time to answer. My problem is solved. There was a problem of type of two arguments in my __CreateProcess function, and it was a problem only on Windows 8.

    Thank you very much Mike Feng for your help by email.

    Have a nice day everybody :)

    Wednesday, October 17, 2012 7:38 AM
  • Posting details of email investigation of this report (it is not a .NET4.5 issue. There is memory corruption caused by the code and it may cause random errors)

    Hi Etienne,

                    I believe you are running in an 64-bit Windows 8 box and by default Visual Studio builds and runs the managed process as 64-bit process unless specified. Building and running your sample for x86 platform does not result in a silent crash, instead it throws a dialog box with an error.

                    In the __CreateProcess                definition, you are using uint as the parameter type. When running as a 64-bit process, the address field is 64-bit and it gets truncated when using uint. That causes an access violation and failure of the application. You should be using IntPtr which should work in both in both bitness.

    [MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime)]

            void __CreateProcess(

    [In, MarshalAs(UnmanagedType.LPWStr)] string lpApplicationName,

    [In, MarshalAs(UnmanagedType.LPWStr)] string lpCommandLine,

    [In] ref _SECURITY_ATTRIBUTES lpProcessAttributes,

    [In] ref _SECURITY_ATTRIBUTES lpThreadAttributes,

    [In] int bInheritHandles, [In] uint dwCreationFlags,

    [In] IntPtr lpEnvironment,

    [In, MarshalAs(UnmanagedType.LPWStr)] string lpCurrentDirectory,

    [In, ComAliasName("Debugger.Interop.CorDebug.ULONG_PTR")] uint lpStartupInfo,

    [In, ComAliasName("Debugger.Interop.CorDebug.ULONG_PTR")] uint lpProcessInformation,

    [In] CorDebugCreateProcessFlags debuggingFlags,

    [MarshalAs(UnmanagedType.Interface)] out ICorDebugProcess ppProcess);

                    Also the API CreateDebuggingInterfaceFromVersion is obsolete and you’d want to use  ICLRRuntimeInfo::GetInterface for creating ICorDebug interfaces. You can refer to the CLR Managed Debugger Sample for code sample.

                    Please let us know if this not solve your problem.

    Thanks,

    Rajkumar

    CLR Team


    Varun Gupta - MSFT

    Friday, October 19, 2012 3:51 PM