Skip to content

GDB will not launch debuggee - regression since 16299 #2870

Closed

Description

I can debug with GDB on 16299.192 and it works fine.

dan@danmose2:~/gcc$ gdb ./test
GNU gdb (Ubuntu 7.11.1-0ubuntu1~16.5) 7.11.1
...
Reading symbols from ./test...done.
(gdb) break main
Breakpoint 1 at 0x40052a: file test.c, line 5.
(gdb) run
Starting program: /home/dan/gcc/test

Breakpoint 1, main () at test.c:5
5           printf("Hello world\n");

But on 17074 insider build it fails:

dan@DESKTOP:/mnt/c/gcc$ gcc -o test -Wall test.c -g
dan@DESKTOP:/mnt/c/gcc$ strace -f -o out2 gdb ./test
GNU gdb (Ubuntu 7.11.1-0ubuntu1~16.5) 7.11.1
...
Reading symbols from ./test...done.
(gdb) break main
Breakpoint 1 at 0x400875: file test.c, line 17.
(gdb) run
Starting program: /mnt/c/gcc/test
During startup program exited normally.
(gdb) q
dan@DESKTOP:/mnt/c/gcc$ grep PTRACE out2
7416  ptrace(PTRACE_TRACEME, 0, NULL, NULL) = -1 EPERM (Operation not permitted)

therealkenc mentioned the PTRACE_TRACEME EPERM is the same on regular Linux. I'll share a full strace when I get back home to this box.

Broken out from #2028 which concerns LLDB being broken.

Activity

  1. danmoseley commented on Jan 23, 2018

    @danmoseley
    Author

    I can confirm that Brian Perkins (@Brian-Perkins) suggestion of set disable-randomization off in gdb seems to work around it:

    dan@DESKTOP-CJJBOPC:/mnt/c/gcc$ gdb ./test
    GNU gdb (Ubuntu 7.11.1-0ubuntu1~16.5) 7.11.1
    ...
    Reading symbols from ./test...done.
    (gdb) set disable-randomization off
    (gdb) break main
    Breakpoint 1 at 0x400875: file test.c, line 17.
    (gdb) run
    Starting program: /mnt/c/gcc/test
    
    Breakpoint 1, main (argc=1, argv=0x7fffe03f4f68) at test.c:17
    17          doit();
    
  2. therealkenc commented on Jan 23, 2018

    @therealkenc

    Ref #1185 (message). If the regression was 17063, that's a month (since Dec 19th) that no one on Insiders noticed. Interesting data point. [edit: Well looks like someone noticed after all. In vscode-cpptools.]

  3. Brian-Perkins commented on Jan 24, 2018

    @Brian-Perkins
    Contributor

    This should be fixed in 17083.

  4. danmoseley commented on Jan 30, 2018

    @danmoseley
    Author

    therealkenc you confirmed this fix it seems from the vscode issue? If so I will close.

  5. therealkenc commented on Jan 30, 2018

    @therealkenc

    Yeah we are all good now. Normally fixedinsiderbuilds tags are held in the open state until the next stable release (for better or worse), which is probably why Brian didn't close it. But since this was transient seems appropriate to call it a wrap. Maybe we need a insider-regression tag or something 🤷.

  6. danmoseley commented on Jan 30, 2018

    @danmoseley
    Author

    Thanks for confirmation.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions