none
VS2019 Debugger hanging when interrupted when remote debugging on gdb RRS feed

  • Question

  • Hello,

    We have a massive project running on Linux we would like to move to Visual Studio because VS is a great tool! Yes it is!

    We have already migrated quite a lot of it to remote debug using CMake and gdb (see my other threads about it). Now we are at a point where the binary is running on Linux under a GDB 7.10. We can put breakpoints but when we try to do a breakall (the pause button of VS. Then VS is hanging on forever. We can see that gdb received the command and halted the program properly but VS is not doing anything even after a full weekend left hanging :)

    I have used another VS to try to debug it and here is the stack trace on the primary thread of the VS hanging:

    WindowsBase.dll!System.Windows.Threading.DispatcherSynchronizationContext.Wait(System.IntPtr[] waitHandles, bool waitAll, int millisecondsTimeout) Unknown
    mscorlib.dll!System.Threading.SynchronizationContext.InvokeWaitMethodHelper(System.Threading.SynchronizationContext syncContext, System.IntPtr[] waitHandles, bool waitAll, int millisecondsTimeout) Unknown
      [Native to Managed Transition]
      [Managed to Native Transition]
      mscorlib.dll!System.Threading.WaitHandle.InternalWaitOne(System.Runtime.InteropServices.SafeHandle waitableSafeHandle, long millisecondsTimeout, bool hasThreadAffinity, bool exitContext) Unknown
      mscorlib.dll!System.Threading.WaitHandle.WaitOne(int millisecondsTimeout, bool exitContext) Unknown
      mscorlib.dll!System.Threading.WaitHandle.WaitOne() Unknown
      Microsoft.MIDebugEngine.dll!Microsoft.MIDebugEngine.WorkerThread.TrySetOperationInternal(System.Delegate op) Unknown
      Microsoft.MIDebugEngine.dll!Microsoft.MIDebugEngine.WorkerThread.SetOperationInternal(System.Delegate op) Unknown
    Microsoft.MIDebugEngine.dll!Microsoft.MIDebugEngine.WorkerThread.RunOperation(Microsoft.MIDebugEngine.AsyncOperation op) Unknown
      Microsoft.MIDebugEngine.dll!Microsoft.MIDebugEngine.AD7Engine.CauseBreak() Unknown
      [Native to Managed Transition]
      [Managed to Native Transition]
      Microsoft.VisualStudio.Shell.15.0.dll!Microsoft.Internal.VisualStudio.PlatformUI.DataSource.Invoke(string verb, object pvaIn, out object pvaOut) Unknown
      Microsoft.VisualStudio.Shell.UI.Internal.dll!Microsoft.VisualStudio.PlatformUI.VsCommand.Execute(object parameter) Unknown
    PresentationFramework.dll!MS.Internal.Commands.CommandHelpers.CriticalExecuteCommandSource(System.Windows.Input.ICommandSource commandSource, bool userInitiated) Unknown
      PresentationFramework.dll!System.Windows.Controls.Primitives.ButtonBase.OnClick() Unknown
      PresentationFramework.dll!System.Windows.Controls.Button.OnClick() Unknown
    PresentationFramework.dll!System.Windows.Controls.Primitives.ButtonBase.OnMouseLeftButtonUp(System.Windows.Input.MouseButtonEventArgs e) Unknown
      PresentationCore.dll!System.Windows.UIElement.OnMouseLeftButtonUpThunk(object sender, System.Windows.Input.MouseButtonEventArgs e) Unknown
      PresentationCore.dll!System.Windows.Input.MouseButtonEventArgs.InvokeEventHandler(System.Delegate genericHandler, object genericTarget) Unknown
      PresentationCore.dll!System.Windows.RoutedEventArgs.InvokeHandler(System.Delegate handler, object target) Unknown
      PresentationCore.dll!System.Windows.RoutedEventHandlerInfo.InvokeHandler(object target, System.Windows.RoutedEventArgs routedEventArgs) Unknown
      PresentationCore.dll!System.Windows.EventRoute.InvokeHandlersImpl(object source, System.Windows.RoutedEventArgs args, bool reRaised) Unknown
      PresentationCore.dll!System.Windows.UIElement.ReRaiseEventAs(System.Windows.DependencyObject sender, System.Windows.RoutedEventArgs args, System.Windows.RoutedEvent newEvent) Unknown
      PresentationCore.dll!System.Windows.UIElement.OnMouseUpThunk(object sender, System.Windows.Input.MouseButtonEventArgs e) Unknown
      PresentationCore.dll!System.Windows.Input.MouseButtonEventArgs.InvokeEventHandler(System.Delegate genericHandler, object genericTarget) Unknown
      PresentationCore.dll!System.Windows.RoutedEventArgs.InvokeHandler(System.Delegate handler, object target) Unknown
      PresentationCore.dll!System.Windows.RoutedEventHandlerInfo.InvokeHandler(object target, System.Windows.RoutedEventArgs routedEventArgs) Unknown
      PresentationCore.dll!System.Windows.EventRoute.InvokeHandlersImpl(object source, System.Windows.RoutedEventArgs args, bool reRaised) Unknown
      PresentationCore.dll!System.Windows.UIElement.RaiseEventImpl(System.Windows.DependencyObject sender, System.Windows.RoutedEventArgs args) Unknown
      PresentationCore.dll!System.Windows.UIElement.RaiseTrustedEvent(System.Windows.RoutedEventArgs args) Unknown
      PresentationCore.dll!System.Windows.Input.InputManager.ProcessStagingArea() Unknown
      PresentationCore.dll!System.Windows.Input.InputManager.ProcessInput(System.Windows.Input.InputEventArgs input) Unknown
      PresentationCore.dll!System.Windows.Input.InputProviderSite.ReportInput(System.Windows.Input.InputReport inputReport) Unknown
      PresentationCore.dll!System.Windows.Interop.HwndMouseInputProvider.ReportInput(System.IntPtr hwnd, System.Windows.Input.InputMode mode, int timestamp, System.Windows.Input.RawMouseActions actions, int x, int y, int wheel) Unknown
      PresentationCore.dll!System.Windows.Interop.HwndMouseInputProvider.FilterMessage(System.IntPtr hwnd, MS.Internal.Interop.WindowMessage msg, System.IntPtr wParam, System.IntPtr lParam, ref bool handled) Unknown
      PresentationCore.dll!System.Windows.Interop.HwndSource.InputFilterMessage(System.IntPtr hwnd, int msg, System.IntPtr wParam, System.IntPtr lParam, ref bool handled) Unknown
      WindowsBase.dll!MS.Win32.HwndWrapper.WndProc(System.IntPtr hwnd, int msg, System.IntPtr wParam, System.IntPtr lParam, ref bool handled) Unknown
      WindowsBase.dll!MS.Win32.HwndSubclass.DispatcherCallbackOperation(object o) Unknown
      WindowsBase.dll!System.Windows.Threading.ExceptionWrapper.InternalRealCall(System.Delegate callback, object args, int numArgs) Unknown
      WindowsBase.dll!System.Windows.Threading.ExceptionWrapper.TryCatchWhen(object source, System.Delegate callback, object args, int numArgs, System.Delegate catchHandler) Unknown
    WindowsBase.dll!System.Windows.Threading.Dispatcher.LegacyInvokeImpl(System.Windows.Threading.DispatcherPriority priority, System.TimeSpan timeout, System.Delegate method, object args, int numArgs) Unknown
      WindowsBase.dll!MS.Win32.HwndSubclass.SubclassWndProc(System.IntPtr hwnd, int msg, System.IntPtr wParam, System.IntPtr lParam) Unknown


    On gdb side we can properly see the interruption:

    ~"\nProgram received signal "
    ~"SIGINT, Interrupt.\n"
    ~"0x000000365d812d34 in dl_open_worker () from /lib64/ld-linux-x86-64.so.2\n"
    *stopped,reason="signal-received",signal-name="SIGINT",signal-meaning="Interrupt",frame={addr="0x000000365d812d34",func="dl_open_worker",args=[],from="/lib64/ld-linux-x86-64.so.2"},thread-id="1",stopped-threads="all",core="3"

    Kind regards,

    Guillaume.

    Monday, October 7, 2019 9:00 PM

