qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* A bug of Monitor Chardev ?
@ 2021-05-17  6:56 Longpeng (Mike, Cloud Infrastructure Service Product Dept.)
  2021-05-19 16:17 ` Marc-André Lureau
  2021-06-08 14:07 ` Markus Armbruster
  0 siblings, 2 replies; 17+ messages in thread
From: Longpeng (Mike, Cloud Infrastructure Service Product Dept.) @ 2021-05-17  6:56 UTC (permalink / raw)
  To: marcandre.lureau, pbonzini, armbru
  Cc: chenjiashang, Gonglei (Arei), qemu-devel

We find a race during QEMU starting, which would case the QEMU process coredump.

<main loop>                             |    <MON iothread>
                                        |
[1] create MON chardev                  |
qemu_create_early_backends              |
  chardev_init_func                     |
                                        |
[2] create MON iothread                 |
qemu_create_late_backends               |
  mon_init_func                         |
	aio_bh_schedule-----------------------> monitor_qmp_setup_handlers_bh
[3] enter main loog                     |    tcp_chr_update_read_handler
(* A client come in, e.g. Libvirt *)    |      update_ioc_handlers
tcp_chr_new_client                      |
  update_ioc_handlers                   |
                                        |
    [4] create new hup_source           |
        s->hup_source = *PTR1*          |
          g_source_attach(s->hup_source)|
                                        |        [5] remove_hup_source(*PTR1*)
                                        |            (create new hup_source)
                                        |             s->hup_source = *PTR2*
        [6] g_source_attach_unlocked    |
              *PTR1* is freed by [5]    |
			
Do you have any suggestion to fix this bug ? Thanks!


^ permalink raw reply	[flat|nested] 17+ messages in thread

end of thread, other threads:[~2021-06-09 10:15 UTC | newest]

Thread overview: 17+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-05-17  6:56 A bug of Monitor Chardev ? Longpeng (Mike, Cloud Infrastructure Service Product Dept.)
2021-05-19 16:17 ` Marc-André Lureau
2021-05-19 16:40   ` Daniel P. Berrangé
2021-05-21  7:25     ` Markus Armbruster
2021-05-21 14:43       ` Peter Xu
2021-05-21 16:33         ` Daniel P. Berrangé
2021-05-21 16:56           ` Daniel P. Berrangé
2021-05-21 16:59             ` Marc-André Lureau
2021-05-21 17:07               ` Daniel P. Berrangé
2021-05-21 17:14               ` Peter Xu
2021-05-25  6:53               ` Longpeng (Mike, Cloud Infrastructure Service Product Dept.)
2021-05-21 17:09             ` Peter Xu
2021-05-21 17:15               ` Daniel P. Berrangé
2021-06-08 14:07 ` Markus Armbruster
2021-06-08 15:37   ` Daniel P. Berrangé
2021-06-09  0:20     ` Longpeng (Mike, Cloud Infrastructure Service Product Dept.)
2021-06-09 10:13       ` Marc-André Lureau

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).