public inbox for gdb-prs@sourceware.org
help / color / mirror / Atom feed
* [Bug gdb/30340] New: gdb.base/watchpoint-unaligned.exp produces TCL error
@ 2023-04-12 20:57 ahajkova at redhat dot com
  2023-04-13  7:47 ` [Bug gdb/30340] " luis.machado at arm dot com
                   ` (36 more replies)
  0 siblings, 37 replies; 38+ messages in thread
From: ahajkova at redhat dot com @ 2023-04-12 20:57 UTC (permalink / raw)
  To: gdb-prs

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

            Bug ID: 30340
           Summary: gdb.base/watchpoint-unaligned.exp produces TCL error
           Product: gdb
           Version: HEAD
            Status: NEW
          Severity: normal
          Priority: P2
         Component: gdb
          Assignee: unassigned at sourceware dot org
          Reporter: ahajkova at redhat dot com
  Target Milestone: ---

Created attachment 14818
  --> https://sourceware.org/bugzilla/attachment.cgi?id=14818&action=edit
patch

When running gdb.base/watchpoint-unaligned.exp at aarch64 - Ampere Altra with
Fedora 39:

I'm getting TCL error:
root/build/gdb/gdb version  14.0.50.20230411-git -nw -nx -q -iex "set height 0"
-iex "set width 0" -data-directory /root/build/gdb/data-directory 

ERROR: -------------------------------------------
ERROR: in testcase
/root/build/gdb/testsuite/../../../binutils-gdb/gdb/testsuite/gdb.base/watchpoint-unaligned.exp
ERROR:  can't read "wpoffset_to_wpnum(1)": no such element in array
ERROR:  tcl error code TCL READ VARNAME
ERROR:  tcl error info:
can't read "wpoffset_to_wpnum(1)": no such element in array
    while executing
