qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH 2/2] tests/tcg: Add multiarch test for Xfer:siginfo:read stub


From: Gustavo Romero
Subject: Re: [PATCH 2/2] tests/tcg: Add multiarch test for Xfer:siginfo:read stub
Date: Fri, 8 Mar 2024 11:59:12 -0300
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.6.0


On 3/7/24 4:31 PM, Richard Henderson wrote:
On 3/7/24 07:50, Gustavo Romero wrote:
Hi Richard,

On 3/4/24 7:51 PM, Richard Henderson wrote:
On 3/4/24 10:59, Gustavo Romero wrote:
Perhaps just abort for SIGABRT instead?

Although this can make a simpler test, the test can't control
the si_addr value easily, which I think is interesting to be tested.

Why do you prefer SIGABRT?

I missed that you were testing si_addr -- in which case SIGSEGV is a good match.


A test using setitimer to raise SIGALRM would test the async path.

SIGLARM doesn't generate any interesting siginfo?

It should at minimum have si_sig = SIGALRM.


gromero@arm64:~$ gdb -q ./sigalrm
Reading symbols from ./sigalrm...
(gdb) run
Starting program: /home/gromero/sigalrm

Program terminated with signal SIGALRM, Alarm clock.
The program no longer exists.
(gdb) p $_siginfo
$1 = void

Well that's because the program died.
Do you need to have gdb handle the signal?

ouch, right :)

However, on a remote target, even if I catch that signal using
'catch signal SIGALRM' the GDBstub only closes the connection
when SIGALRM is delivered. That's odd, I don't understand why.

I'm using the same binary that pretty much works on GDB locally.


[Remote target]

gromero@arm64:~$ gdb -q
gromero@arm64:~/qemu_tests$ gdb -q ./sigalrm
Reading symbols from ./sigalrm...
(gdb) catch signal SIGALRM
Catchpoint 1 (signal SIGALRM)
(gdb) c
The program is not being run.
(gdb) run
Starting program: /home/gromero/qemu_tests/sigalrm
[Inferior 1 (process 12732) exited normally]
(gdb) quit

on the QEMU gdbstub side it reports "Alarm clock":

gromero@amd:~/git/qemu/build$ ./qemu-aarch64 -g 1234 ./sigalrm -s
Alarm clock
gromero@amd:~/git/qemu/build$


[Locally]

gromero@arm64:~/qemu_tests$ gdb -q ./sigalrm
Reading symbols from ./sigalrm...
(gdb) catch signal SIGALRM
Catchpoint 1 (signal SIGALRM)
(gdb) run -s
Starting program: /home/gromero/qemu_tests/sigalrm -s

Catchpoint 1 (signal SIGALRM), 0x000000000041a410 in ualarm ()
(gdb) quit


I'd like to add for the async path using SIGALRM but I need more
time to understand what's going on regarding SIGLARM. I understand
that's nothing wrong with the Xfer:siginfo:read stub itself, and
because the main goal of the test is to test the stub, if you don't
mind, I'd like to keep only the test with SIGSEGV for v2 and leave
the async test as a follow-up.

Well that's certainly surprising.
Would you please file a bug report about this?
I think I know what the problem is, but let's track it anyway.

Yeah.. I filed an issue here:

https://gitlab.com/qemu-project/qemu/-/issues/2214


Cheers,
Gustavo



reply via email to

[Prev in Thread] Current Thread [Next in Thread]