[PATCH] linux-user: don't print core dump message by default

Andreas Schwab posted 1 patch 1 month, 2 weeks ago
Patches applied successfully (tree, apply log)
git fetch https://github.com/patchew-project/qemu tags/patchew/mvmzews2zze.fsf@suse.de
Maintainers: Laurent Vivier <laurent@vivier.eu>, Helge Deller <deller@gmx.de>, Pierrick Bouvier <pierrick.bouvier@oss.qualcomm.com>
linux-user/signal.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
[PATCH] linux-user: don't print core dump message by default
Posted by Andreas Schwab 1 month, 2 weeks ago
When the target binary is killed by a signal with core dump print a
message to the guest_errors log instead of stderr.  This avoids breaking
various testsuites due to the extra output produced by the emulation.

Signed-off-by: Andreas Schwab <schwab@suse.de>
---
 linux-user/signal.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/linux-user/signal.c b/linux-user/signal.c
index f0a22577e5..cabcc2bb28 100644
--- a/linux-user/signal.c
+++ b/linux-user/signal.c
@@ -839,8 +839,8 @@ void dump_core_and_abort(CPUArchState *env, int target_sig)
         getrlimit(RLIMIT_CORE, &nodump);
         nodump.rlim_cur=0;
         setrlimit(RLIMIT_CORE, &nodump);
-        (void) fprintf(stderr, "qemu: uncaught target signal %d (%s) - %s\n",
-            target_sig, strsignal(host_sig), "core dumped" );
+        qemu_log_mask(LOG_GUEST_ERROR, "qemu: uncaught target signal %d (%s) - %s\n",
+                      target_sig, strsignal(host_sig), "core dumped" );
     }
 
     preexit_cleanup(env, 128 + target_sig);
-- 
2.56.0


-- 
Andreas Schwab, SUSE Labs, schwab@suse.de
GPG Key fingerprint = 0196 BAD8 1CE9 1970 F4BE  1748 E4D4 88E3 0EEA B9D7
"And now for something completely different."
Re: [PATCH] linux-user: don't print core dump message by default
Posted by Richard Henderson 1 month, 1 week ago
On 10/5/26 12:39, Andreas Schwab wrote:
> When the target binary is killed by a signal with core dump print a
> message to the guest_errors log instead of stderr.  This avoids breaking
> various testsuites due to the extra output produced by the emulation.
> 
> Signed-off-by: Andreas Schwab <schwab@suse.de>
> ---
>   linux-user/signal.c | 4 ++--
>   1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/linux-user/signal.c b/linux-user/signal.c
> index f0a22577e5..cabcc2bb28 100644
> --- a/linux-user/signal.c
> +++ b/linux-user/signal.c
> @@ -839,8 +839,8 @@ void dump_core_and_abort(CPUArchState *env, int target_sig)
>           getrlimit(RLIMIT_CORE, &nodump);
>           nodump.rlim_cur=0;
>           setrlimit(RLIMIT_CORE, &nodump);
> -        (void) fprintf(stderr, "qemu: uncaught target signal %d (%s) - %s\n",
> -            target_sig, strsignal(host_sig), "core dumped" );
> +        qemu_log_mask(LOG_GUEST_ERROR, "qemu: uncaught target signal %d (%s) - %s\n",
> +                      target_sig, strsignal(host_sig), "core dumped" );
>       }
>   
>       preexit_cleanup(env, 128 + target_sig);

Reviewed-by: Richard Henderson <richard.henderson@linaro.org>

r~
Re: [PATCH] linux-user: don't print core dump message by default
Posted by Helge Deller 1 month, 1 week ago
On 10/10/26 11:24, Richard Henderson wrote:
> On 10/5/26 12:39, Andreas Schwab wrote:
>> When the target binary is killed by a signal with core dump print a
>> message to the guest_errors log instead of stderr.  This avoids breaking
>> various testsuites due to the extra output produced by the emulation.
>>
>> Signed-off-by: Andreas Schwab <schwab@suse.de>
>> ---
>>   linux-user/signal.c | 4 ++--
>>   1 file changed, 2 insertions(+), 2 deletions(-)
queued up in linux-user-next.

Thanks!
Helge