"list -re "\r\nCould not insert hardware watchpoint .*\r\n$gdb_prompt $" {     
}       -re "$rwatch_exp $wpoffset_to_wpnum(1):.*alue = .*\r\n$gdb_prompt $" { 
..."
    ("uplevel" body line 1)
    invoked from within
"uplevel list $subst_code"
    (procedure "gdb_test_multiple" line 77)
    invoked from within
"gdb_test_multiple $test $test {
        -re "\r\nCould not insert hardware watchpoint .*\r\n$gdb_prompt $" {
        }
        -re "$rwatch_exp $wpoffset_to_wpnum(1):.*alu..."
    ("foreach" body line 24)
    invoked from within
"foreach wpcount {4 7} {
    array set wpoffset_to_wpnum {}
    for {set wpoffset 1} {$wpoffset <= $wpcount} {incr wpoffset} {
        set test "$rwatch data...."
    (file
"/root/build/gdb/testsuite/../../../binutils-gdb/gdb/testsuite/gdb.base/watchpoint-unaligned.exp"
line 101)
    invoked from within
"source
/root/build/gdb/testsuite/../../../binutils-gdb/gdb/testsuite/gdb.base/watchpoint-unaligned.exp"
    ("uplevel" body line 1)
    invoked from within
"uplevel #0 source
/root/build/gdb/testsuite/../../../binutils-gdb/gdb/testsuite/gdb.base/watchpoint-unaligned.exp"
    invoked from within
"catch "uplevel #0 source $test_file_name" msg"
--------------------------------------------------
                === gdb Summary ===

# of expected passes            142
# of unexpected failures        537
# of unresolved testcases       1
# of paths in test names        1
# of duplicate test names       16
/root/build/gdb/gdb version  14.0.50.20230411-git -nw -nx -q -iex "set height
0" -iex "set width 0" -data-directory /root/build/gdb/data-directory 

ERROR: -------------------------------------------
ERROR: in testcase
/root/build/gdb/testsuite/../../../binutils-gdb/gdb/testsuite/gdb.base/watchpoint-unaligned.exp
ERROR:  can't read "wpoffset_to_wpnum(1)": no such element in array
ERROR:  tcl error code TCL READ VARNAME
ERROR:  tcl error info:
can't read "wpoffset_to_wpnum(1)": no such element in array
    while executing
"list -re "\r\nCould not insert hardware watchpoint .*\r\n$gdb_prompt $" {     
}       -re "$rwatch_exp $wpoffset_to_wpnum(1):.*alue = .*\r\n$gdb_prompt $" { 
..."
    ("uplevel" body line 1)
    invoked from within
"uplevel list $subst_code"
    (procedure "gdb_test_multiple" line 77)
    invoked from within
"gdb_test_multiple $test $test {
        -re "\r\nCould not insert hardware watchpoint .*\r\n$gdb_prompt $" {
        }
        -re "$rwatch_exp $wpoffset_to_wpnum(1):.*alu..."
    ("foreach" body line 24)
    invoked from within
"foreach wpcount {4 7} {
    array set wpoffset_to_wpnum {}
    for {set wpoffset 1} {$wpoffset <= $wpcount} {incr wpoffset} {
        set test "$rwatch data...."
    (file
"/root/build/gdb/testsuite/../../../binutils-gdb/gdb/testsuite/gdb.base/watchpoint-unaligned.exp"
line 101)
    invoked from within
"source
/root/build/gdb/testsuite/../../../binutils-gdb/gdb/testsuite/gdb.base/watchpoint-unaligned.exp"
    ("uplevel" body line 1)
    invoked from within
"uplevel #0 source
/root/build/gdb/testsuite/../../../binutils-gdb/gdb/testsuite/gdb.base/watchpoint-unaligned.exp"
    invoked from within
"catch "uplevel #0 source $test_file_name" msg"
--------------------------------------------------
make[2]: *** [Makefile:226: do-check-single] Error 1

Attached patch fixes the TCL problem for me - but the test itself still fails:
                === gdb Summary ===

# of expected passes            142
# of unexpected failures        546
# of known failures             1
# of duplicate test names       16

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

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

* [Bug gdb/30340] gdb.base/watchpoint-unaligned.exp produces TCL error
  2023-04-12 20:57 [Bug gdb/30340] New: gdb.base/watchpoint-unaligned.exp produces TCL error ahajkova at redhat dot com
@ 2023-04-13  7:47 ` luis.machado at arm dot com
  2023-04-13 13:28 ` luis.machado at arm dot com
                   ` (35 subsequent siblings)
  36 siblings, 0 replies; 38+ messages in thread
From: luis.machado at arm dot com @ 2023-04-13  7:47 UTC (permalink / raw)
  To: gdb-prs

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

Luis Machado <luis.machado at arm dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |luis.machado at arm dot com

--- Comment #1 from Luis Machado <luis.machado at arm dot com> ---
I think what you want is to check for any warnings/errors when attempting to
create hardware watchpoints/breakpoints and then fail and abort testing.

For example, gdb emits these warnings:

warning: Unable to determine the number of hardware watchpoints available.
warning: Unable to determine the number of hardware breakpoints available.

They should be an indication something is off, and there is no point resuming
testing in that case.

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

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

* [Bug gdb/30340] gdb.base/watchpoint-unaligned.exp produces TCL error
  2023-04-12 20:57 [Bug gdb/30340] New: gdb.base/watchpoint-unaligned.exp produces TCL error ahajkova at redhat dot com
  2023-04-13  7:47 ` [Bug gdb/30340] " luis.machado at arm dot com
@ 2023-04-13 13:28 ` luis.machado at arm dot com
  2023-04-13 13:52 ` ahajkova at redhat dot com
                   ` (34 subsequent siblings)
  36 siblings, 0 replies; 38+ messages in thread
From: luis.machado at arm dot com @ 2023-04-13 13:28 UTC (permalink / raw)
  To: gdb-prs

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

Luis Machado <luis.machado at arm dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |WAITING

--- Comment #2 from Luis Machado <luis.machado at arm dot com> ---
Hi,

Could you please give the following a try and upload the output?

- Run gdb.base/watchpoint-unaligned.exp once
- Run strace ./gdb/gdb --batch
gdb/testsuite/outputs/gdb.base/watchpoint-unaligned/watchpoint-unaligned -ex
"start" -ex "quit"

I'm suspicious ptrace is failing for some reason. Altra's are supposed to
implement armv8.2, so we have that covered in compatible_debug_arch.

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

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

* [Bug gdb/30340] gdb.base/watchpoint-unaligned.exp produces TCL error
  2023-04-12 20:57 [Bug gdb/30340] New: gdb.base/watchpoint-unaligned.exp produces TCL error ahajkova at redhat dot com
  2023-04-13  7:47 ` [Bug gdb/30340] " luis.machado at arm dot com
  2023-04-13 13:28 ` luis.machado at arm dot com
@ 2023-04-13 13:52 ` ahajkova at redhat dot com
  2023-04-13 14:01 ` luis.machado at arm dot com
                   ` (33 subsequent siblings)
  36 siblings, 0 replies; 38+ messages in thread
From: ahajkova at redhat dot com @ 2023-04-13 13:52 UTC (permalink / raw)
  To: gdb-prs

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

--- Comment #3 from Alexandra Hájková <ahajkova at redhat dot com> ---
Created attachment 14821
  --> https://sourceware.org/bugzilla/attachment.cgi?id=14821&action=edit
strace log

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

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

* [Bug gdb/30340] gdb.base/watchpoint-unaligned.exp produces TCL error
  2023-04-12 20:57 [Bug gdb/30340] New: gdb.base/watchpoint-unaligned.exp produces TCL error ahajkova at redhat dot com
                   ` (2 preceding siblings ...)
  2023-04-13 13:52 ` ahajkova at redhat dot com
@ 2023-04-13 14:01 ` luis.machado at arm dot com
  2023-04-13 17:39 ` ahajkova at redhat dot com
                   ` (32 subsequent siblings)
  36 siblings, 0 replies; 38+ messages in thread
From: luis.machado at arm dot com @ 2023-04-13 14:01 UTC (permalink / raw)
  To: gdb-prs

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

--- Comment #4 from Luis Machado <luis.machado at arm dot com> ---
I think you are missing the testcase executable:

write(2, "No symbol table loaded.  Use the"..., 48No symbol table loaded.  Use
the "file" command.) = 48

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

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

* [Bug gdb/30340] gdb.base/watchpoint-unaligned.exp produces TCL error
  2023-04-12 20:57 [Bug gdb/30340] New: gdb.base/watchpoint-unaligned.exp produces TCL error ahajkova at redhat dot com
                   ` (3 preceding siblings ...)
  2023-04-13 14:01 ` luis.machado at arm dot com
@ 2023-04-13 17:39 ` ahajkova at redhat dot com
  2023-04-13 17:39 ` ahajkova at redhat dot com
                   ` (31 subsequent siblings)
  36 siblings, 0 replies; 38+ messages in thread
From: ahajkova at redhat dot com @ 2023-04-13 17:39 UTC (permalink / raw)
  To: gdb-prs

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

--- Comment #5 from Alexandra Hájková <ahajkova at redhat dot com> ---
(In reply to Luis Machado from comment #4)
> I think you are missing the testcase executable:
> 
> write(2, "No symbol table loaded.  Use the"..., 48No symbol table loaded. 
> Use the "file" command.) = 48

you're right, sorry, attaching the new log

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

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

* [Bug gdb/30340] gdb.base/watchpoint-unaligned.exp produces TCL error
  2023-04-12 20:57 [Bug gdb/30340] New: gdb.base/watchpoint-unaligned.exp produces TCL error ahajkova at redhat dot com
                   ` (4 preceding siblings ...)
  2023-04-13 17:39 ` ahajkova at redhat dot com
@ 2023-04-13 17:39 ` ahajkova at redhat dot com
  2023-04-13 17:41 ` ahajkova at redhat dot com
                   ` (30 subsequent siblings)
  36 siblings, 0 replies; 38+ messages in thread
From: ahajkova at redhat dot com @ 2023-04-13 17:39 UTC (permalink / raw)
  To: gdb-prs

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

--- Comment #6 from Alexandra Hájková <ahajkova at redhat dot com> ---
(In reply to Luis Machado from comment #4)
> I think you are missing the testcase executable:
> 
> write(2, "No symbol table loaded.  Use the"..., 48No symbol table loaded. 
> Use the "file" command.) = 48

you're right, sorry, attaching the new log

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

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

* [Bug gdb/30340] gdb.base/watchpoint-unaligned.exp produces TCL error
  2023-04-12 20:57 [Bug gdb/30340] New: gdb.base/watchpoint-unaligned.exp produces TCL error ahajkova at redhat dot com
                   ` (5 preceding siblings ...)
  2023-04-13 17:39 ` ahajkova at redhat dot com
@ 2023-04-13 17:41 ` ahajkova at redhat dot com
  2023-04-14  9:55 ` luis.machado at arm dot com
                   ` (29 subsequent siblings)
  36 siblings, 0 replies; 38+ messages in thread
From: ahajkova at redhat dot com @ 2023-04-13 17:41 UTC (permalink / raw)
  To: gdb-prs

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

Alexandra Hájková <ahajkova at redhat dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
  Attachment #14821|0                           |1
        is obsolete|                            |

--- Comment #7 from Alexandra Hájková <ahajkova at redhat dot com> ---
Created attachment 14823
  --> https://sourceware.org/bugzilla/attachment.cgi?id=14823&action=edit
strace log

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

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

* [Bug gdb/30340] gdb.base/watchpoint-unaligned.exp produces TCL error
  2023-04-12 20:57 [Bug gdb/30340] New: gdb.base/watchpoint-unaligned.exp produces TCL error ahajkova at redhat dot com
                   ` (6 preceding siblings ...)
  2023-04-13 17:41 ` ahajkova at redhat dot com
@ 2023-04-14  9:55 ` luis.machado at arm dot com
  2023-04-14  9:56 ` luis.machado at arm dot com
                   ` (28 subsequent siblings)
  36 siblings, 0 replies; 38+ messages in thread
From: luis.machado at arm dot com @ 2023-04-14  9:55 UTC (permalink / raw)
  To: gdb-prs

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

--- Comment #8 from Luis Machado <luis.machado at arm dot com> ---
Thanks!

The ptrace requests for the debug registers seem to be going through just fine:

ptrace(PTRACE_GETREGSET, 1832792, NT_ARM_HW_WATCH, {iov_base=0xffffc0ea3b88,
iov_len=264}) = 0

ptrace(PTRACE_GETREGSET, 1832792, NT_ARM_HW_BREAK, {iov_base=0xffffc0ea3b88,
iov_len=264}) = 0

I think this rules out permissions issues with ptrace, and we're back at
suspecting the architecture level comparisons.

Since you have ready access to the hardware, would you mind running a quick
check on your side?

In gdb/nat/aarch64-linux-hw-point.c:compatible_debug_arch, could you please add
a warning statement printing the debug_arch? Like we do for example in
aarch64_linux_get_debug_reg_capacity when printing the number of
watchpoints/breakpoints.

Then rebuild gdb, run the test (to create the test executable) and attempt to
run that same command line we used for strace.

Could you then paste the architecture level that is printed?

Also, could you please paste the output of "cat /proc/cpuinfo"?

Thanks!

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

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

* [Bug gdb/30340] gdb.base/watchpoint-unaligned.exp produces TCL error
  2023-04-12 20:57 [Bug gdb/30340] New: gdb.base/watchpoint-unaligned.exp produces TCL error ahajkova at redhat dot com
                   ` (7 preceding siblings ...)
  2023-04-14  9:55 ` luis.machado at arm dot com
@ 2023-04-14  9:56 ` luis.machado at arm dot com
  2023-04-14 10:55 ` ahajkova at redhat dot com
                   ` (27 subsequent siblings)
  36 siblings, 0 replies; 38+ messages in thread
From: luis.machado at arm dot com @ 2023-04-14  9:56 UTC (permalink / raw)
  To: gdb-prs

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

Luis Machado <luis.machado at arm dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Assignee|unassigned at sourceware dot org   |luis.machado at arm dot com

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

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

* [Bug gdb/30340] gdb.base/watchpoint-unaligned.exp produces TCL error
  2023-04-12 20:57 [Bug gdb/30340] New: gdb.base/watchpoint-unaligned.exp produces TCL error ahajkova at redhat dot com
                   ` (8 preceding siblings ...)
  2023-04-14  9:56 ` luis.machado at arm dot com
@ 2023-04-14 10:55 ` ahajkova at redhat dot com
  2023-04-14 12:09 ` luis.machado at arm dot com
                   ` (26 subsequent siblings)
  36 siblings, 0 replies; 38+ messages in thread
From: ahajkova at redhat dot com @ 2023-04-14 10:55 UTC (permalink / raw)
  To: gdb-prs

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

--- Comment #9 from Alexandra Hájková <ahajkova at redhat dot com> ---
(In reply to Luis Machado from comment #8)
> Thanks!
> 
> The ptrace requests for the debug registers seem to be going through just
> fine:
> 
> ptrace(PTRACE_GETREGSET, 1832792, NT_ARM_HW_WATCH, {iov_base=0xffffc0ea3b88,
> iov_len=264}) = 0
> 
> ptrace(PTRACE_GETREGSET, 1832792, NT_ARM_HW_BREAK, {iov_base=0xffffc0ea3b88,
> iov_len=264}) = 0
> 
> I think this rules out permissions issues with ptrace, and we're back at
> suspecting the architecture level comparisons.
> 
> Since you have ready access to the hardware, would you mind running a quick
> check on your side?
> 
> In gdb/nat/aarch64-linux-hw-point.c:compatible_debug_arch, could you please
> add a warning statement printing the debug_arch? Like we do for example in
> aarch64_linux_get_debug_reg_capacity when printing the number of
> watchpoints/breakpoints.
> 
> Then rebuild gdb, run the test (to create the test executable) and attempt
> to run that same command line we used for strace.
> 
> Could you then paste the architecture level that is printed?
> 
> Also, could you please paste the output of "cat /proc/cpuinfo"?
> 
> Thanks!

I'm getting 0 for the debug_arch.

as for the cpuinfo:
processor       : 0
BogoMIPS        : 50.00
Features        : fp asimd evtstrm aes pmull sha1 sha2 crc32 atomics fphp
asimdhp cpuid asimdrdm lrcpc dcpop asimddp ssbs
CPU implementer : 0x41
CPU architecture: 8
CPU variant     : 0x3
CPU part        : 0xd0c
CPU revision    : 1

processor       : 1
BogoMIPS        : 50.00
Features        : fp asimd evtstrm aes pmull sha1 sha2 crc32 atomics fphp
asimdhp cpuid asimdrdm lrcpc dcpop asimddp ssbs
CPU implementer : 0x41
CPU architecture: 8
CPU variant     : 0x3
CPU part        : 0xd0c
CPU revision    : 1

processor       : 2
BogoMIPS        : 50.00
Features        : fp asimd evtstrm aes pmull sha1 sha2 crc32 atomics fphp
asimdhp cpuid asimdrdm lrcpc dcpop asimddp ssbs
CPU implementer : 0x41
CPU architecture: 8
CPU variant     : 0x3
CPU part        : 0xd0c
CPU revision    : 1

processor       : 3
BogoMIPS        : 50.00
Features        : fp asimd evtstrm aes pmull sha1 sha2 crc32 atomics fphp
asimdhp cpuid asimdrdm lrcpc dcpop asimddp ssbs
CPU implementer : 0x41
CPU architecture: 8
CPU variant     : 0x3
CPU part        : 0xd0c
CPU revision    : 1

Should I update my patch to check for any warnings/errors or do you just want
to take care of this issue yourself?

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

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

* [Bug gdb/30340] gdb.base/watchpoint-unaligned.exp produces TCL error
  2023-04-12 20:57 [Bug gdb/30340] New: gdb.base/watchpoint-unaligned.exp produces TCL error ahajkova at redhat dot com
                   ` (9 preceding siblings ...)
  2023-04-14 10:55 ` ahajkova at redhat dot com
@ 2023-04-14 12:09 ` luis.machado at arm dot com
  2023-04-14 13:58 ` luis.machado at arm dot com
                   ` (25 subsequent siblings)
  36 siblings, 0 replies; 38+ messages in thread
From: luis.machado at arm dot com @ 2023-04-14 12:09 UTC (permalink / raw)
  To: gdb-prs

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

--- Comment #10 from Luis Machado <luis.machado at arm dot com> ---
Hi Alexandra. Thanks for the info.

I think hardening the test to make sure it doesn't test things that are known
to not work is useful still.

With that said, I think we're dealing with a different issue for this
particular AArch64 machine.

Here's your output from cpuinfo:

processor       : 3
BogoMIPS        : 50.00
Features        : fp asimd evtstrm aes pmull sha1 sha2 crc32 atomics fphp
asimdhp cpuid asimdrdm lrcpc dcpop asimddp ssbs
CPU implementer : 0x41
CPU architecture: 8
CPU variant     : 0x3
CPU part        : 0xd0c
CPU revision    : 1

Here's an output from a Ampere Mt Snow I have access to:

processor       : 159
BogoMIPS        : 50.00
Features        : fp asimd evtstrm aes pmull sha1 sha2 crc32 atomics fphp
asimdhp cpuid asimdrdm lrcpc dcpop asimddp ssbs
CPU implementer : 0x41
CPU architecture: 8
CPU variant     : 0x3
CPU part        : 0xd0c
CPU revision    : 1

They are the same, so technically things should work. But you're getting 0 for
the debug arch value, which is invalid.

I'll have to do some research on this one. Do you know how this machine is set?
Is it a standalone machine or part of a cloud setup? Are there security
features enabled?

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

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

* [Bug gdb/30340] gdb.base/watchpoint-unaligned.exp produces TCL error
  2023-04-12 20:57 [Bug gdb/30340] New: gdb.base/watchpoint-unaligned.exp produces TCL error ahajkova at redhat dot com
                   ` (10 preceding siblings ...)
  2023-04-14 12:09 ` luis.machado at arm dot com
@ 2023-04-14 13:58 ` luis.machado at arm dot com
  2023-04-14 15:03 ` ahajkova at redhat dot com
                   ` (24 subsequent siblings)
  36 siblings, 0 replies; 38+ messages in thread
From: luis.machado at arm dot com @ 2023-04-14 13:58 UTC (permalink / raw)
  To: gdb-prs

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

--- Comment #11 from Luis Machado <luis.machado at arm dot com> ---
Also, is KVM being used?

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

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

* [Bug gdb/30340] gdb.base/watchpoint-unaligned.exp produces TCL error
  2023-04-12 20:57 [Bug gdb/30340] New: gdb.base/watchpoint-unaligned.exp produces TCL error ahajkova at redhat dot com
                   ` (11 preceding siblings ...)
  2023-04-14 13:58 ` luis.machado at arm dot com
@ 2023-04-14 15:03 ` ahajkova at redhat dot com
  2023-04-14 16:31 ` luis.machado at arm dot com
                   ` (23 subsequent siblings)
  36 siblings, 0 replies; 38+ messages in thread
From: ahajkova at redhat dot com @ 2023-04-14 15:03 UTC (permalink / raw)
  To: gdb-prs

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

--- Comment #12 from Alexandra Hájková <ahajkova at redhat dot com> ---
(In reply to Luis Machado from comment #11)
> Also, is KVM being used?

Yes

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

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

* [Bug gdb/30340] gdb.base/watchpoint-unaligned.exp produces TCL error
  2023-04-12 20:57 [Bug gdb/30340] New: gdb.base/watchpoint-unaligned.exp produces TCL error ahajkova at redhat dot com
                   ` (12 preceding siblings ...)
  2023-04-14 15:03 ` ahajkova at redhat dot com
@ 2023-04-14 16:31 ` luis.machado at arm dot com
  2023-04-14 19:00 ` ahajkova at redhat dot com
                   ` (22 subsequent siblings)
  36 siblings, 0 replies; 38+ messages in thread
From: luis.machado at arm dot com @ 2023-04-14 16:31 UTC (permalink / raw)
  To: gdb-prs

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

--- Comment #13 from Luis Machado <luis.machado at arm dot com> ---
The use of KVM may have an influence here, but it isn't yet clear how.

Supposedly the code for KVM on AArch64 limits the debug architecture version to
6 (Arm v8.0), but since you reported seeing a value of 0, that looks
suspicious.

If you modify gdb's code to return true for a debug architecture version of 0,
does it pass the testcase? (so changing
gdb/nat/aarch64-linux-hw-point.c:compatible_debug_arch to return true on 0).

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

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

* [Bug gdb/30340] gdb.base/watchpoint-unaligned.exp produces TCL error
  2023-04-12 20:57 [Bug gdb/30340] New: gdb.base/watchpoint-unaligned.exp produces TCL error ahajkova at redhat dot com
                   ` (13 preceding siblings ...)
  2023-04-14 16:31 ` luis.machado at arm dot com
@ 2023-04-14 19:00 ` ahajkova at redhat dot com
  2023-04-17  8:25 ` luis.machado at arm dot com
                   ` (21 subsequent siblings)
  36 siblings, 0 replies; 38+ messages in thread
From: ahajkova at redhat dot com @ 2023-04-14 19:00 UTC (permalink / raw)
  To: gdb-prs

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

--- Comment #14 from Alexandra Hájková <ahajkova at redhat dot com> ---
(In reply to Luis Machado from comment #13)
> The use of KVM may have an influence here, but it isn't yet clear how.
> 
> Supposedly the code for KVM on AArch64 limits the debug architecture version
> to 6 (Arm v8.0), but since you reported seeing a value of 0, that looks
> suspicious.
> 
> If you modify gdb's code to return true for a debug architecture version of
> 0, does it pass the testcase? (so changing
> gdb/nat/aarch64-linux-hw-point.c:compatible_debug_arch to return true on 0).

No, I'm still seeing TCL error when modifying like this:
compatible_debug_arch (unsigned int debug_arch)
 {
+       if (debug_arch == 0)
+               return 0;

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

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

* [Bug gdb/30340] gdb.base/watchpoint-unaligned.exp produces TCL error
  2023-04-12 20:57 [Bug gdb/30340] New: gdb.base/watchpoint-unaligned.exp produces TCL error ahajkova at redhat dot com
                   ` (14 preceding siblings ...)
  2023-04-14 19:00 ` ahajkova at redhat dot com
@ 2023-04-17  8:25 ` luis.machado at arm dot com
  2023-04-17  8:25 ` luis.machado at arm dot com
                   ` (20 subsequent siblings)
  36 siblings, 0 replies; 38+ messages in thread
From: luis.machado at arm dot com @ 2023-04-17  8:25 UTC (permalink / raw)
  To: gdb-prs

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

--- Comment #15 from Luis Machado <luis.machado at arm dot com> ---
You need to return true instead of zero. Returning is the equivalent of
returning false (which is what we already do).

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

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

* [Bug gdb/30340] gdb.base/watchpoint-unaligned.exp produces TCL error
  2023-04-12 20:57 [Bug gdb/30340] New: gdb.base/watchpoint-unaligned.exp produces TCL error ahajkova at redhat dot com
                   ` (15 preceding siblings ...)
  2023-04-17  8:25 ` luis.machado at arm dot com
@ 2023-04-17  8:25 ` luis.machado at arm dot com
  2023-04-17  9:16 ` ahajkova at redhat dot com
                   ` (19 subsequent siblings)
  36 siblings, 0 replies; 38+ messages in thread
From: luis.machado at arm dot com @ 2023-04-17  8:25 UTC (permalink / raw)
  To: gdb-prs

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

--- Comment #16 from Luis Machado <luis.machado at arm dot com> ---
*returning 0 is the...*

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

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

* [Bug gdb/30340] gdb.base/watchpoint-unaligned.exp produces TCL error
  2023-04-12 20:57 [Bug gdb/30340] New: gdb.base/watchpoint-unaligned.exp produces TCL error ahajkova at redhat dot com
                   ` (16 preceding siblings ...)
  2023-04-17  8:25 ` luis.machado at arm dot com
@ 2023-04-17  9:16 ` ahajkova at redhat dot com
  2023-04-17  9:25 ` ahajkova at redhat dot com
                   ` (18 subsequent siblings)
  36 siblings, 0 replies; 38+ messages in thread
From: ahajkova at redhat dot com @ 2023-04-17  9:16 UTC (permalink / raw)
  To: gdb-prs

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

--- Comment #17 from Alexandra Hájková <ahajkova at redhat dot com> ---
(In reply to Luis Machado from comment #16)
> *returning 0 is the...*

oh sorry, must have been some kind of the mental fog

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

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

* [Bug gdb/30340] gdb.base/watchpoint-unaligned.exp produces TCL error
  2023-04-12 20:57 [Bug gdb/30340] New: gdb.base/watchpoint-unaligned.exp produces TCL error ahajkova at redhat dot com
                   ` (17 preceding siblings ...)
  2023-04-17  9:16 ` ahajkova at redhat dot com
@ 2023-04-17  9:25 ` ahajkova at redhat dot com
  2023-04-17  9:32 ` luis.machado at arm dot com
                   ` (17 subsequent siblings)
  36 siblings, 0 replies; 38+ messages in thread
From: ahajkova at redhat dot com @ 2023-04-17  9:25 UTC (permalink / raw)
  To: gdb-prs

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

--- Comment #18 from Alexandra Hájková <ahajkova at redhat dot com> ---
(In reply to Luis Machado from comment #13)
> The use of KVM may have an influence here, but it isn't yet clear how.
> 
> Supposedly the code for KVM on AArch64 limits the debug architecture version
> to 6 (Arm v8.0), but since you reported seeing a value of 0, that looks
> suspicious.
> 
> If you modify gdb's code to return true for a debug architecture version of
> 0, does it pass the testcase? (so changing
> gdb/nat/aarch64-linux-hw-point.c:compatible_debug_arch to return true on 0).

So it does pass:
Running
/root/build/gdb/testsuite/../../../binutils-gdb/gdb/testsuite/gdb.base/watchpoint-unaligned.exp
...
FAIL: gdb.base/watchpoint-unaligned.exp: continue (timeout)
FAIL: gdb.base/watchpoint-unaligned.exp: size8twice write

                === gdb Summary ===

# of expected passes            238
# of unexpected failures        2
# of known failures             1

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

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

* [Bug gdb/30340] gdb.base/watchpoint-unaligned.exp produces TCL error
  2023-04-12 20:57 [Bug gdb/30340] New: gdb.base/watchpoint-unaligned.exp produces TCL error ahajkova at redhat dot com
                   ` (18 preceding siblings ...)
  2023-04-17  9:25 ` ahajkova at redhat dot com
@ 2023-04-17  9:32 ` luis.machado at arm dot com
  2023-04-17  9:33 ` [Bug gdb/30340] [gdb/aarch64] gdb doesn't handle unknown debug architecture versions gracefully (TCL errors on gdb.base/watchpoint-unaligned.exp with KVM) luis.machado at arm dot com
                   ` (16 subsequent siblings)
  36 siblings, 0 replies; 38+ messages in thread
From: luis.machado at arm dot com @ 2023-04-17  9:32 UTC (permalink / raw)
  To: gdb-prs

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

Luis Machado <luis.machado at arm dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|WAITING                     |ASSIGNED

--- Comment #19 from Luis Machado <luis.machado at arm dot com> ---
Thanks for testing this. Given what you reported, I suspect we my be running
into a KVM bug/limitation, where KVM doesn't report the expected debug
architecture version to gdb, and then gdb bails out and doesn't use hardware
watchpoints or hardware breakpoints.

With that said, I think gdb could handle unknown debug architecture versions in
a better way, but it might be worth investigating why KVM is setting the debug
architecture version to 0.

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

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

* [Bug gdb/30340] [gdb/aarch64] gdb doesn't handle unknown debug architecture versions gracefully (TCL errors on gdb.base/watchpoint-unaligned.exp with KVM)
  2023-04-12 20:57 [Bug gdb/30340] New: gdb.base/watchpoint-unaligned.exp produces TCL error ahajkova at redhat dot com
                   ` (19 preceding siblings ...)
  2023-04-17  9:32 ` luis.machado at arm dot com
@ 2023-04-17  9:33 ` luis.machado at arm dot com
  2023-04-17 13:33 ` ahajkova at redhat dot com
                   ` (15 subsequent siblings)
  36 siblings, 0 replies; 38+ messages in thread
From: luis.machado at arm dot com @ 2023-04-17  9:33 UTC (permalink / raw)
  To: gdb-prs

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

Luis Machado <luis.machado at arm dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
            Summary|gdb.base/watchpoint-unalign |[gdb/aarch64] gdb doesn't
                   |ed.exp produces TCL error   |handle unknown debug
                   |                            |architecture versions
                   |                            |gracefully (TCL errors on
                   |                            |gdb.base/watchpoint-unalign
                   |                            |ed.exp with KVM)

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

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

* [Bug gdb/30340] [gdb/aarch64] gdb doesn't handle unknown debug architecture versions gracefully (TCL errors on gdb.base/watchpoint-unaligned.exp with KVM)
  2023-04-12 20:57 [Bug gdb/30340] New: gdb.base/watchpoint-unaligned.exp produces TCL error ahajkova at redhat dot com
                   ` (20 preceding siblings ...)
  2023-04-17  9:33 ` [Bug gdb/30340] [gdb/aarch64] gdb doesn't handle unknown debug architecture versions gracefully (TCL errors on gdb.base/watchpoint-unaligned.exp with KVM) luis.machado at arm dot com
@ 2023-04-17 13:33 ` ahajkova at redhat dot com
  2023-04-18  7:59 ` luis.machado at arm dot com
                   ` (14 subsequent siblings)
  36 siblings, 0 replies; 38+ messages in thread
From: ahajkova at redhat dot com @ 2023-04-17 13:33 UTC (permalink / raw)
  To: gdb-prs

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

--- Comment #20 from Alexandra Hájková <ahajkova at redhat dot com> ---
(In reply to Luis Machado from comment #1)
> I think what you want is to check for any warnings/errors when attempting to
> create hardware watchpoints/breakpoints and then fail and abort testing.
> 
> For example, gdb emits these warnings:
> 
> warning: Unable to determine the number of hardware watchpoints available.
> warning: Unable to determine the number of hardware breakpoints available.
> 
> They should be an indication something is off, and there is no point
> resuming testing in that case.

those warnings seems to be emmited when runto_main is called

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

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

* [Bug gdb/30340] [gdb/aarch64] gdb doesn't handle unknown debug architecture versions gracefully (TCL errors on gdb.base/watchpoint-unaligned.exp with KVM)
  2023-04-12 20:57 [Bug gdb/30340] New: gdb.base/watchpoint-unaligned.exp produces TCL error ahajkova at redhat dot com
                   ` (21 preceding siblings ...)
  2023-04-17 13:33 ` ahajkova at redhat dot com
@ 2023-04-18  7:59 ` luis.machado at arm dot com
  2023-04-18 11:47 ` [Bug tdep/30340] " luis.machado at arm dot com
                   ` (13 subsequent siblings)
  36 siblings, 0 replies; 38+ messages in thread
From: luis.machado at arm dot com @ 2023-04-18  7:59 UTC (permalink / raw)
  To: gdb-prs

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

--- Comment #21 from Luis Machado <luis.machado at arm dot com> ---
Yes, that's expected. For AArch64, whenever we move the debugged program, we do
some handling of debug registers for each thread. In this case we're issuing
the warning because gdb didn't quite understand what the kernel replied.

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

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

* [Bug tdep/30340] [gdb/aarch64] gdb doesn't handle unknown debug architecture versions gracefully (TCL errors on gdb.base/watchpoint-unaligned.exp with KVM)
  2023-04-12 20:57 [Bug gdb/30340] New: gdb.base/watchpoint-unaligned.exp produces TCL error ahajkova at redhat dot com
                   ` (22 preceding siblings ...)
  2023-04-18  7:59 ` luis.machado at arm dot com
@ 2023-04-18 11:47 ` luis.machado at arm dot com
  2023-04-18 13:27 ` luis.machado at arm dot com
                   ` (12 subsequent siblings)
  36 siblings, 0 replies; 38+ messages in thread
From: luis.machado at arm dot com @ 2023-04-18 11:47 UTC (permalink / raw)
  To: gdb-prs

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

Luis Machado <luis.machado at arm dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
          Component|gdb                         |tdep

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

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

* [Bug tdep/30340] [gdb/aarch64] gdb doesn't handle unknown debug architecture versions gracefully (TCL errors on gdb.base/watchpoint-unaligned.exp with KVM)
  2023-04-12 20:57 [Bug gdb/30340] New: gdb.base/watchpoint-unaligned.exp produces TCL error ahajkova at redhat dot com
                   ` (23 preceding siblings ...)
  2023-04-18 11:47 ` [Bug tdep/30340] " luis.machado at arm dot com
@ 2023-04-18 13:27 ` luis.machado at arm dot com
  2023-04-18 13:28 ` luis.machado at arm dot com
                   ` (11 subsequent siblings)
  36 siblings, 0 replies; 38+ messages in thread
From: luis.machado at arm dot com @ 2023-04-18 13:27 UTC (permalink / raw)
  To: gdb-prs

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

Luis Machado <luis.machado at arm dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|ASSIGNED                    |WAITING

--- Comment #22 from Luis Machado <luis.machado at arm dot com> ---
Could you please confirm your hardware / software setup / KVM setup? I chased
this for a bit, but it is hard to see where a value of 0 for the debug
architecture version is coming from.

What kernel version are you running? Is it patched? What specific hardware do
you have? What is the setup with KVM? Is it a guest or a host?

This will help us confirm if it is a genuine bug somewhere in the kernel or
something else.

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

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

* [Bug tdep/30340] [gdb/aarch64] gdb doesn't handle unknown debug architecture versions gracefully (TCL errors on gdb.base/watchpoint-unaligned.exp with KVM)
  2023-04-12 20:57 [Bug gdb/30340] New: gdb.base/watchpoint-unaligned.exp produces TCL error ahajkova at redhat dot com
                   ` (24 preceding siblings ...)
  2023-04-18 13:27 ` luis.machado at arm dot com
@ 2023-04-18 13:28 ` luis.machado at arm dot com
  2023-04-18 19:59 ` ahajkova at redhat dot com
                   ` (10 subsequent siblings)
  36 siblings, 0 replies; 38+ messages in thread
From: luis.machado at arm dot com @ 2023-04-18 13:28 UTC (permalink / raw)
  To: gdb-prs

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

--- Comment #23 from Luis Machado <luis.machado at arm dot com> ---
Also, guest and host kernel versions being used.

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

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

* [Bug tdep/30340] [gdb/aarch64] gdb doesn't handle unknown debug architecture versions gracefully (TCL errors on gdb.base/watchpoint-unaligned.exp with KVM)
  2023-04-12 20:57 [Bug gdb/30340] New: gdb.base/watchpoint-unaligned.exp produces TCL error ahajkova at redhat dot com
                   ` (25 preceding siblings ...)
  2023-04-18 13:28 ` luis.machado at arm dot com
@ 2023-04-18 19:59 ` ahajkova at redhat dot com
  2023-04-18 20:05 ` ahajkova at redhat dot com
                   ` (9 subsequent siblings)
  36 siblings, 0 replies; 38+ messages in thread
From: ahajkova at redhat dot com @ 2023-04-18 19:59 UTC (permalink / raw)
  To: gdb-prs

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

--- Comment #24 from Alexandra Hájková <ahajkova at redhat dot com> ---
(In reply to Luis Machado from comment #22)
> Could you please confirm your hardware / software setup / KVM setup? I
> chased this for a bit, but it is hard to see where a value of 0 for the
> debug architecture version is coming from.
> 
> What kernel version are you running? Is it patched? 
6.3.0-0.rc5.20230407gitf2afccfefe7b.46.fc39.aarch64, not patched

What specific hardware
> do you have? What is the setup with KVM? Is it a guest or a host?
it's KVM guest

> This will help us confirm if it is a genuine bug somewhere in the kernel or
> something else.

Attaching a dmidecode output.

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

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

* [Bug tdep/30340] [gdb/aarch64] gdb doesn't handle unknown debug architecture versions gracefully (TCL errors on gdb.base/watchpoint-unaligned.exp with KVM)
  2023-04-12 20:57 [Bug gdb/30340] New: gdb.base/watchpoint-unaligned.exp produces TCL error ahajkova at redhat dot com
                   ` (26 preceding siblings ...)
  2023-04-18 19:59 ` ahajkova at redhat dot com
@ 2023-04-18 20:05 ` ahajkova at redhat dot com
  2023-05-02  9:38 ` aburgess at redhat dot com
                   ` (8 subsequent siblings)
  36 siblings, 0 replies; 38+ messages in thread
From: ahajkova at redhat dot com @ 2023-04-18 20:05 UTC (permalink / raw)
  To: gdb-prs

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

--- Comment #25 from Alexandra Hájková <ahajkova at redhat dot com> ---
Created attachment 14839
  --> https://sourceware.org/bugzilla/attachment.cgi?id=14839&action=edit
dmidecode output

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

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

* [Bug tdep/30340] [gdb/aarch64] gdb doesn't handle unknown debug architecture versions gracefully (TCL errors on gdb.base/watchpoint-unaligned.exp with KVM)
  2023-04-12 20:57 [Bug gdb/30340] New: gdb.base/watchpoint-unaligned.exp produces TCL error ahajkova at redhat dot com
                   ` (27 preceding siblings ...)
  2023-04-18 20:05 ` ahajkova at redhat dot com
@ 2023-05-02  9:38 ` aburgess at redhat dot com
  2023-05-02  9:41 ` aburgess at redhat dot com
                   ` (7 subsequent siblings)
  36 siblings, 0 replies; 38+ messages in thread
From: aburgess at redhat dot com @ 2023-05-02  9:38 UTC (permalink / raw)
  To: gdb-prs

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

Andrew Burgess <aburgess at redhat dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|WAITING                     |NEW
                 CC|                            |aburgess at redhat dot com

--- Comment #26 from Andrew Burgess <aburgess at redhat dot com> ---
We've discussed this bug a little on IRC, but I wanted to drop a note of the
current plan.

I feel there's two issues here, one if the TCL error.  This occurs because a
TCL variable ends up not being initialized when one of the gdb_test_multiple
calls fails.

Then there's a different (but related) question of why the gdb_test_multiple
call failed.

I think we should fix the uninitialized variable issue separately to digging
into the question of "why" the test is failing.  There are many reasons why a
gdb_test_multiple call could fail - even if we spot and catch this specific
case, the gdb_test_multiple could fail for some other reason tomorrow, and then
the TCL error would be back.  Alexandra has a patch on the list which addresses
the TCL issue which we can merge sooner rather than later[1].

As for why the test is failing in this case, it appears to be some ptrace call
that is returning unexpected results.  Right now it's not clear if this is a
legitimate result that GDB/the testsuite is just not expecting, or if this
unexpected result represents a bug in the software stack -- the issue was seen
on a virtual machine using Red Hat modified .... well ... everything -- and
everything is of various ages.  We're currently digging into this issue within
RH trying to figure out where the unexpected result is coming from, and will
update here once we know more information.

[1] https://sourceware.org/pipermail/gdb-patches/2023-April/199092.html

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

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

* [Bug tdep/30340] [gdb/aarch64] gdb doesn't handle unknown debug architecture versions gracefully (TCL errors on gdb.base/watchpoint-unaligned.exp with KVM)
  2023-04-12 20:57 [Bug gdb/30340] New: gdb.base/watchpoint-unaligned.exp produces TCL error ahajkova at redhat dot com
                   ` (28 preceding siblings ...)
  2023-05-02  9:38 ` aburgess at redhat dot com
@ 2023-05-02  9:41 ` aburgess at redhat dot com
  2023-05-02 20:51 ` cvs-commit at gcc dot gnu.org
                   ` (6 subsequent siblings)
  36 siblings, 0 replies; 38+ messages in thread
From: aburgess at redhat dot com @ 2023-05-02  9:41 UTC (permalink / raw)
  To: gdb-prs

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

--- Comment #27 from Andrew Burgess <aburgess at redhat dot com> ---
Created attachment 14859
  --> https://sourceware.org/bugzilla/attachment.cgi?id=14859&action=edit
Test program that exposes the problematic ptrace call

Here's the demo program that I've been using to expose the ptrace issue.  The
issue is that when we ask for the H/W watchpoint information we get back a
dbg_info field containing 0 for the architecture field.

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

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

* [Bug tdep/30340] [gdb/aarch64] gdb doesn't handle unknown debug architecture versions gracefully (TCL errors on gdb.base/watchpoint-unaligned.exp with KVM)
  2023-04-12 20:57 [Bug gdb/30340] New: gdb.base/watchpoint-unaligned.exp produces TCL error ahajkova at redhat dot com
                   ` (29 preceding siblings ...)
  2023-05-02  9:41 ` aburgess at redhat dot com
@ 2023-05-02 20:51 ` cvs-commit at gcc dot gnu.org
  2023-05-09 10:01 ` luis.machado at arm dot com
                   ` (5 subsequent siblings)
  36 siblings, 0 replies; 38+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2023-05-02 20:51 UTC (permalink / raw)
  To: gdb-prs

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

--- Comment #28 from cvs-commit at gcc dot gnu.org <cvs-commit at gcc dot gnu.org> ---
The master branch has been updated by Alexandra Hajkova
<ahajkova@sourceware.org>:

https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=59305ae6247e86f35bbe94ed1f9599af8f8e6f69

commit 59305ae6247e86f35bbe94ed1f9599af8f8e6f69
Author: Alexandra Hájková <ahajkova@redhat.com>
Date:   Tue May 2 22:33:49 2023 +0200

    gdb.base/watchpoint-unaligned.exp: Always initialize wpoffset_to_wpnum

    Initialize wpoffset_to_wpnumto avoid TCL error which happens in some
aarch64 types.

    ERROR: in testcase
/root/build/gdb/testsuite/../../../binutils-gdb/gdb/testsuite/gdb.base/watchpoint-unaligned.exp
    ERROR:  can't read "wpoffset_to_wpnum(1)": no such element in array
    ERROR:  tcl error code TCL READ VARNAME
    ERROR:  tcl error info:
    can't read "wpoffset_to_wpnum(1)": no such element in array
        while executing

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

    Reviewed-by: Luis Machado <luis.machado@arm.com>
    Reviewed-By: Andrew Burgess <aburgess@redhat.com>

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

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

* [Bug tdep/30340] [gdb/aarch64] gdb doesn't handle unknown debug architecture versions gracefully (TCL errors on gdb.base/watchpoint-unaligned.exp with KVM)
  2023-04-12 20:57 [Bug gdb/30340] New: gdb.base/watchpoint-unaligned.exp produces TCL error ahajkova at redhat dot com
                   ` (30 preceding siblings ...)
  2023-05-02 20:51 ` cvs-commit at gcc dot gnu.org
@ 2023-05-09 10:01 ` luis.machado at arm dot com
  2023-05-09 10:01 ` luis.machado at arm dot com
                   ` (4 subsequent siblings)
  36 siblings, 0 replies; 38+ messages in thread
From: luis.machado at arm dot com @ 2023-05-09 10:01 UTC (permalink / raw)
  To: gdb-prs

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

Luis Machado <luis.machado at arm dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Target Milestone|---                         |14.1

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

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

* [Bug tdep/30340] [gdb/aarch64] gdb doesn't handle unknown debug architecture versions gracefully (TCL errors on gdb.base/watchpoint-unaligned.exp with KVM)
  2023-04-12 20:57 [Bug gdb/30340] New: gdb.base/watchpoint-unaligned.exp produces TCL error ahajkova at redhat dot com
                   ` (31 preceding siblings ...)
  2023-05-09 10:01 ` luis.machado at arm dot com
@ 2023-05-09 10:01 ` luis.machado at arm dot com
  2023-05-15 10:02 ` aburgess at redhat dot com
                   ` (3 subsequent siblings)
  36 siblings, 0 replies; 38+ messages in thread
From: luis.machado at arm dot com @ 2023-05-09 10:01 UTC (permalink / raw)
  To: gdb-prs

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

Luis Machado <luis.machado at arm dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |ASSIGNED

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

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

* [Bug tdep/30340] [gdb/aarch64] gdb doesn't handle unknown debug architecture versions gracefully (TCL errors on gdb.base/watchpoint-unaligned.exp with KVM)
  2023-04-12 20:57 [Bug gdb/30340] New: gdb.base/watchpoint-unaligned.exp produces TCL error ahajkova at redhat dot com
                   ` (32 preceding siblings ...)
  2023-05-09 10:01 ` luis.machado at arm dot com
@ 2023-05-15 10:02 ` aburgess at redhat dot com
  2023-07-05 14:28 ` brobecker at gnat dot com
                   ` (2 subsequent siblings)
  36 siblings, 0 replies; 38+ messages in thread
From: aburgess at redhat dot com @ 2023-05-15 10:02 UTC (permalink / raw)
  To: gdb-prs

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

--- Comment #29 from Andrew Burgess <aburgess at redhat dot com> ---
I managed to track down what's going on here with the debug architecture being
reported as 0.

It turns out this was a short-term Red Hat kernel bug.  This bug never existed
in upstream Linux kernels, and the bug has been fixed for a while in RH
kernels.  The virtual machine Alexandra just happened to test on originally
still had the broken host OS version.  Upgrading to 4.18.0-429.el8 or later
kernel resolves this issue.

I'm leaving this bug open for now while Luis considers this patch:

https://sourceware.org/pipermail/gdb-patches/2023-April/198973.html

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

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

* [Bug tdep/30340] [gdb/aarch64] gdb doesn't handle unknown debug architecture versions gracefully (TCL errors on gdb.base/watchpoint-unaligned.exp with KVM)
  2023-04-12 20:57 [Bug gdb/30340] New: gdb.base/watchpoint-unaligned.exp produces TCL error ahajkova at redhat dot com
                   ` (33 preceding siblings ...)
  2023-05-15 10:02 ` aburgess at redhat dot com
@ 2023-07-05 14:28 ` brobecker at gnat dot com
  2023-07-05 14:28 ` brobecker at gnat dot com
  2023-07-05 14:31 ` luis.machado at arm dot com
  36 siblings, 0 replies; 38+ messages in thread
From: brobecker at gnat dot com @ 2023-07-05 14:28 UTC (permalink / raw)
  To: gdb-prs

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

Joel Brobecker <brobecker at gnat dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |brobecker at gnat dot com

--- Comment #30 from Joel Brobecker <brobecker at gnat dot com> ---
Hi team,

From what I understand from reading this PR, I think it should be fair to say
that the bug is would not be blocking for a GDB 14.1 release. So I'm unsetting
the Target Milestone field, which is currently set to 14.1.

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

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

* [Bug tdep/30340] [gdb/aarch64] gdb doesn't handle unknown debug architecture versions gracefully (TCL errors on gdb.base/watchpoint-unaligned.exp with KVM)
  2023-04-12 20:57 [Bug gdb/30340] New: gdb.base/watchpoint-unaligned.exp produces TCL error ahajkova at redhat dot com
                   ` (34 preceding siblings ...)
  2023-07-05 14:28 ` brobecker at gnat dot com
@ 2023-07-05 14:28 ` brobecker at gnat dot com
  2023-07-05 14:31 ` luis.machado at arm dot com
  36 siblings, 0 replies; 38+ messages in thread
From: brobecker at gnat dot com @ 2023-07-05 14:28 UTC (permalink / raw)
  To: gdb-prs

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

Joel Brobecker <brobecker at gnat dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Target Milestone|14.1                        |---

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

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

* [Bug tdep/30340] [gdb/aarch64] gdb doesn't handle unknown debug architecture versions gracefully (TCL errors on gdb.base/watchpoint-unaligned.exp with KVM)
  2023-04-12 20:57 [Bug gdb/30340] New: gdb.base/watchpoint-unaligned.exp produces TCL error ahajkova at redhat dot com
                   ` (35 preceding siblings ...)
  2023-07-05 14:28 ` brobecker at gnat dot com
@ 2023-07-05 14:31 ` luis.machado at arm dot com
  36 siblings, 0 replies; 38+ messages in thread
From: luis.machado at arm dot com @ 2023-07-05 14:31 UTC (permalink / raw)
  To: gdb-prs

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

--- Comment #31 from Luis Machado <luis.machado at arm dot com> ---
Hi Joel,

Right. This turned out to be a non-gdb bug. Improved handling might still be
desirable though.

Are we expecting a 14.1 release to come soon?

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

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

end of thread, other threads:[~2023-07-05 14:31 UTC | newest]

Thread overview: 38+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-04-12 20:57 [Bug gdb/30340] New: gdb.base/watchpoint-unaligned.exp produces TCL error ahajkova at redhat dot com
2023-04-13  7:47 ` [Bug gdb/30340] " luis.machado at arm dot com
2023-04-13 13:28 ` luis.machado at arm dot com
2023-04-13 13:52 ` ahajkova at redhat dot com
2023-04-13 14:01 ` luis.machado at arm dot com
2023-04-13 17:39 ` ahajkova at redhat dot com
2023-04-13 17:39 ` ahajkova at redhat dot com
2023-04-13 17:41 ` ahajkova at redhat dot com
2023-04-14  9:55 ` luis.machado at arm dot com
2023-04-14  9:56 ` luis.machado at arm dot com
2023-04-14 10:55 ` ahajkova at redhat dot com
2023-04-14 12:09 ` luis.machado at arm dot com
2023-04-14 13:58 ` luis.machado at arm dot com
2023-04-14 15:03 ` ahajkova at redhat dot com
2023-04-14 16:31 ` luis.machado at arm dot com
2023-04-14 19:00 ` ahajkova at redhat dot com
2023-04-17  8:25 ` luis.machado at arm dot com
2023-04-17  8:25 ` luis.machado at arm dot com
2023-04-17  9:16 ` ahajkova at redhat dot com
2023-04-17  9:25 ` ahajkova at redhat dot com
2023-04-17  9:32 ` luis.machado at arm dot com
2023-04-17  9:33 ` [Bug gdb/30340] [gdb/aarch64] gdb doesn't handle unknown debug architecture versions gracefully (TCL errors on gdb.base/watchpoint-unaligned.exp with KVM) luis.machado at arm dot com
2023-04-17 13:33 ` ahajkova at redhat dot com
2023-04-18  7:59 ` luis.machado at arm dot com
2023-04-18 11:47 ` [Bug tdep/30340] " luis.machado at arm dot com
2023-04-18 13:27 ` luis.machado at arm dot com
2023-04-18 13:28 ` luis.machado at arm dot com
2023-04-18 19:59 ` ahajkova at redhat dot com
2023-04-18 20:05 ` ahajkova at redhat dot com
2023-05-02  9:38 ` aburgess at redhat dot com
2023-05-02  9:41 ` aburgess at redhat dot com
2023-05-02 20:51 ` cvs-commit at gcc dot gnu.org
2023-05-09 10:01 ` luis.machado at arm dot com
2023-05-09 10:01 ` luis.machado at arm dot com
2023-05-15 10:02 ` aburgess at redhat dot com
2023-07-05 14:28 ` brobecker at gnat dot com
2023-07-05 14:28 ` brobecker at gnat dot com
2023-07-05 14:31 ` luis.machado at arm dot com

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