public inbox for gdb-prs@sourceware.org
help / color / mirror / Atom feed
From: "vries at gcc dot gnu.org" <sourceware-bugzilla@sourceware.org>
To: gdb-prs@sourceware.org
Subject: [Bug ada/28323] segfault in ada_is_unconstrained_packed_array_type
Date: Thu, 09 Sep 2021 14:33:01 +0000	[thread overview]
Message-ID: <bug-28323-4717-1XYE3jKyEq@http.sourceware.org/bugzilla/> (raw)
In-Reply-To: <bug-28323-4717@http.sourceware.org/bugzilla/>

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

--- Comment #1 from Tom de Vries <vries at gcc dot gnu.org> ---
Reproduce:
...
$ cat gdb.in
interpreter-exec mi "100-gdb-set height 0"
interpreter-exec mi "101-gdb-set width 0"
show mi-async
interpreter-exec mi "104-environment-directory -r"
interpreter-exec mi "105-environment-directory
/home/vries/gdb_versions/devel/src/gdb/testsuite/gdb.ada"
interpreter-exec mi "105-file-exec-and-symbols
/home/vries/gdb_versions/devel/foo"
interpreter-exec mi "200-break-insert --qualified -t main"
interpreter-exec mi "220-exec-run"
interpreter-exec mi "-break-insert -t foo.adb:22"
interpreter-exec mi "-exec-continue"
interpreter-exec mi "-var-create bt * bt"
interpreter-exec mi "-var-update 1 *"
$ gdb.sh -q -batch -x gdb.in
...
[ note: with foo copied out of build tree, not relevant to reproducing though ]

Problem is here:
...
Thread 1 "gdb" received signal SIGSEGV, Segmentation fault.
0x0000000000450861 in ada_is_unconstrained_packed_array_type (type=0x25163f0)
    at /home/vries/gdb_versions/devel/src/gdb/ada-lang.c:1978
1978          return TYPE_FIELD_BITSIZE (type, 0) > 0;
(gdb) p *type
$2 = {pointer_type = 0x2ae4e20, reference_type = 0x0, rvalue_reference_type =
0x0, 
  chain = 0x25163f0, align_log2 = 0, m_instance_flags = 0, length = 0,
main_type = 0x2ae4900}
(gdb) p type.main_type->flds_bnds.fields
$4 = (field *) 0x0
...

Type in more detail:
...
(gdb) p *type.main_type
$3 = {code = TYPE_CODE_TYPEDEF, m_flag_unsigned = 0, m_flag_nosign = 0,
m_flag_stub = 0, 
  m_flag_target_stub = 1, m_flag_prototyped = 0, m_flag_varargs = 0,
m_flag_vector = 0, 
  m_flag_stub_supported = 0, m_flag_gnu_ifunc = 0, m_flag_fixed_instance = 0, 
  m_flag_objfile_owned = 1, m_flag_endianity_not_default = 0,
m_flag_declared_class = 0, 
  m_flag_flag_enum = 0, type_specific_field = TYPE_SPECIFIC_GNAT_STUFF, nfields
= 0, 
  name = 0x7fffec9733a2 "pck__bounded___XUA", m_owner = {objfile = 0x1b4e6f0,
gdbarch = 
    0x1b4e6f0}, target_type = 0x2ae4b80, flds_bnds = {fields = 0x0, bounds =
0x0, 
    complex_type = 0x0}, type_specific = {cplus_stuff = 0xf2e9c8
<gnat_aux_default>, 
    gnat_stuff = 0xf2e9c8 <gnat_aux_default>, floatformat = 0xf2e9c8
<gnat_aux_default>, 
    func_stuff = 0xf2e9c8 <gnat_aux_default>, self_type = 0xf2e9c8
<gnat_aux_default>, 
    fixed_point_info = 0xf2e9c8 <gnat_aux_default>, int_stuff = {bit_size =
59848, 
      bit_offset = 242}}, dyn_prop_list = 0x0}
...

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

  reply	other threads:[~2021-09-09 14:33 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-09-09 14:10 [Bug ada/28323] New: " vries at gcc dot gnu.org
2021-09-09 14:33 ` vries at gcc dot gnu.org [this message]
2021-09-09 14:53 ` [Bug ada/28323] " vries at gcc dot gnu.org
2021-09-09 14:59 ` vries at gcc dot gnu.org
2021-12-06 12:14 ` vries at gcc dot gnu.org
2021-12-07  6:36 ` vries at gcc dot gnu.org

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=bug-28323-4717-1XYE3jKyEq@http.sourceware.org/bugzilla/ \
    --to=sourceware-bugzilla@sourceware.org \
    --cc=gdb-prs@sourceware.org \
    /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;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).