This is the mail archive of the gdb-prs@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug fortran/17989] gdb hangs on some Fortran stack frames


https://sourceware.org/bugzilla/show_bug.cgi?id=17989

--- Comment #2 from Tom Cook <tom.k.cook at gmail dot com> ---
Here is a reproducible case, probably related to this bug.  Put the following
in test.f90:

    program test
    implicit none
    integer :: aviFail

    type TestData
       INTEGER :: i
       INTEGER, ALLOCATABLE :: j(:)
       INTEGER :: k
       INTEGER, ALLOCATABLE :: l(:)
    end type TestData

    type(TestData), allocatable :: s(:)

    allocate(s(1), STAT = aviFail)
    allocate(s(1)%j(2), STAT = aviFail)
    allocate(s(1)%l(4), STAT = aviFail)

    s(1)%k = 0

    if(s(1)%k.EQ.0) write(*, '(A)') "Hello, world."
    end program test

Build it like this:

    gfortran -o test.o -c -g -cpp -ffixed-line-length-none
-ffree-line-length-none -fcoarray=single -fno-underscoring -fPIC test.f90
    gfortran -o test -g test.o

Load the resulting executable in gdb.  Execute the 'start' command, followed by
the 'next' command four times to step through to test.f90:18.  Execute 'print
s' to show the content of the structure 's'; gdb crashes.  The stack trace from
the resulting core is pasted in below:

#0  __memcpy_sse2_unaligned () at
../sysdeps/x86_64/multiarch/memcpy-sse2-unaligned.S:36
#1  0x000000000055ecf1 in value_from_decfloat (type=type@entry=0x2d96180, 
    dec=dec@entry=0x2d1fb00 "\377\377\377\377\377\377\377\377\t\001") at
../../gdb/value.c:3545
#2  0x000000000055ed56 in value_from_contents_and_address
(type=type@entry=0x2c6d0e0, 
    valaddr=valaddr@entry=0x2d1fb00 "\377\377\377\377\377\377\377\377\t\001", 
    address=address@entry=6315920) at ../../gdb/value.c:3501
#3  0x00000000005062e7 in gdbpy_apply_val_pretty_printer (extlang=<optimised
out>, type=0x2c6d0e0, 
    valaddr=0x2d1fb00 "\377\377\377\377\377\377\377\377\t\001",
embedded_offset=<optimised out>, 
    address=<optimised out>, stream=0x2c116a0, recurse=1, val=0x2d41540,
options=0x7ffff7d9d0d0, 
    language=0x829040 <f_language_defn>) at
../../gdb/python/py-prettyprint.c:716
#4  0x00000000005b039e in apply_ext_lang_val_pretty_printer
(type=type@entry=0x2c6d0e0, 
    valaddr=valaddr@entry=0x2d1faf0 "@\300\374\367\377\177", 
    embedded_offset=embedded_offset@entry=16, address=address@entry=6315904, 
    stream=stream@entry=0x2c116a0, recurse=recurse@entry=1, val=0x2d41540,
options=0x7ffff7d9d0d0, 
    language=0x829040 <f_language_defn>) at ../../gdb/extension.c:514
#5  0x000000000057152c in val_print (type=0x2c6d0e0, 
    valaddr=valaddr@entry=0x2d1faf0 "@\300\374\367\377\177",
embedded_offset=16, 
    address=address@entry=6315904, stream=stream@entry=0x2c116a0,
recurse=recurse@entry=1, 
    val=0x2d41540, options=0x7ffff7d9d0d0, language=0x829040 <f_language_defn>)
    at ../../gdb/valprint.c:770
#6  0x0000000000670b68 in f_val_print (type=0x2c6c390, valaddr=0x2d1faf0
"@\300\374\367\377\177", 
    embedded_offset=8, address=6315904, stream=0x2c116a0, recurse=0,
original_value=0x2d41540, 
    options=0x7ffff7d9d0d0) at ../../gdb/f-valprint.c:380
#7  0x00000000005714b9 in val_print (type=0x2c6c390, 
    valaddr=valaddr@entry=0x2d1faf0 "@\300\374\367\377\177", embedded_offset=8, 
    address=address@entry=6315904, stream=stream@entry=0x2c116a0,
recurse=recurse@entry=0, 
    val=0x2d41540, options=0x7ffff7d9d300, language=0x829040 <f_language_defn>)
    at ../../gdb/valprint.c:787
