From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 27590 invoked by alias); 5 Sep 2013 13:36:12 -0000 Mailing-List: contact gdb-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-owner@sourceware.org Received: (qmail 27575 invoked by uid 89); 5 Sep 2013 13:36:12 -0000 Received: from lvps176-28-13-145.dedicated.hosteurope.de (HELO lvps176-28-13-145.dedicated.hosteurope.de) (176.28.13.145) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Thu, 05 Sep 2013 13:36:12 +0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.9 required=5.0 tests=ALL_TRUSTED,BAYES_00 autolearn=ham version=3.3.2 X-HELO: lvps176-28-13-145.dedicated.hosteurope.de Received: from dabox.localnet (unknown [213.157.30.20]) by lvps176-28-13-145.dedicated.hosteurope.de (Postfix) with ESMTPSA id 15C48A8A4012 for ; Thu, 5 Sep 2013 15:36:09 +0200 (CEST) From: Tim Sander To: gdb@sourceware.org Subject: interpreter-exec on mingw/cygwin gdb-7.6.2 fails Date: Thu, 05 Sep 2013 13:36:00 -0000 Message-ID: <45960314.Gb648h2Y3Y@dabox> User-Agent: KMail/4.11 (Linux/3.9.3; KDE/4.11.0; x86_64; ; ) MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" X-IsSubscribed: yes X-SW-Source: 2013-09/txt/msg00004.txt.bz2 Hi I have noticed that interpretex-exec completly fails on mingw/cygwin if executed with "source " or gdb -x cmdfile. The content of cmdfile is for example: interpreter-exec console "set target-async off" After that console gets continually printed with: (gdb) select: Bad file descriptor. Whch comes from event-loop.c, gdb_wait_for_event, perror_with_name (("select")); and gdb does not seem to react any more to any input. First (see patch below) i thought that there might be a stale handle of the recursive called interpreter but gdb_notifier only contains one handle at this time so it seems as if the file handle got stale/corrupted in some way during the inner interpreter call. (Also closing this handle stops gdb execution). I would be happy if someone would have an idea how tackle this error. Best regards Tim PS: Note this is not fixed by the hack below, which fixes http://sourceware.org/bugzilla/show_bug.cgi?id=15811 albeit in a not so clean way as it just cleans up and ignores any error :-(. But at least its better than the current state which just quits gdb. gdb/event-loop.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/gdb/event-loop.c b/gdb/event-loop.c index f34f153..fb394ce 100644 --- a/gdb/event-loop.c +++ b/gdb/event-loop.c @@ -736,9 +736,10 @@ handle_file_event (event_data data) printf_unfiltered (_("Error detected on fd %d\n"), file_ptr->fd); if (mask & POLLNVAL) - printf_unfiltered (_("Invalid or non-`poll'able fd %d\n"), + printf_unfiltered (_("Invalid or non-`poll'able fd %d\n Deleting handle."), file_ptr->fd); - file_ptr->error = 1; + delete_file_handler(file_ptr->fd); + file_ptr->error = 0; } else file_ptr->error = 0; --