Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Jan Kratochvil <jan.kratochvil@redhat.com>
To: Keven Boell <keven.boell@intel.com>
Cc: gdb-patches@sourceware.org, sanimir.agovic@intel.com
Subject: Crash regression(?) printing Fortran strings in bt  [Re: [V2 00/23] Fortran dynamic array support]
Date: Tue, 29 Jul 2014 19:35:00 -0000	[thread overview]
Message-ID: <20140729183023.GA17443@host2.jankratochvil.net> (raw)
In-Reply-To: <1405070495-6948-1-git-send-email-keven.boell@intel.com>

[-- Attachment #1: Type: text/plain, Size: 3572 bytes --]

Hi Keven,

I hope you get it reproducible this time.

With your patchset ( 511bff520372ffc10fa2ff569c176bdf1e6e475d ) and after
applying IMO harmless patch:
	[patch] Display Fortran strings in backtraces
	https://sourceware.org/ml/gdb-patches/2014-07/msg00709.html

I get a crash on 32-bit host (not on x86_64 and neither on x86_64 debugging
32-bit target built with -m32).  Tested Fedora 21pre and Fedora Rawhide.

It happens only for the testcase gdb.fortran/dynamic-other-frame.exp which
comes from the original archer/jankratochvil/vla branch, attaching it.
	Running gdb/testsuite/gdb.fortran/dynamic-other-frame.exp ...
	ERROR: Process no longer exists
	UNRESOLVED: gdb.fortran/dynamic-other-frame.exp: bt

runtest gdb.fortran/dynamic-other-frame.exp
gdb -ex r --args ../gdb gdb.fortran/dynamic-other-frame -ex 'b bar_' -ex r -ex bt
------------------------------------------------------------------------------
Breakpoint 1, 0x080485cf in bar_ ()
#0  0x080485cf in bar_ ()

Program received signal SIGSEGV, Segmentation fault.
0x0830d943 in extract_unsigned_integer (addr=0x1350a697 <error: Cannot access memory at address 0x1350a697>, len=1, byte_order=BFD_ENDIAN_LITTLE) at findvar.c:110
110		retval = (retval << 8) | *p;
(gdb) bt
#0  0x0830d943 in extract_unsigned_integer (addr=0x1350a697 <error: Cannot access memory at address 0x1350a697>, len=1, byte_order=BFD_ENDIAN_LITTLE) at findvar.c:110
#1  0x0833bc5a in generic_printstr (stream=0x9b0e058, type=0x98725c8, string=0x9a29d78 "", length=162400544, encoding=0x97a0c18 "UTF-8", force_ellipses=0, quote_char=34, c_style_terminator=1, options=0xffffc400) at valprint.c:2436
#2  0x0843ac0c in c_printstr (stream=0x9b0e058, type=0x98725c8, string=0x9a29d78 "", length=162400544, user_encoding=0x0, force_ellipses=0, options=0xffffc400) at c-lang.c:220
#3  0x0846bb3c in f_val_print (type=0x9ae0940, valaddr=0x9a29d78 "", embedded_offset=0, address=134514304, stream=0x9b0e058, recurse=2, original_value=0x9a29d10, options=0xffffc400) at f-valprint.c:238
#4  0x083389da in val_print (type=0x9ae0940, valaddr=0x9a29d78 "", embedded_offset=0, address=134514304, stream=0x9b0e058, recurse=2, val=0x9a29d10, options=0xffffc520, language=0x8c25c00 <f_language_defn>) at valprint.c:813
#5  0x08338cd1 in common_val_print (val=0x9a29d10, stream=0x9b0e058, recurse=2, options=0xffffc520, language=0x8c25c00 <f_language_defn>) at valprint.c:900
#6  0x08378647 in print_frame_arg (arg=0xffffc5d4) at stack.c:289
#7  0x0837916a in print_frame_args (func=0x9ae0a20, frame=0x97c307c, num=-1, stream=0x9839440) at stack.c:674
#8  0x0837a1fd in print_frame (frame=0x97c307c, print_level=1, print_what=LOCATION, print_args=1, sal=...) at stack.c:1205
#9  0x08379708 in print_frame_info (frame=0x97c307c, print_level=1, print_what=LOCATION, print_args=1, set_current_sal=0) at stack.c:857
#10 0x0837b935 in backtrace_command_1 (count_exp=0x0, show_locals=0, no_filters=0, from_tty=1) at stack.c:1817
#11 0x0837bcf7 in backtrace_command (arg=0x0, from_tty=1) at stack.c:1914
------------------------------------------------------------------------------

It is a bit interesting this way no crash happens:
------------------------------------------------------------------------------
../gdb gdb.fortran/dynamic-other-frame -ex 'b bar_' -ex r -ex up
Breakpoint 1, 0x080485cf in bar_ ()
#1  0x08048566 in foo (string='hello', _string=5) at ./gdb.fortran/dynamic-other-frame.f90:27
27	  call bar                                ! stop-here
------------------------------------------------------------------------------


Thanks,
Jan

[-- Attachment #2: dynamic-other-frame.patch --]
[-- Type: text/plain, Size: 4762 bytes --]

Index: gdb-7.7.90.20140613/gdb/testsuite/gdb.fortran/dynamic-other-frame-stub.f90
===================================================================
--- /dev/null	1970-01-01 00:00:00.000000000 +0000
+++ gdb-7.7.90.20140613/gdb/testsuite/gdb.fortran/dynamic-other-frame-stub.f90	2014-06-16 23:30:30.113940488 +0200
@@ -0,0 +1,24 @@
+! Copyright 2010 Free Software Foundation, Inc.
+!
+! This program is free software; you can redistribute it and/or modify
+! it under the terms of the GNU General Public License as published by
+! the Free Software Foundation; either version 2 of the License, or
+! (at your option) any later version.
+!
+! This program is distributed in the hope that it will be useful,
+! but WITHOUT ANY WARRANTY; without even the implied warranty of
+! MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+! GNU General Public License for more details.
+!
+! You should have received a copy of the GNU General Public License
+! along with this program; if not, write to the Free Software
+! Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+!
+! Ihis file is the Fortran source file for dynamic.exp.
+! Original file written by Jakub Jelinek <jakub@redhat.com>.
+! Modified for the GDB testcase by Jan Kratochvil <jan.kratochvil@redhat.com>.
+
+subroutine bar
+  real :: dummy
+  dummy = 1
+end subroutine bar
Index: gdb-7.7.90.20140613/gdb/testsuite/gdb.fortran/dynamic-other-frame.exp
===================================================================
--- /dev/null	1970-01-01 00:00:00.000000000 +0000
+++ gdb-7.7.90.20140613/gdb/testsuite/gdb.fortran/dynamic-other-frame.exp	2014-06-16 23:30:30.113940488 +0200
@@ -0,0 +1,37 @@
+# Copyright 2010 Free Software Foundation, Inc.
+
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+# 
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+# 
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  
+
+set testfile "dynamic-other-frame"
+set srcfile1 ${testfile}.f90
+set srcfile2 ${testfile}-stub.f90
+set objfile2 [standard_output_file ${testfile}-stub.o]
+set executable ${testfile}
+set binfile [standard_output_file ${executable}]
+
+if { [gdb_compile "${srcdir}/${subdir}/${srcfile2}" "${objfile2}" object {f90}] != ""
+     || [gdb_compile "${srcdir}/${subdir}/${srcfile1} ${objfile2}" "${binfile}" executable {debug f90}] != "" } {
+    untested "Couldn't compile ${srcfile1} or ${srcfile2}"
+    return -1
+}
+
+clean_restart ${executable}
+
+if ![runto bar_] then {
+    perror "couldn't run to bar_"
+    continue
+}
+
+gdb_test "bt" {foo \(string='hello'.*}
Index: gdb-7.7.90.20140613/gdb/testsuite/gdb.fortran/dynamic-other-frame.f90
===================================================================
--- /dev/null	1970-01-01 00:00:00.000000000 +0000
+++ gdb-7.7.90.20140613/gdb/testsuite/gdb.fortran/dynamic-other-frame.f90	2014-06-16 23:30:30.113940488 +0200
@@ -0,0 +1,36 @@
+! Copyright 2010 Free Software Foundation, Inc.
+!
+! This program is free software; you can redistribute it and/or modify
+! it under the terms of the GNU General Public License as published by
+! the Free Software Foundation; either version 2 of the License, or
+! (at your option) any later version.
+!
+! This program is distributed in the hope that it will be useful,
+! but WITHOUT ANY WARRANTY; without even the implied warranty of
+! MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+! GNU General Public License for more details.
+!
+! You should have received a copy of the GNU General Public License
+! along with this program; if not, write to the Free Software
+! Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+!
+! Ihis file is the Fortran source file for dynamic.exp.
+! Original file written by Jakub Jelinek <jakub@redhat.com>.
+! Modified for the GDB testcase by Jan Kratochvil <jan.kratochvil@redhat.com>.
+
+subroutine foo (string)
+  interface
+    subroutine bar
+    end subroutine
+  end interface
+  character string*(*)
+  call bar                                ! stop-here
+end subroutine foo
+program test
+  interface
+    subroutine foo (string)
+    character string*(*)
+    end subroutine
+  end interface
+  call foo ('hello')
+end

  parent reply	other threads:[~2014-07-29 19:04 UTC|newest]

Thread overview: 51+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-07-11  9:21 [V2 00/23] Fortran dynamic array support Keven Boell
2014-07-11  9:21 ` [V2 19/23] test: accessing dynamic array history values Keven Boell
2014-07-11  9:21 ` [V2 12/23] vla: add NEWS entry for dynamic array support Keven Boell
2014-07-11  9:58   ` Eli Zaretskii
2014-07-11  9:21 ` [V2 21/23] test: basic MI test for the " Keven Boell
2014-07-11  9:21 ` [V2 09/23] vla: changed string length semantic Keven Boell
2014-07-18 15:38   ` Jan Kratochvil
2014-07-21 13:23     ` Keven Boell
2014-07-21 19:54       ` Jan Kratochvil
2014-07-22 15:27         ` Keven Boell
2014-07-11  9:21 ` [V2 08/23] vla: get dynamic array corner cases to work Keven Boell
2014-07-11  9:21 ` [V2 16/23] test: correct ptype of dynamic arrays in Fortran Keven Boell
2014-07-11  9:21 ` [V2 01/23] dwarf: add dwarf3 DW_OP_push_object_address opcode Keven Boell
2014-07-11  9:21 ` [V2 05/23] vla: make field selection work with vla Keven Boell
2014-07-11  9:22 ` [V2 04/23] vla: make dynamic fortran arrays functional Keven Boell
2014-07-11  9:22 ` [V2 06/23] vla: reconstruct value to compute bounds of target type Keven Boell
2014-07-11  9:22 ` [V2 14/23] test: evaluate dynamic arrays using Fortran primitives Keven Boell
2014-07-11  9:22 ` [V2 02/23] dwarf: add DW_AT_data_location support Keven Boell
2014-07-11  9:22 ` [V2 23/23] test: stride support for dynamic arrays Keven Boell
2014-07-11  9:22 ` [V2 03/23] vla: introduce allocated/associated flags Keven Boell
2014-07-11  9:22 ` [V2 13/23] test: basic tests for dynamic array evaluations in Fortran Keven Boell
2014-07-11  9:22 ` [V2 18/23] test: dynamic arrays passed to functions Keven Boell
2014-07-11  9:22 ` [V2 07/23] vla: use value constructor instead of raw-buffer manipulation Keven Boell
2014-07-11  9:22 ` [V2 20/23] test: dynamic string evaluations Keven Boell
2014-07-11  9:22 ` [V2 17/23] test: evaluating allocation/association status Keven Boell
2014-07-11  9:22 ` [V2 11/23] vla: add stride support to fortran arrays Keven Boell
2014-07-11  9:22 ` [V2 22/23] test: test sizeof for dynamic " Keven Boell
2014-07-11  9:22 ` [V2 15/23] test: dynamic arrays passed to subroutines Keven Boell
2014-08-01 20:11   ` Jan Kratochvil
2014-08-07  6:58     ` Keven Boell
2014-08-12  6:56       ` Keven Boell
2014-07-11  9:28 ` [V2 10/23] vla: get Fortran dynamic strings working Keven Boell
2014-07-11 16:23 ` [V2 00/23] Fortran dynamic array support Jan Kratochvil
2014-07-16 16:19   ` Keven Boell
2014-07-16 16:33     ` Jan Kratochvil
2014-07-18 12:33       ` Keven Boell
2014-07-18 15:19         ` Jan Kratochvil
2014-07-29 19:35 ` Jan Kratochvil [this message]
2014-07-29 20:51   ` Crash regression(?) printing Fortran strings in bt [Re: [V2 00/23] Fortran dynamic array support] Jan Kratochvil
2014-08-01  7:20     ` Keven Boell
2014-08-01  7:22       ` Jan Kratochvil
2014-08-01 21:02       ` [patch 1/2] " Jan Kratochvil
2014-08-12  6:56         ` Keven Boell
2014-08-12 21:55           ` Jan Kratochvil
2014-08-14 20:03             ` Jan Kratochvil
2014-08-20 14:09               ` Keven Boell
2014-08-20 18:24                 ` Jan Kratochvil
2014-08-21  7:27                   ` Keven Boell
2014-08-21 14:29                     ` Jan Kratochvil
2014-08-22  7:20                     ` Jan Kratochvil
2014-08-01 21:05   ` [patch 2/2] " Jan Kratochvil

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=20140729183023.GA17443@host2.jankratochvil.net \
    --to=jan.kratochvil@redhat.com \
    --cc=gdb-patches@sourceware.org \
    --cc=keven.boell@intel.com \
    --cc=sanimir.agovic@intel.com \
    /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