[Bug gdb/27144] Just attaching and detaching gdb crashes the Inferior

marco.marsala at live dot it sourceware-bugzilla@sourceware.org
Mon Jan 4 17:20:17 GMT 2021


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.


More information about the Gdb-prs mailing list