[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH RFC v7 1/9] Fix segmentation fault when qemu_sig
From: |
Juan Quintela |
Subject: |
Re: [Qemu-devel] [PATCH RFC v7 1/9] Fix segmentation fault when qemu_signal_init fails |
Date: |
Mon, 05 Nov 2018 14:32:42 +0100 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/26.1 (gnu/linux) |
Fei Li <address@hidden> wrote:
> When qemu_signal_init() fails in qemu_init_main_loop(), we return
> without setting an error. Its callers crash then when they try to
> report the error with error_report_err().
>
> To avoid such segmentation fault, add a new Error parameter to make
> the call trace to propagate the err to the final caller.
Hi
I agree that there is a bug that exist here. But I think that the patch
is not 100% correct. What is the warrantee that when we call
qemu_signal_init() errp is not *already* assigned.
I think that we need to use here the same code that in the call to
aio_context_new() ...
i.e.
intsead of this
> init_clocks(qemu_timer_notify_cb);
>
> - ret = qemu_signal_init();
> + ret = qemu_signal_init(errp);
> if (ret) {
> return ret;
> }
init_clocks(qemu_timer_notify_cb);
ret = qemu_signal_init();
ret = qemu_signal_init(&local_error);
if (ret) {
error_propagate(errp, local_error);
return ret;
}
This way it works correctly if errp is NULL, errp is already assigned,
etc, etc,
Or I am missing something?
Later, Juan.
- [Qemu-devel] [PATCH RFC v7 0/9] qemu_thread_create: propagate errors to callers to check, Fei Li, 2018/11/01
- [Qemu-devel] [PATCH RFC v7 3/9] qemu_thread_join: fix segmentation fault, Fei Li, 2018/11/01
- [Qemu-devel] [PATCH RFC v7 2/9] qemu_init_vcpu: add a new Error parameter to propagate, Fei Li, 2018/11/01
- [Qemu-devel] [PATCH RFC v7 1/9] Fix segmentation fault when qemu_signal_init fails, Fei Li, 2018/11/01
- Re: [Qemu-devel] [PATCH RFC v7 1/9] Fix segmentation fault when qemu_signal_init fails,
Juan Quintela <=
- [Qemu-devel] [PATCH RFC v7 4/9] migration: fix some segmentation faults when using multifd, Fei Li, 2018/11/01
- [Qemu-devel] [PATCH RFC v7 5/9] migration: fix the multifd code when sending less channels, Fei Li, 2018/11/01