Re: [PATCH 1/2] Fix the segment fault when calling yank_register_instance

2021-03-26 Thread Markus Armbruster
Lukas Straub writes: > On Fri, 26 Mar 2021 15:41:11 +0100 > Markus Armbruster wrote: > >> Looks like a bug fix. Lukas, can you take care of it in time for 6.0? >> > > Yeah, this patch only fixes a symptom, but not the core cause of the bug. > I have already written patches that fix the bugs in

Re: [PATCH 1/2] Fix the segment fault when calling yank_register_instance

2021-03-26 Thread Lukas Straub
On Fri, 26 Mar 2021 15:41:11 +0100 Markus Armbruster wrote: > Looks like a bug fix. Lukas, can you take care of it in time for 6.0? > Yeah, this patch only fixes a symptom, but not the core cause of the bug. I have already written patches that fix the bugs inclusive test-cases: https://lore.ke

Re: [PATCH 1/2] Fix the segment fault when calling yank_register_instance

2021-03-26 Thread Markus Armbruster
Looks like a bug fix. Lukas, can you take care of it in time for 6.0? Li Zhang writes: > From: Li Zhang > > When executing the QMP commands "chardev-change" to change the > backend device to socket, it will cause a segment fault because > it assumes chr->label as non-NULL in function yank_regi

Re: [PATCH 1/2] Fix the segment fault when calling yank_register_instance

2021-03-17 Thread Lukas Straub
On Mon, 15 Mar 2021 18:06:35 +0100 Li Zhang wrote: > From: Li Zhang > > When executing the QMP commands "chardev-change" to change the > backend device to socket, it will cause a segment fault because > it assumes chr->label as non-NULL in function yank_register_instance. > The function qmp_cha

Re: [PATCH 1/2] Fix the segment fault when calling yank_register_instance

2021-03-16 Thread Li Zhang
Hi Marc-André, Hi Marc-André, Ah, you are right. For some scenarios, it is not registered and registered for some scenarios. If the previous chardev is not socket, it won't be registered either. There are still problems. On Tue, Mar 16, 2021 at 4:25 PM Marc-André Lureau < marcandre.lur...@gmail

Re: [PATCH 1/2] Fix the segment fault when calling yank_register_instance

2021-03-16 Thread Marc-André Lureau
Hi On Tue, Mar 16, 2021 at 6:46 PM Li Zhang wrote: > Hi Marc-André, > > By looking into chardev and yank_register_function logic, this old > chardev is registered according to the chardev label. > So it's been in yank_instance_list. yank instance only has a chardev > label, and the new chardev'

Re: [PATCH 1/2] Fix the segment fault when calling yank_register_instance

2021-03-16 Thread Li Zhang
Hi Marc-André, By looking into chardev and yank_register_function logic, this old chardev is registered according to the chardev label. So it's been in yank_instance_list. yank instance only has a chardev label, and the new chardev's label is the same as the old chardev. So it doesn't need to reg

Re: [PATCH 1/2] Fix the segment fault when calling yank_register_instance

2021-03-16 Thread Li Zhang
Hi Marc-André, The new chardev can get the same label. It is assigned after the function ChardevReturn *qmp_chardev_change(const char *id, ChardevBackend *backend, Error **errp) { . chr_new = chardev_new(NULL, object_class_get_name(OBJECT_CLASS(cc))

Re: [PATCH 1/2] Fix the segment fault when calling yank_register_instance

2021-03-15 Thread Marc-André Lureau
Hi On Mon, Mar 15, 2021 at 9:22 PM Li Zhang wrote: > From: Li Zhang > > When executing the QMP commands "chardev-change" to change the > backend device to socket, it will cause a segment fault because > it assumes chr->label as non-NULL in function yank_register_instance. > The function qmp_cha

[PATCH 1/2] Fix the segment fault when calling yank_register_instance

2021-03-15 Thread Li Zhang
From: Li Zhang When executing the QMP commands "chardev-change" to change the backend device to socket, it will cause a segment fault because it assumes chr->label as non-NULL in function yank_register_instance. The function qmp_chardev_change calls chardev_new, which label is NULL when creating