Bug 9261 - infinite loop when trying to print ada array
Summary: infinite loop when trying to print ada array
Status: RESOLVED FIXED
Alias: None
Product: gdb
Classification: Unclassified
Component: ada (show other bugs)
Version: 4.90
: P3 normal
Target Milestone: ---
Assignee: Not yet assigned to anyone
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2006-08-16 08:38 UTC by Timo Juhani Lindfors
Modified: 2019-05-03 19:30 UTC (History)
3 users (show)

See Also:
Host:
Target:
Build:
Last reconfirmed:


Attachments
gdb-ada-bug.tar.gz (58.78 KB, application/octet-stream)
, Timo Juhani Lindfors
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Timo Juhani Lindfors 2006-08-16 08:38:01 UTC
[Converted from Gnats 2156]

GDB seems to enter some sort of infinite loop when I try to print a 2D real array with "print a".

The following three lines repeat in strace output

--- SIGFPE (Floating point exception) @ 0 (0) ---
rt_sigaction(SIGFPE, {0x81105e0, [FPE], SA_RESTART}, {0x81105e0, [FPE], SA_RESTART}, 8) = 0
sigreturn()

When I attached gdb to the looping gdb process I see the following:

(gdb) bt
#0  0x080eb756 in val_print_array_elements ()
#1  0x08170efa in ada_val_print ()
#2  0x08170c2b in ada_val_print ()
#3  0x0807d9a1 in catch_exceptions_with_msg ()
#4  0x0807d820 in throw_exception ()
#5  0x0807da00 in catch_errors ()
#6  0x08170bce in ada_val_print ()
#7  0x080eab23 in val_print ()
#8  0x08171582 in ada_val_print ()
#9  0x08170c2b in ada_val_print ()
#10 0x0807d9a1 in catch_exceptions_with_msg ()
#11 0x0807d820 in throw_exception ()
#12 0x0807da00 in catch_errors ()
#13 0x08170bce in ada_val_print ()
#14 0x080eab23 in val_print ()
#15 0x081717aa in ada_value_print ()
#16 0x080eaba5 in value_print ()
#17 0x080ed6ce in print_address_demangle ()
#18 0x080ed810 in print_address_demangle ()
#19 0x080afaf9 in _initialize_cli_dump ()
#20 0x080b1b4c in cmd_func ()
#21 0x0807dd7d in execute_command ()
#22 0x0807deef in command_loop ()
#23 0x0807db01 in read_command_file ()
#24 0x080b34df in script_from_file ()
#25 0x080b3b4c in source_command ()
#26 0x0807da38 in catch_errors ()
#27 0x0807d9a1 in catch_exceptions_with_msg ()
#28 0x0807d820 in throw_exception ()
#29 0x0807da00 in catch_errors ()
#30 0x0807da8b in catch_command_errors ()
#31 0x080752a4 in main ()
(gdb) c
Continuing.

Program received signal SIGSTOP, Stopped (signal).
0x080eb756 in val_print_array_elements ()

Release:
GNU gdb 6.4.90-debian

Environment:
Linux apps1 2.6.8met2 #1 Wed Dec 7 14:06:52 EET 2005 i686 GNU/Linux
gcc version 3.3.5 (Debian 1:3.3.5-13)
i486-linux-gnu

How-To-Repeat:
Steps to reproduce (required files attached):
1) gcc-3.3 -c -g -O0 testfits.adb
2) gcc-3.3 -c -g -O0 fitg5.adb
3) gcc-3.3 -c -g -O0 real_types.ads
4) gnatbind -x testfits.ali
5) gnatlink -g testfits.ali
6) gdb ./testfits
7) Type "b fitg5"
8) Type "r"
9) Type "print a"

Expected results:
9) gdb prints contents of the float array named "a"

Actual results:
9) gdb prints "$1 = (0" and doesn't show anything after this, not even the "(gdb)" prompt.

Note that the bug does not occur if I compile the binary using gcc 4.1.

Please let me know if you can't reproduce this bug.
Comment 1 Dave Vitek 2011-10-13 22:36:34 UTC
See bug 13294, which might be a duplicate of this bug.  It contains a minimal C test case that can reproduce the behavior described here.
Comment 2 Tom Tromey 2019-05-03 19:30:36 UTC
I tried this today with a recent version of gdb, and it worked ok;
so I am closing this.