locked
First-chance exception on closing RRS feed

  • Question

  • The symptom is:

    First-chance exception at 0x7703f9f2 (ntdll.dll) in ....exe: 0xC0000008: An invalid handle was specified.",

    occurring after the Form has closed. The top of the call stack is:

    ntdll.dll!_CloseHandle@4()

    The project is dual native C++ and C#. I have no idea of how to determine where this bug originates. Is there a way to find out who owns the handle? Anyone have a clue?

    Frode

    Monday, July 7, 2014 11:59 PM

Answers

All replies

  • Misalignment of the stack at the end of a method execution *when returning from a function) is usually caused by the return parameter of a method not being the same size in the called method and its parent.

    jdweng

    Tuesday, July 8, 2014 12:05 AM
  • How could this happen? I'm starting to think there's a bug in VS2013. If I generate a Windows Form project, compile and start debugging, then I get the "invalid handle" exception on exit. Not a single line of my own code was involved. If I run a mixed project with native debugging enabled, then this generates a couple of annoying dialogs when exiting. I guess I could turn it off, but I *do* want to be alerted to my own bugs. I probably should move this inquiry to Microsoft's bug report page.

    Frode

    Wednesday, July 9, 2014 7:44 PM
  • Thanks for jdweng’s help.

    Hi Frode,

    Thank you for posting in the MSDN forum.

    As far as I know generally the First-chance exception is not the app code issue.

    Maybe you could get useful information here:

    http://blogs.msdn.com/b/davidklinems/archive/2005/07/12/438061.aspx

    http://blogs.msdn.com/b/davidklinems/archive/2005/07/18/440150.aspx

    If you want to disable it, see:

    http://support.microsoft.com/kb/105675

    >> I probably should move this inquiry to Microsoft's bug report page.

    Actually this forum is to discuss the VS IDE, if you really submit a report for this issue here: https://connect.microsoft.com/VisualStudio/feedback/CreateFeedback.aspx, you’d better share a simple sample in your connect report, so it would be helpful for the product team experts to troubleshoot/repro this issue. Thanks for your understanding.

    Best Regards,


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.

    Thursday, July 10, 2014 6:52 AM
  • Hi Jack,

    is there a replacement for the broken url?

    (I am not allowed to insert link)  http://support.microsoft.com/kb/105675

    Best regards,

    kpav




    • Edited by kpav Wednesday, March 11, 2020 12:08 PM
    Wednesday, March 11, 2020 12:07 PM