From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 29157 invoked by alias); 10 Jun 2004 19:30:27 -0000 Mailing-List: contact gdb-help@sources.redhat.com; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-owner@sources.redhat.com Received: (qmail 28974 invoked from network); 10 Jun 2004 19:30:15 -0000 Received: from unknown (HELO dirac.org) (64.142.25.39) by sourceware.org with SMTP; 10 Jun 2004 19:30:15 -0000 Received: by dirac.org (Postfix, from userid 1001) id 4A7BB3DEA; Thu, 10 Jun 2004 12:28:29 -0700 (PDT) Date: Thu, 10 Jun 2004 19:30:00 -0000 To: Gdb Mailing List Subject: gdb segfaults when printing long double complex variables Message-ID: <20040610192828.GA13125@dirac.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.5.5.1+cvs20040105i From: p@dirac.org (Peter Jay Salzman) X-SW-Source: 2004-06/txt/msg00104.txt.bz2 Bug: GDB segfaults when printing long double complex variables. Sample Code: 1 #include 2 #include 3 4 int main(void) 5 { 6 complex a; 7 double complex b; 8 long double complex c; 9 10 a = 5 + 2I; 11 printf("%f + %fi\n", __real__ a, __imag__ a); 12 13 b = 5.0 + 2.0I; 14 printf("%f + %fi\n", __real__ b, __imag__ b); 15 16 c = 5.0L + 2.0LI; 17 printf("%Lf + %Lfi\n", __real__ c, __imag__ c); 18 19 return 0; 20 } The program runs fine: p@satan$ gcc-3.3 -g -W -Wall blah.c p@satan$ ./a.out 5.000000 + 2.000000i 5.000000 + 2.000000i 5.000000 + 2.000000i The program runs fine under gdb: (gdb) run Starting program: /home/p/a.out 5.000000 + 2.000000i 5.000000 + 2.000000i 5.000000 + 2.000000i Program exited normally. But GDB itself cannot print long double complex variables without segfaulting: (gdb) break 18 Breakpoint 1 at 0x8048436: file blah.c, line 18. (gdb) run Starting program: /home/p/a.out 5.000000 + 2.000000i 5.000000 + 2.000000i 5.000000 + 2.000000i Breakpoint 1, main () at blah.c:19 19 return 0; (gdb) p a $1 = 5 + 2 * I (gdb) p b $2 = 5 + 2 * I (gdb) p c Segmentation fault (core dumped) This is very reproducible, unfortunately. This bug showed up at the worst possible moment... Pete -- In theory, theory and practise are the same. In practise, they aren't. GPG Instructions: http://www.dirac.org/linux/gpg GPG Fingerprint: B9F1 6CF3 47C4 7CD8 D33E 70A9 A3B9 1945 67EA 951D