Mirror of the gdb mailing list
 help / color / mirror / Atom feed
From: Tim Sander <tim@krieglstein.org>
To: gdb@sourceware.org
Subject: interpreter-exec on mingw/cygwin gdb-7.6.2 fails
Date: Thu, 05 Sep 2013 13:36:00 -0000	[thread overview]
Message-ID: <45960314.Gb648h2Y3Y@dabox> (raw)

Hi

I have noticed that interpretex-exec completly fails on mingw/cygwin if 
executed with "source <cmdfile>" 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;                                                                                                                                                                  
--  


                 reply	other threads:[~2013-09-05 13:36 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=45960314.Gb648h2Y3Y@dabox \
    --to=tim@krieglstein.org \
    --cc=gdb@sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox