public inbox for gdb-prs@sourceware.org
help / color / mirror / Atom feed
* [Bug gdb/27144] New: Just attaching and detaching gdb crashes the Inferior
@ 2021-01-03 18:41 marco.marsala at live dot it
  2021-01-03 20:29 ` [Bug gdb/27144] " marco.marsala at live dot it
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: marco.marsala at live dot it @ 2021-01-03 18:41 UTC (permalink / raw)
  To: gdb-prs

https://sourceware.org/bugzilla/show_bug.cgi?id=27144

            Bug ID: 27144
           Summary: Just attaching and detaching gdb crashes the Inferior
           Product: gdb
           Version: 10.1
            Status: UNCONFIRMED
          Severity: normal
          Priority: P2
         Component: gdb
          Assignee: unassigned at sourceware dot org
          Reporter: marco.marsala at live dot it
  Target Milestone: ---

With a specific executable (I could share that), attach gdb to that process:

gdb -p PID

then detach it, without doing anything else:

gdb) detach

crashes the process (PID, not gdb). Just before crashing, that process outputs:
“Unable to block on epool”

This happens only with a specific executable. Just attaching and detaching
should not cause that.

-- 
You are receiving this mail because:
You are on the CC list for the bug.

^ permalink raw reply	[flat|nested] 5+ messages in thread

* [Bug gdb/27144] Just attaching and detaching gdb crashes the Inferior
  2021-01-03 18:41 [Bug gdb/27144] New: Just attaching and detaching gdb crashes the Inferior marco.marsala at live dot it
@ 2021-01-03 20:29 ` marco.marsala at live dot it
  2021-01-04  0:14 ` simark at simark dot ca
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 5+ messages in thread
From: marco.marsala at live dot it @ 2021-01-03 20:29 UTC (permalink / raw)
  To: gdb-prs

https://sourceware.org/bugzilla/show_bug.cgi?id=27144

--- Comment #1 from Marco Marsala <marco.marsala at live dot it> ---
Created attachment 13089
  --> https://sourceware.org/bugzilla/attachment.cgi?id=13089&action=edit
The executable that crashes when gdb is detached

-- 
You are receiving this mail because:
You are on the CC list for the bug.

^ permalink raw reply	[flat|nested] 5+ messages in thread

* [Bug gdb/27144] Just attaching and detaching gdb crashes the Inferior
  2021-01-03 18:41 [Bug gdb/27144] New: Just attaching and detaching gdb crashes the Inferior marco.marsala at live dot it
  2021-01-03 20:29 ` [Bug gdb/27144] " marco.marsala at live dot it
