Skip to content
  • Philippe Mathieu-Daudé's avatar
    47281859
    main-loop: Disable block backend global state assertion on Cocoa · 47281859
    Philippe Mathieu-Daudé authored
    
    
    Since commit 0439c5a4 ("block/block-backend.c: assertions for
    block-backend") QEMU crashes when using Cocoa on Darwin hosts.
    
    Example on macOS:
    
      $ qemu-system-i386
      Assertion failed: (qemu_in_main_thread()), function blk_all_next, file block-backend.c, line 552.
      Abort trap: 6
    
    Looking with lldb:
    
      Assertion failed: (qemu_in_main_thread()), function blk_all_next, file block-backend.c, line 552.
      Process 76914 stopped
      * thread #1, queue = 'com.apple.main-thread', stop reason = hit program assert
         frame #4: 0x000000010057c2d4 qemu-system-i386`blk_all_next.cold.1
      at block-backend.c:552:5 [opt]
          549    */
          550   BlockBackend *blk_all_next(BlockBackend *blk)
          551   {
      --> 552       GLOBAL_STATE_CODE();
          553       return blk ? QTAILQ_NEXT(blk, link)
          554                  : QTAILQ_FIRST(&block_backends);
          555   }
      Target 1: (qemu-system-i386) stopped.
    
      (lldb) bt
      * thread #1, queue = 'com.apple.main-thread', stop reason = hit program assert
         frame #0: 0x00000001908c99b8 libsystem_kernel.dylib`__pthread_kill + 8
         frame #1: 0x00000001908fceb0 libsystem_pthread.dylib`pthread_kill + 288
         frame #2: 0x000000019083a314 libsystem_c.dylib`abort + 164
         frame #3: 0x000000019083972c libsystem_c.dylib`__assert_rtn + 300
       * frame #4: 0x000000010057c2d4 qemu-system-i386`blk_all_next.cold.1 at block-backend.c:552:5 [opt]
         frame #5: 0x00000001003c00b4 qemu-system-i386`blk_all_next(blk=<unavailable>) at block-backend.c:552:5 [opt]
         frame #6: 0x00000001003d8f04 qemu-system-i386`qmp_query_block(errp=0x0000000000000000) at qapi.c:591:16 [opt]
         frame #7: 0x000000010003ab0c qemu-system-i386`main [inlined] addRemovableDevicesMenuItems at cocoa.m:1756:21 [opt]
         frame #8: 0x000000010003ab04 qemu-system-i386`main(argc=<unavailable>, argv=<unavailable>) at cocoa.m:1980:5 [opt]
         frame #9: 0x00000001012690f4 dyld`start + 520
    
    As we are in passed release 7.0 hard freeze, disable the block
    backend assertion which, while being valuable during development,
    is not helpful to users. We'll restore this assertion immediately
    once 7.0 is released and work on a fix.
    
    Suggested-by: default avatarAkihiko Odaki <akihiko.odaki@gmail.com>
    Signed-off-by: default avatarPhilippe Mathieu-Daudé <f4bug@amsat.org>
    Reviewed-by: default avatarAkihiko Odaki <akihiko.odaki@gmail.com>
    Reviewed-by: default avatarPeter Maydell <peter.maydell@linaro.org>
    Message-Id: <20220325183707.85733-1-philippe.mathieu.daude@gmail.com>
    47281859
    main-loop: Disable block backend global state assertion on Cocoa
    Philippe Mathieu-Daudé authored
    
    
    Since commit 0439c5a4 ("block/block-backend.c: assertions for
    block-backend") QEMU crashes when using Cocoa on Darwin hosts.
    
    Example on macOS:
    
      $ qemu-system-i386
      Assertion failed: (qemu_in_main_thread()), function blk_all_next, file block-backend.c, line 552.
      Abort trap: 6
    
    Looking with lldb:
    
      Assertion failed: (qemu_in_main_thread()), function blk_all_next, file block-backend.c, line 552.
      Process 76914 stopped
      * thread #1, queue = 'com.apple.main-thread', stop reason = hit program assert
         frame #4: 0x000000010057c2d4 qemu-system-i386`blk_all_next.cold.1
      at block-backend.c:552:5 [opt]
          549    */
          550   BlockBackend *blk_all_next(BlockBackend *blk)
          551   {
      --> 552       GLOBAL_STATE_CODE();
          553       return blk ? QTAILQ_NEXT(blk, link)
          554                  : QTAILQ_FIRST(&block_backends);
          555   }
      Target 1: (qemu-system-i386) stopped.
    
      (lldb) bt
      * thread #1, queue = 'com.apple.main-thread', stop reason = hit program assert
         frame #0: 0x00000001908c99b8 libsystem_kernel.dylib`__pthread_kill + 8
         frame #1: 0x00000001908fceb0 libsystem_pthread.dylib`pthread_kill + 288
         frame #2: 0x000000019083a314 libsystem_c.dylib`abort + 164
         frame #3: 0x000000019083972c libsystem_c.dylib`__assert_rtn + 300
       * frame #4: 0x000000010057c2d4 qemu-system-i386`blk_all_next.cold.1 at block-backend.c:552:5 [opt]
         frame #5: 0x00000001003c00b4 qemu-system-i386`blk_all_next(blk=<unavailable>) at block-backend.c:552:5 [opt]
         frame #6: 0x00000001003d8f04 qemu-system-i386`qmp_query_block(errp=0x0000000000000000) at qapi.c:591:16 [opt]
         frame #7: 0x000000010003ab0c qemu-system-i386`main [inlined] addRemovableDevicesMenuItems at cocoa.m:1756:21 [opt]
         frame #8: 0x000000010003ab04 qemu-system-i386`main(argc=<unavailable>, argv=<unavailable>) at cocoa.m:1980:5 [opt]
         frame #9: 0x00000001012690f4 dyld`start + 520
    
    As we are in passed release 7.0 hard freeze, disable the block
    backend assertion which, while being valuable during development,
    is not helpful to users. We'll restore this assertion immediately
    once 7.0 is released and work on a fix.
    
    Suggested-by: default avatarAkihiko Odaki <akihiko.odaki@gmail.com>
    Signed-off-by: default avatarPhilippe Mathieu-Daudé <f4bug@amsat.org>
    Reviewed-by: default avatarAkihiko Odaki <akihiko.odaki@gmail.com>
    Reviewed-by: default avatarPeter Maydell <peter.maydell@linaro.org>
    Message-Id: <20220325183707.85733-1-philippe.mathieu.daude@gmail.com>
Loading