All replies

  • Hello,

    Actually someone in our Team managed to capture this exactly at the time VS was shutting down after a "End Task":

    As I can paste images... There is a popup saying: "Error while trying to enter break state. Debugging will now stop. GDB exited unexpectedly with exit code 1 (0x1)."

    On its side gdb received and executed the command properly. As mentioned on the message above the gdb is 7.10.

    Kind regards,

    Guillaume.

    Monday, October 7, 2019 10:21 PM
  • Hello Again, Again,

    Apparently doing a kill -2 on the pid directly from the Linux box while Visual Studio is piloting gdb from the Windows box makes VS react properly and display the proper call stack and everything. No freeze. Hope this helps.

    Kind regards,

    Guillaume.

    Monday, October 7, 2019 10:49 PM
  • Hi gzorlee,

    Thank you for posting here.

    I have done a escalation about your issue, if there is any responses , we will post it here in time. Thank you for your understanding and impatience.

    Best Regards,

    Dylan


    MSDN Community Support Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com


    Tuesday, October 8, 2019 8:09 AM
  • Hello Dylan,

    No problem at all. By the way is it really the place to post issues like this? Should I rather post it somewhere else to reach Microsoft? I saw there is a github forum as well.

    By the way creating a task in the tasks.vs.json like the following works well in case it helps other people to debug:

    {

      "version": "0.2.1",
      "tasks": [
        {
          "taskLabel": "Interrupt GT",
          "taskName": "InterruptGT",
          "appliesTo": "*",
          "type": "remote",
          "command": "kill -2 `ps aux | grep gtorrent | grep programName | grep -v grep | grep -v gdb | awk '{print $2}'`",
          "remoteMachineName": "blablabla123.bla.com"
        }
      ]
    }

    Kind regards,

    Guillaume.

    Tuesday, October 8, 2019 3:43 PM
  • Hi gzorlee,

    Sorry for delay long time.

    Did this issue still exist? If not, could you provide these details about this issue:

    1. Does this issue reprodue stably? or it just occur randomly?
    2. if we set the break point previously, will this issue occur?
    3. How many projects do you debug at the same time?
    4. Do you mean while this issue occur, VS popup error message:"Error while trying to enter break state. Debugging will now stop. GDB exited unexpectedly with exit code 1 (0x1)."? but you also said it hang for the whole weekend?

    Look forward to your reply.

    Best Regards,

    Dylan


    MSDN Community Support Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com

    Friday, November 1, 2019 2:11 AM
  • Hi gzorlee,

    To keep this issue move forward, can you help provide the info of the below questions?

    • Does this issue reprodue stably? or it just occur randomly?
    • if we set the break point previously, will this issue occur?
    • How many projects do you debug at the same time?
    • Do you mean while this issue occur, VS popup error message:"Error while trying to enter break state. Debugging will now stop. GDB exited unexpectedly with exit code 1 (0x1)."? but you also said it hang for the whole weekend?


    Friday, November 29, 2019 3:11 AM