From: Gustavo Romero <gustavo.romero@linaro.org>
To: Richard Henderson <richard.henderson@linaro.org>,
qemu-devel@nongnu.org, alex.bennee@linaro.org
Cc: peter.maydell@linaro.org
Subject: Re: [PATCH 2/2] tests/tcg: Add multiarch test for Xfer:siginfo:read stub
Date: Fri, 8 Mar 2024 11:59:12 -0300 [thread overview]
Message-ID: <dcc0983b-8931-aab4-2179-f0e48f11e86a@linaro.org> (raw)
In-Reply-To: <43d5ea83-5fc1-47b0-a6d1-f8564c238d88@linaro.org>
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
next prev parent reply other threads:[~2024-03-08 14:59 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-03-03 19:26 [PATCH 1/2] gdbstub: Add Xfer:siginfo:read stub Gustavo Romero
2024-03-03 19:26 ` [PATCH 2/2] tests/tcg: Add multiarch test for " Gustavo Romero
2024-03-04 17:21 ` Richard Henderson
2024-03-04 20:59 ` Gustavo Romero
2024-03-04 22:51 ` Richard Henderson
2024-03-07 17:50 ` Gustavo Romero
2024-03-07 19:31 ` Richard Henderson
2024-03-08 14:59 ` Gustavo Romero [this message]
2024-03-04 17:18 ` [PATCH 1/2] gdbstub: Add " Richard Henderson
2024-03-07 17:51 ` Gustavo Romero
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=dcc0983b-8931-aab4-2179-f0e48f11e86a@linaro.org \
--to=gustavo.romero@linaro.org \
--cc=alex.bennee@linaro.org \
--cc=peter.maydell@linaro.org \
--cc=qemu-devel@nongnu.org \
--cc=richard.henderson@linaro.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 NNTP newsgroup(s).