microsoft / microsoft/MIEngine

Attaching with SSH transport and GDB Native debugging does not always show Modules loaded

Open
#518 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
C#
Stars
859
Forks
233
Avg merge
1d 6h
Merged PRs (30d)
3

Description

VS Version: 2017 RC (2 or 3)
Rerpo:

  1. On a linux machine, create a simple C++ executable that calls scanf (or something similar)
  2. Build it and run it on linux.
  3. From VS 2017 RC, attach using the SSH Transport (Debug -> Attach to process, change 'Connection Type' to SSH)
  4. Once attached, view the modules window

Expected: The modules window should show at least two modules
Actual: The modules window may show no modules (even though the library-loaded events appear in the MIEngine log).

This appears to be a race as it doesn't repro consistently. I can see the events in the MI log even when I don't see modules loaded in the modules window.

image

Full log:

1: (218) ->=thread-group-added,id="i1"
1: (219) ->~"GNU gdb (Ubuntu 7.11.1-0ubuntu1~16.04) 7.11.1\n"
1: (219) ->~"Copyright (C) 2016 Free Software Foundation, Inc.\n"
1: (219) ->~"License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>\nThis is free software: you are free to change and redistribute it.\nThere is NO WARRANTY, to the extent permitted by law.  Type \"show copying\"\nand \"show warranty\" for details.\n"
1: (219) ->~"This GDB was configured as \"x86_64-linux-gnu\".\nType \"show configuration\" for configuration details."
1: (219) ->~"\nFor bug reporting instructions, please see:\n"
1: (219) ->~"<http://www.gnu.org/software/gdb/bugs/>.\n"
1: (219) ->~"Find the GDB manual and other documentation resources online at:\n<http://www.gnu.org/software/gdb/documentation/>.\n"
1: (219) ->~"For help, type \"help\".\n"
1: (219) ->~"Type \"apropos word\" to search for commands related to \"word\".\n"
1: (219) ->(gdb) 
=thread-group-added,id="i1"
GNU gdb (Ubuntu 7.11.1-0ubuntu1~16.04) 7.11.1
Copyright (C) 2016 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.  Type "show copying"
and "show warranty" for details.
This GDB was configured as "x86_64-linux-gnu".
Type "show configuration" for configuration details.
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>.
Find the GDB manual and other documentation resources online at:
<http://www.gnu.org/software/gdb/documentation/>.
For help, type "help".
Type "apropos word" to search for commands related to "word".
1: (228) <-1001-gdb-set target-async on
1: (229) ->1001^done
1: (229) ->(gdb) 
1: (230) 1001: elapsed time 1
1: (1046) <-1002-gdb-set stop-on-solib-events 1
1: (1143) ->1002^done
1: (1143) ->(gdb) 
1: (1143) 1002: elapsed time 96
1: (1151) <-1003-interpreter-exec console "shell readlink -f /proc/9023/exe"
1: (1155) ->/home/chuckr/source/scratch2/a.out
1: (1155) ->1003^done
1: (1155) ->(gdb) 
1: (1155) 1003: elapsed time 3
1: (1157) <-1004-file-exec-and-symbols /home/chuckr/source/scratch2/a.out
1: (1159) ->1004^done
1: (1159) ->(gdb) 
1: (1159) 1004: elapsed time 1
1: (1159) <-1005-interpreter-exec console "show architecture"
1: (1160) ->~"The target architecture is set automatically (currently i386:x86-64)\n"
1: (1160) ->1005^done
1: (1160) ->(gdb) 
1: (1160) 1005: elapsed time 0
1: (1162) <-1006-target-attach 9023
1: (1163) ->=thread-group-started,id="i1",pid="9023"
1: (1163) ->=thread-created,id="1",group-id="i1"
1: (1163) ->1006^done
1: (1165) ->=library-loaded,id="/lib/x86_64-linux-gnu/libc.so.6",target-name="/lib/x86_64-linux-gnu/libc.so.6",host-name="/lib/x86_64-linux-gnu/libc.so.6",symbols-loaded="0",thread-group="i1"
1: (1165) ->=library-loaded,id="/lib64/ld-linux-x86-64.so.2",target-name="/lib64/ld-linux-x86-64.so.2",host-name="/lib64/ld-linux-x86-64.so.2",symbols-loaded="0",thread-group="i1"
1: (1169) 1006: elapsed time 6
0x00007f37392ff680 in __read_nocancel () at ../sysdeps/unix/syscall-template.S:84
1: (1238) ->~"0x00007f37392ff680 in __read_nocancel () at ../sysdeps/unix/syscall-template.S:84\n"
1: (1239) ->&"84\t../sysdeps/unix/syscall-template.S: No such file or directory.\n"
1: (1239) ->*stopped,frame={addr="0x00007f37392ff680",func="__read_nocancel",args=[],file="../sysdeps/unix/syscall-template.S",fullname="/build/glibc-Qz8a69/glibc-2.23/io/../sysdeps/unix/syscall-template.S",line="84"},thread-id="1",stopped-threads="all",core="7"
1: (1266) <-1007-thread-info
1: (1267) ->1007^done,threads=[{id="1",target-id="process 9023",name="a.out",frame={level="0",addr="0x00007f37392ff680",func="__read_nocancel",args=[],file="../sysdeps/unix/syscall-template.S",fullname="/build/glibc-Qz8a69/glibc-2.23/io/../sysdeps/unix/syscall-template.S",line="84"},state="stopped",core="7"}],current-thread-id="1"
1: (1268) ->(gdb) 
1: (1271) 1007: elapsed time 5
1: (1288) <-1008-stack-list-frames 0 1000
1: (1294) ->1008^done,stack=[frame={level="0",addr="0x00007f37392ff680",func="__read_nocancel",file="../sysdeps/unix/syscall-template.S",fullname="/build/glibc-Qz8a69/glibc-2.23/io/../sysdeps/unix/syscall-template.S",line="84"},frame={level="1",addr="0x00007f37392835e8",func="_IO_new_file_underflow",file="fileops.c",fullname="/build/glibc-Qz8a69/glibc-2.23/libio/fileops.c",line="592"},frame={level="2",addr="0x00007f373928460e",func="__GI__IO_default_uflow",file="genops.c",fullname="/build/glibc-Qz8a69/glibc-2.23/libio/genops.c",line="413"},frame={level="3",addr="0x00007f3739265260",func="_IO_vfscanf_internal",file="vfscanf.c",fullname="/build/glibc-Qz8a69/glibc-2.23/stdio-common/vfscanf.c",line="634"},frame={level="4",addr="0x00007f373927387b",func="__scanf",file="scanf.c",fullname="/build/glibc-Qz8a69/glibc-2.23/stdio-common/scanf.c",line="33"},frame={level="5",addr="0x00000000004005c3",func="main",file="main.cpp",fullname="/home/chuckr/source/scratch2/main.cpp",line="6"}]
1: (1294) ->(gdb) 
1: (1294) 1008: elapsed time 5
1: (1301) <--exec-continue
1: (1302) ->^running
1: (1303) ->*running,thread-id="all"
1: (1303) ->(gdb) 

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Reproduce the issue with a simple C++ executable calling scanf, attach from VS 2017 RC through SSH transport, and inspect the Modules window alongside the MIEngine log. Focus on the timing between GDB library-loaded events and the displayed modules. Done means the loaded modules appear reliably after attachment, including when the events are present in the log.

Written by the indexing model from the issue text.

Assessment

Tech stack
linux
Domain
devtools
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.