@ 2021-01-04  0:14 ` simark at simark dot ca
  2021-01-04 17:20 ` marco.marsala at live dot it
  2021-01-04 17:54 ` simark at simark dot ca
  3 siblings, 0 replies; 5+ messages in thread
From: simark at simark dot ca @ 2021-01-04  0:14 UTC (permalink / raw)
  To: gdb-prs

https://sourceware.org/bugzilla/show_bug.cgi?id=27144

Simon Marchi <simark at simark dot ca> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |RESOLVED
         Resolution|---                         |NOTABUG
                 CC|                            |simark at simark dot ca

--- Comment #2 from Simon Marchi <simark at simark dot ca> ---
I bet that "epool" is actually "epoll", and that this happens because the
application in question does not correctly handle epoll_wait failures.  Like
most system calls, epoll_wait can return -1 with errno == EINTR.  If it wants
to keep waiting, the application should go back to calling epoll_wait.

As an example, try this small program:

---
#include <stdio.h>
#include <errno.h>
#include <string.h>
#include <sys/epoll.h>

int main() {

    int epoll = epoll_create(1);
    int ret = epoll_wait(epoll, NULL, 1, 1000 * 100);
    printf("ret = %d, strerror = %s\n", ret, strerror(errno));

    return 0;
}
---

Start it in one shell, and attach/detach GDB.  You'll get:

  ret = -1, strerror = Interrupted system call

This is likely the case that your application does not handle.  So, not a GDB
bug, but something that should be fixed in the application.

-- 
You are receiving this mail because:
You are on the CC list for the bug.

^ permalink raw reply	[flat|nested] 5+ messages in thread

* [Bug gdb/27144] Just attaching and detaching gdb crashes the Inferior
  2021-01-03 18:41 [Bug gdb/27144] New: Just attaching and detaching gdb crashes the Inferior marco.marsala at live dot it
  2021-01-03 20:29 ` [Bug gdb/27144] " marco.marsala at live dot it
  2021-01-04  0:14 ` simark at simark dot ca
@ 2021-01-04 17:20 ` marco.marsala at live dot it
  2021-01-04 17:54 ` simark at simark dot ca
  3 siblings, 0 replies; 5+ messages in thread
From: marco.marsala at live dot it @ 2021-01-04 17:20 UTC (permalink / raw)
  To: gdb-prs

https://sourceware.org/bugzilla/show_bug.cgi?id=27144

--- Comment #3 from Marco Marsala <marco.marsala at live dot it> ---
The error message says “epool” not epoll.
But in effect, newer versions of this executable fixed the issue (I haven’t
access to source code)

________________________________
Da: simark at simark dot ca <sourceware-bugzilla@sourceware.org>
Inviato: Monday, January 4, 2021 1:14:36 AM
A: marco.marsala@live.it <marco.marsala@live.it>
Oggetto: [Bug gdb/27144] Just attaching and detaching gdb crashes the Inferior

https://sourceware.org/bugzilla/show_bug.cgi?id=27144

Simon Marchi <simark at simark dot ca> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |RESOLVED
         Resolution|---                         |NOTABUG
                 CC|                            |simark at simark dot ca

--- Comment #2 from Simon Marchi <simark at simark dot ca> ---
I bet that "epool" is actually "epoll", and that this happens because the
application in question does not correctly handle epoll_wait failures.  Like
most system calls, epoll_wait can return -1 with errno == EINTR.  If it wants
to keep waiting, the application should go back to calling epoll_wait.

As an example, try this small program:

---
#include <stdio.h>
#include <errno.h>
#include <string.h>
#include <sys/epoll.h>

int main() {

    int epoll = epoll_create(1);
    int ret = epoll_wait(epoll, NULL, 1, 1000 * 100);
    printf("ret = %d, strerror = %s\n", ret, strerror(errno));

    return 0;
}
---

Start it in one shell, and attach/detach GDB.  You'll get:

  ret = -1, strerror = Interrupted system call

This is likely the case that your application does not handle.  So, not a GDB
bug, but something that should be fixed in the application.

--
You are receiving this mail because:
You reported the bug.

-- 
You are receiving this mail because:
You are on the CC list for the bug.

^ permalink raw reply	[flat|nested] 5+ messages in thread

* [Bug gdb/27144] Just attaching and detaching gdb crashes the Inferior
  2021-01-03 18:41 [Bug gdb/27144] New: Just attaching and detaching gdb crashes the Inferior marco.marsala at live dot it
                   ` (2 preceding siblings ...)
  2021-01-04 17:20 ` marco.marsala at live dot it
@ 2021-01-04 17:54 ` simark at simark dot ca
  3 siblings, 0 replies; 5+ messages in thread
From: simark at simark dot ca @ 2021-01-04 17:54 UTC (permalink / raw)
  To: gdb-prs

https://sourceware.org/bugzilla/show_bug.cgi?id=27144

--- Comment #4 from Simon Marchi <simark at simark dot ca> ---
(In reply to Marco Marsala from comment #3)
> Created attachment 13092 [details]
> attachment-2730485-0.html
> 
> The error message says “epool” not epoll.

What I meant is that it's probably a typo on their part.

> But in effect, newer versions of this executable fixed the issue (I haven’t
> access to source code)

Good!

-- 
You are receiving this mail because:
You are on the CC list for the bug.

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2021-01-04 17:54 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-01-03 18:41 [Bug gdb/27144] New: Just attaching and detaching gdb crashes the Inferior marco.marsala at live dot it
2021-01-03 20:29 ` [Bug gdb/27144] " marco.marsala at live dot it
2021-01-04  0:14 ` simark at simark dot ca
2021-01-04 17:20 ` marco.marsala at live dot it
2021-01-04 17:54 ` simark at simark dot ca

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).