public inbox for gdb-prs@sourceware.org
help / color / mirror / Atom feed
* [Bug gdb/27962] New: Internal error when using binary from gdb.dwarf2/arr-stride.exp
@ 2021-06-07 19:35 simark at simark dot ca
  2021-06-07 19:38 ` [Bug gdb/27962] " simark at simark dot ca
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: simark at simark dot ca @ 2021-06-07 19:35 UTC (permalink / raw)
  To: gdb-prs

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

            Bug ID: 27962
           Summary: Internal error when using binary from
                    gdb.dwarf2/arr-stride.exp
           Product: gdb
           Version: HEAD
            Status: NEW
          Severity: normal
          Priority: P2
         Component: gdb
          Assignee: unassigned at sourceware dot org
          Reporter: simark at simark dot ca
  Target Milestone: ---

I stumbled on this a bit randomly while trying to reproduce a failure.  With
the binary from gdb.dwarf2/arr-stride.exp, with current master:

$ ./gdb -nx -q --data-directory=data-directory
testsuite/outputs/gdb.dwarf2/arr-stride/arr-stride  -ex "print the_struct"
Reading symbols from testsuite/outputs/gdb.dwarf2/arr-stride/arr-stride...
$1 = {intfield = 1, arrayfield = {
/home/simark/src/binutils-gdb/gdb/value.c:851: internal-error: bool
value_contents_bits_eq(const value*, int, const value*, int, int): Assertion
`offset2 + length <= TYPE_LENGTH (val2->enclosing_type) * TARGET_CHAR_BIT'
failed.
A problem internal to GDB has been detected,
further debugging may prove unreliable.
Quit this debugging session? (y or n) 



(top-gdb) p offset2
$1 = 32
(top-gdb) p length
$2 = 32
(top-gdb) p TYPE_LENGTH (val2->enclosing_type)
$3 = 4
(top-gdb) p TARGET_CHAR_BIT
$4 = 8

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

^ permalink raw reply	[flat|nested] 5+ messages in thread

* [Bug gdb/27962] Internal error when using binary from gdb.dwarf2/arr-stride.exp
  2021-06-07 19:35 [Bug gdb/27962] New: Internal error when using binary from gdb.dwarf2/arr-stride.exp simark at simark dot ca
@ 2021-06-07 19:38 ` simark at simark dot ca
  2021-06-07 20:37 ` tromey at sourceware dot org
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 5+ messages in thread
From: simark at simark dot ca @ 2021-06-07 19:38 UTC (permalink / raw)
  To: gdb-prs

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

--- Comment #1 from Simon Marchi <simark at simark dot ca> ---
If I use `-ex "set language ada"` before the print, as the test does, I don't
hit an internal error.

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

^ permalink raw reply	[flat|nested] 5+ messages in thread

* [Bug gdb/27962] Internal error when using binary from gdb.dwarf2/arr-stride.exp
  2021-06-07 19:35 [Bug gdb/27962] New: Internal error when using binary from gdb.dwarf2/arr-stride.exp simark at simark dot ca
  2021-06-07 19:38 ` [Bug gdb/27962] " simark at simark dot ca
@ 2021-06-07 20:37 ` tromey at sourceware dot org
  2021-06-08 21:33 ` simark at simark dot ca
  2021-06-08 23:07 ` tromey at sourceware dot org
  3 siblings, 0 replies; 5+ messages in thread
From: tromey at sourceware dot org @ 2021-06-07 20:37 UTC (permalink / raw)
  To: gdb-prs

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

Tom Tromey <tromey at sourceware dot org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |tromey at sourceware dot org

--- Comment #2 from Tom Tromey <tromey at sourceware dot org> ---
At first I thought this was because we're trying to print
an optimized-out array.  And, that still seems weird, maybe
common_val_print and common_val_print_checked should be merged

However, it's also the case that this array has a bit stride of 6.
So, this may just be a missing feature in value_print_array_elements.

I'm not sure how important this is.  Arrays like this can't be
created in most languages that gdb supports.  OTOH, it should be
safe to print a value, regardless of the current language.

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

^ permalink raw reply	[flat|nested] 5+ messages in thread

* [Bug gdb/27962] Internal error when using binary from gdb.dwarf2/arr-stride.exp
  2021-06-07 19:35 [Bug gdb/27962] New: Internal error when using binary from gdb.dwarf2/arr-stride.exp simark at simark dot ca
  2021-06-07 19:38 ` [Bug gdb/27962] " simark at simark dot ca
  2021-06-07 20:37 ` tromey at sourceware dot org
@ 2021-06-08 21:33 ` simark at simark dot ca
  2021-06-08 23:07 ` tromey at sourceware dot org
  3 siblings, 0 replies; 5+ messages in thread
From: simark at simark dot ca @ 2021-06-08 21:33 UTC (permalink / raw)
  To: gdb-prs

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

--- Comment #3 from Simon Marchi <simark at simark dot ca> ---
I don't have enough context nor time to dig into it.  But yeah, any way to
trigger an internal error can be considered a bug.  So if there's just no sane
way of printing the value for languages other than Ada, then at least erroring
out would be better than an internal error.

But why is it needed to set the language explicitly, given that the CU
provides:

  DW_AT_language @DW_LANG_Ada95

?

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

^ permalink raw reply	[flat|nested] 5+ messages in thread

* [Bug gdb/27962] Internal error when using binary from gdb.dwarf2/arr-stride.exp
  2021-06-07 19:35 [Bug gdb/27962] New: Internal error when using binary from gdb.dwarf2/arr-stride.exp simark at simark dot ca
                   ` (2 preceding siblings ...)
  2021-06-08 21:33 ` simark at simark dot ca
@ 2021-06-08 23:07 ` tromey at sourceware dot org
  3 siblings, 0 replies; 5+ messages in thread
From: tromey at sourceware dot org @ 2021-06-08 23:07 UTC (permalink / raw)
  To: gdb-prs

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

--- Comment #4 from Tom Tromey <tromey at sourceware dot org> ---
(In reply to Simon Marchi from comment #3)

> But why is it needed to set the language explicitly, given that the CU
> provides:
> 
>   DW_AT_language @DW_LANG_Ada95
> 
> ?

The program's "main" isn't given a language.

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

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2021-06-08 23:07 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-06-07 19:35 [Bug gdb/27962] New: Internal error when using binary from gdb.dwarf2/arr-stride.exp simark at simark dot ca
2021-06-07 19:38 ` [Bug gdb/27962] " simark at simark dot ca
2021-06-07 20:37 ` tromey at sourceware dot org
2021-06-08 21:33 ` simark at simark dot ca
2021-06-08 23:07 ` tromey at sourceware dot org

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).