From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 24574 invoked by alias); 27 Oct 2011 12:11:59 -0000 Received: (qmail 24552 invoked by uid 22791); 27 Oct 2011 12:11:56 -0000 X-SWARE-Spam-Status: No, hits=-1.3 required=5.0 tests=AWL,BAYES_00,RP_MATCHES_RCVD,SPF_NEUTRAL X-Spam-Check-By: sourceware.org Received: from granite1.mail.cornell.edu (HELO authusersmtp.mail.cornell.edu) (128.253.83.141) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Thu, 27 Oct 2011 12:11:41 +0000 Received: from [192.168.1.4] (cpe-67-249-194-47.twcny.res.rr.com [67.249.194.47]) (authenticated bits=0) by authusersmtp.mail.cornell.edu (8.14.4/8.12.10) with ESMTP id p9RCBdse005604 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NOT) for ; Thu, 27 Oct 2011 08:11:40 -0400 (EDT) Message-ID: <4EA94A7B.2070907@cornell.edu> Date: Thu, 27 Oct 2011 12:11:00 -0000 From: Ken Brown User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:7.0.1) Gecko/20110929 Thunderbird/7.0.1 MIME-Version: 1.0 To: cygwin@cygwin.com Subject: Re: gdb 7.3.50-2 crash References: <4E9AB98E.3020105@cornell.edu> In-Reply-To: <4E9AB98E.3020105@cornell.edu> Content-Type: multipart/mixed; boundary="------------090307020102010503040502" X-IsSubscribed: yes Mailing-List: contact cygwin-help@cygwin.com; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner@cygwin.com Mail-Followup-To: cygwin@cygwin.com X-SW-Source: 2011-10/txt/msg00555.txt.bz2 --------------090307020102010503040502 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Content-length: 823 On 10/16/2011 7:01 AM, Ken Brown wrote: > gdb 7.3.50-2 crashes with a segfault if a file is loaded and the > following two command lines are sent: > > server interpreter mi "-file-list-exec-source-files" > server list I don't know if it helps, but I've modified the STC from http://cygwin.com/ml/cygwin/2011-10/msg00472.html to apply to the present problem. I had to uncomment the sleep (1) to get it to run properly on my Linux system. I also made the STC run "gdb --annotate=3" even though the crash occurs with just "gdb", because that's how gdb is run by emacs in the situation that led to this bug report. The STC assumes that you have hello.exe in the current directory. $ cat > hello.c << EOF #include int main () { printf("Hello, world!\n"); return 0; } EOF $ gcc -g -o hello hello.c Ken --------------090307020102010503040502 Content-Type: text/plain; name="gdbsegv.cc" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="gdbsegv.cc" Content-length: 1452 #include #include #include #include #include #include void get_output (int fd); int main (int argc, const char **argv) { int master; pid_t pid; if ((pid = forkpty (&master, NULL, NULL, NULL)) < 0) { perror ("forkpty"); exit (1); } /* child */ if (pid == 0) { const char *av[100]; int i = 0; #ifdef STRACE_GDB av[i++] = "strace"; av[i++] = "-o"; av[i++] = "/tmp/strace.out"; #ifdef __CYGWIN__ av[i++] = "--mask=all+paranoid"; #endif #endif av[i++] = argv[1] ?: "gdb"; fprintf (stderr, "*** using %s\n", av[0]); av[i++] = "--annotate=3"; av[i++] = "hello.exe"; av[i] = NULL; execvp (av[0], (char * const *) av); /* shouldn't get here */ exit (1); } /* parent */ const char *input[20]; int i = 0; input[i++] = "server interpreter mi \"-file-list-exec-source-files\"\n"; input[i++] = "server list\n"; input[i++] = "q\n"; input[i] = NULL; for (int i = 0; input[i]; ++i) { write (master, input[i], strlen (input[i])); sleep (1); } get_output (master); wait (NULL); } void get_output (int fd) { char buf[4096]; while (1) { int nread = read (fd, buf, sizeof (buf)); if (nread > 0) write (STDOUT_FILENO, buf, nread); else { printf ("No more output. nread %d\n", nread); break; } } } --------------090307020102010503040502 Content-Type: text/plain; charset=us-ascii Content-length: 218 -- Problem reports: http://cygwin.com/problems.html FAQ: http://cygwin.com/faq/ Documentation: http://cygwin.com/docs.html Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple --------------090307020102010503040502--