Bug 453044 - gbserver_tests failures in aarch64
Summary: gbserver_tests failures in aarch64
Status: RESOLVED FIXED
Alias: None
Product: valgrind
Classification: Developer tools
Component: general (show other bugs)
Version: 3.19.0
Platform: Other Linux
: NOR normal
Target Milestone: ---
Assignee: Paul Floyd
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2022-04-26 12:01 UTC by Jesus Checa
Modified: 2024-05-25 14:11 UTC (History)
1 user (show)

See Also:
Latest Commit:
Version Fixed In:
Sentry Crash Report:


Attachments
filter_gdb patch to handle "result = SYSCALL_CANCEL" pattern (489 bytes, patch)
2022-04-26 12:01 UTC, Jesus Checa
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Jesus Checa 2022-04-26 12:01:03 UTC
Created attachment 148381 [details]
filter_gdb patch to handle "result = SYSCALL_CANCEL" pattern

SUMMARY
mcinfcallWSRU, nlcontrolc and nlvgdbsigqueue tests failed in aarch64 in rhel-8. The cause is the same in the three tests, an extra line in the output which is not expected. Using nlcontrolc diff output as example:

=================================================
gdbserver_tests/nlcontrolc.stdoutB.diff
=================================================
--- nlcontrolc.stdoutB.exp	2022-04-11 10:27:12.000000000 -0400
+++ nlcontrolc.stdoutB.out	2022-04-26 03:44:40.597663940 -0400
@@ -10,12 +10,14 @@
 Continuing.
 Program received signal SIGTRAP, Trace/breakpoint trap.
 0x........ in syscall ...
+53	  result = SYSCALL_CANCEL (pselect6, nfds, readfds, writefds, exceptfds, tsp,
 * 1 Thread .... (tid 1 VgTs_WaitSys)  0x........ in syscall ...
 $3 = 0
 reset to sleeping parameters
 Continuing.
 Program received signal SIGTRAP, Trace/breakpoint trap.
 0x........ in syscall ...
+53	  result = SYSCALL_CANCEL (pselect6, nfds, readfds, writefds, exceptfds, tsp,
 * 1 Thread .... (tid 1 VgTs_WaitSys)  0x........ in syscall ...
  > > > >4
 Kill the program being debugged? (y or n) [answered Y; input not from terminal]

From glibc's git branch release/2.28/master, the responsible line can be found in sysdeps/unix/sysv/linux/select.c:53.

Following the same approach as seen in commit 3eba47604df8, adding a new pattern to gdbserver_tests/filter_gdb.in should suffice. After rerunning with it, the tests are passing. I'm attaching a proposed patch.
Comment 1 Jesus Checa 2022-04-26 12:41:34 UTC
Some additional info: The valgrind, kernel and glibc package versions are these:
kernel-4.18.0-384.el8.aarch64
valgrind-3.19.0-1.el8.aarch64
glibc-2.28-197.el8.aarch64
Comment 2 Paul Floyd 2024-05-12 05:37:47 UTC
Which version of gdb was this with?
Comment 3 Jesus Checa 2024-05-13 07:40:51 UTC
(In reply to Paul Floyd from comment #2)
> Which version of gdb was this with?

This was gdb 8.2
Comment 4 Paul Floyd 2024-05-21 13:17:49 UTC
(In reply to Jesus Checa from comment #3)
> (In reply to Paul Floyd from comment #2)
> > Which version of gdb was this with?
> 
> This was gdb 8.2

I just tried building gdb and couldn't reproduce. Quite likely this is due to the glibc version. I only have access to systems that are older or newer than 2.18. The patch looks safe, I'll do some tests and if nothing breaks I'll push it.
Comment 5 Paul Floyd 2024-05-21 13:43:09 UTC
glibc 2.28 I meant
Comment 6 Jesus Checa 2024-05-22 09:23:52 UTC
(In reply to Paul Floyd from comment #4)
> (In reply to Jesus Checa from comment #3)
> > (In reply to Paul Floyd from comment #2)
> > > Which version of gdb was this with?
> > 
> > This was gdb 8.2
> 
> I just tried building gdb and couldn't reproduce. Quite likely this is due
> to the glibc version. I only have access to systems that are older or newer
> than 2.18. The patch looks safe, I'll do some tests and if nothing breaks
> I'll push it.

Yes this happens with glibc 2.28, but not with newer, for example 2.34. With glibc 2.28, it reproduces when debuginfo is available, else it doesn't.
Comment 7 Paul Floyd 2024-05-25 14:11:29 UTC
commit 790abdf7d3f3df0c968605b68ca765310689b7ce (HEAD -> master, origin/master, origin/HEAD)
Author: Jesus Checa <jcheca@redhat.com>
Date:   Sat May 25 12:40:30 2024 +0200

    Bug 453044 - gbserver_tests failures in aarch64