#8  0x000000000067074f in f77_print_array_1 (nss=nss@entry=1,
ndimensions=ndimensions@entry=1, 
    valaddr=valaddr@entry=0x2d1faf0 "@\300\374\367\377\177", 
    embedded_offset=embedded_offset@entry=0, address=address@entry=6315904,
stream=0x2c116a0, 
    recurse=0, val=0x2d41540, options=0x7ffff7d9d300, elts=0x7ffff7d9d220,
type=0x2d92ed0)
    at ../../gdb/f-valprint.c:191
#9  0x0000000000670ad6 in f77_print_array (options=0x7ffff7d9d300,
val=0x2d41540, recurse=0, 
    stream=0x2c116a0, address=6315904, embedded_offset=0, valaddr=0x2d1faf0
"@\300\374\367\377\177", 
    type=0x2d92ed0) at ../../gdb/f-valprint.c:234
#10 f_val_print (type=0x2d92ed0, valaddr=0x2d1faf0 "@\300\374\367\377\177",
embedded_offset=0, 
    address=6315904, stream=0x2c116a0, recurse=0, original_value=0x2d41540,
options=0x7ffff7d9d300)
    at ../../gdb/f-valprint.c:281
#11 0x00000000005714b9 in val_print (type=type@entry=0x2d92ed0, 
    valaddr=0x2d1faf0 "@\300\374\367\377\177",
embedded_offset=embedded_offset@entry=0, 
    address=address@entry=6315904, stream=stream@entry=0x2c116a0,
recurse=recurse@entry=0, 
    val=0x2d41540, options=0x7ffff7d9d3a0, language=0x829040 <f_language_defn>)
    at ../../gdb/valprint.c:787
#12 0x000000000066e38c in c_value_print (val=0x2d41540, stream=0x2c116a0,
options=<optimised out>)
    at ../../gdb/c-valprint.c:584
#13 0x00000000005771d9 in print_command_1 (exp=0x2a7a192 "s",
voidprint=<optimised out>)
    at ../../gdb/printcmd.c:994
#14 0x000000000067ab76 in execute_command (p=<optimised out>, p@entry=0x2a7a190
"p s", from_tty=1)
    at ../../gdb/top.c:476
#15 0x00000000005b9505 in command_handler (command=0x2a7a190 "p s") at
../../gdb/event-top.c:494
#16 0x00000000005b9c07 in command_line_handler (rl=<optimised out>) at
../../gdb/event-top.c:692
#17 0x00000000006ca893 in rl_callback_read_char () at
../../readline/callback.c:220
#18 0x00000000005b9569 in rl_callback_read_char_wrapper (client_data=<optimised
out>)
    at ../../gdb/event-top.c:171
#19 0x00000000005b95b3 in stdin_event_handler (error=<optimised out>,
client_data=0x0)
#20 0x00000000005b84e2 in gdb_wait_for_event (block=block@entry=1) at
../../gdb/event-loop.c:772
#21 0x00000000005b8699 in gdb_do_one_event () at ../../gdb/event-loop.c:309
#22 0x00000000005b87de in start_event_loop () at ../../gdb/event-loop.c:334
#23 0x00000000005b26b3 in captured_command_loop (data=data@entry=0x0) at
../../gdb/main.c:321
#24 0x00000000005afc35 in catch_errors (func=func@entry=0x5b26a0
<captured_command_loop>, 
    func_args=func_args@entry=0x0, errstring=errstring@entry=0x7948d2 "", 
    mask=mask@entry=RETURN_MASK_ALL) at ../../gdb/exceptions.c:237
#25 0x00000000005b3196 in captured_main (data=data@entry=0x7ffff7d9d820) at
../../gdb/main.c:1149
#26 0x00000000005afc35 in catch_errors (func=func@entry=0x5b2b00
<captured_main>, 
    func_args=func_args@entry=0x7ffff7d9d820,
errstring=errstring@entry=0x7948d2 "", 
    mask=mask@entry=RETURN_MASK_ALL) at ../../gdb/exceptions.c:237
#27 0x00000000005b3a8b in gdb_main (args=args@entry=0x7ffff7d9d820) at
../../gdb/main.c:1157
#28 0x000000000045f205 in main (argc=<optimised out>, argv=<optimised out>) at
../../gdb/gdb.c:32

-- 
You are receiving this mail because:
You are on the CC list for the bug.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]