knazarov / homebrew-qemu-virgl

A homebrew tap for qemu with support for 3d accelerated guests
415 stars 68 forks source link

hangs when doing make -j 8 compiles in ubuntu #11

Closed hexdump0815 closed 3 years ago

hexdump0815 commented 3 years ago

this is mostly to check if others can reproduce it as well: i'm running ubuntu 20.04 (xfce xubutu in the end) on an m1 mac mini and when i do heavily parallel linux kernel compiles inside of that virtual machine (6g ram and 8 cores on an 8g m1 mini with nothing really else running), then it sometimes hangs (i.e. i can only kill the virtual machine, i did not find any relevant logs or useful information so far) and according to my (unscientific) testing this only happens when running with "-display cocoa,gl=es" and so far did not happen with "-display default,show-cursor=on" yet - so maybe that is related.

my test case is compiling a linux-stable kernel (https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git - i used v5.10.15 for testing), so essentially: "make distclean, make defconfig, make -j 8 dtbs Image modules" and that a few times in a row (it takes a bit over 7 minutes per run btw. which is extremely fast in my opinion). it does not really involve any opengl directly and even my window manager is not using it for compositing.

it would be interesting if others can reproduce this as well and maybe also see the dependency on using virgl or not. it might also be interesting if this is an m1 only issue or also happens on intel.

best wishes - hexdump

knazarov commented 3 years ago

@hexdump0815 first, I think what you could do to pinpoint this problem is to run qemu with -display cocoa,gl=off. Then if the problem persists there, you can try to do the same on stock qemu that you can install from brew. Then, if the problem is not reproducible in the stock qemu, you can try the version I use as the base to apply virgl patches.

knazarov commented 3 years ago

Oh, I see. You said it didn’t happen with gl=off. So, what you may need to do is to post a thread backtrace with lldb while the machine hangs. Could you do that?

hexdump0815 commented 3 years ago

i can try if you give me some quick hints about how to do it - the details i should be able to find out myself then.

in general i'll try to do some more testing, for instance only using 6 cpus for the virtual machine to leave some non touched for it (in case there are maybe locking issues between qemu and angle outside - all just very wil guessing). it might take a few days until i get to it though.

knazarov commented 3 years ago

@hexdump0815 first you need to get qemu hanging. After you do. attach to it with lldb like this:

lldb -p <process id>

Then in the opened prompt, do:

thread backtrace all 

It should give you a backtrace for all threads. Save it into a text document and attach here.

knazarov commented 3 years ago

@hexdump0815 did you have any success with it?

hexdump0815 commented 3 years ago

@knazarov - thanks a lot for your instructions - i did not find the time for testing yet, but will update here as soon as i get to it - maybe tomorrow

hexdump0815 commented 3 years ago

i finally found some time to try to reproduce and debug the issue: i was able to reproduce it once and tried to attach with lldb to the hanging qemu, but that failed with some strange message sounding like i need to open up some more of the macos lockdown measures to be able to attach to a process (sadly i do not have the exact error message at hand anymore) - are you aware of anything like that to be required on big sur?

since then i so far was not able to reproduce the problem again ... so right now i'm running those kernel builds in an endless loop to see if i can get there again and will update here if that should be the case.

one thing which might be related to triggering the problem was the macos screensaver and maybe also some energy saving kicking in - as far as i remember that was often the case then those hangs happened. but i might be completely wrong with this observation.

hexdump0815 commented 3 years ago

i was able to reproduce the problem again and this time attaching lldb worked - here is the backtrace:

(lldb) process attach --pid 597
Process 597 stopped
* thread #1, queue = 'com.apple.main-thread', stop reason = signal SIGSTOP
    frame #0: 0x000000019b26cce8 libsystem_kernel.dylib`mach_msg_trap + 8
libsystem_kernel.dylib`mach_msg_trap:
->  0x19b26cce8 <+8>: ret

libsystem_kernel.dylib`mach_msg_overwrite_trap:
    0x19b26ccec <+0>: mov    x16, #-0x20
    0x19b26ccf0 <+4>: svc    #0x80
    0x19b26ccf4 <+8>: ret
Target 0: (qemu-system-aarch64) stopped.

Executable module set to "/opt/homebrew/bin/qemu-system-aarch64".
Architecture set to: arm64e-apple-macosx-.
(lldb) thread backtrace all
* thread #1, queue = 'com.apple.main-thread', stop reason = signal SIGSTOP
  * frame #0: 0x000000019b26cce8 libsystem_kernel.dylib`mach_msg_trap + 8
    frame #1: 0x000000019b26d098 libsystem_kernel.dylib`mach_msg + 76
    frame #2: 0x000000019b3a0e98 CoreFoundation`__CFRunLoopServiceMachPort + 380
    frame #3: 0x000000019b39f36c CoreFoundation`__CFRunLoopRun + 1216
    frame #4: 0x000000019b39e740 CoreFoundation`CFRunLoopRunSpecific + 600
    frame #5: 0x00000001a2ec35c4 HIToolbox`RunCurrentEventLoopInMode + 292
    frame #6: 0x00000001a2ec33f4 HIToolbox`ReceiveNextEventCommon + 688
    frame #7: 0x00000001a2ec3124 HIToolbox`_BlockUntilNextEventMatchingListInModeWithFilter + 76
    frame #8: 0x000000019db7882c AppKit`_DPSNextEvent + 868
    frame #9: 0x000000019db771ac AppKit`-[NSApplication(NSEvent) _nextEventMatchingEventMask:untilDate:inMode:dequeue:] + 1312
    frame #10: 0x000000019db69060 AppKit`-[NSApplication run] + 600
    frame #11: 0x00000001000b5d9c qemu-system-aarch64`___lldb_unnamed_symbol619$$qemu-system-aarch64 + 288
    frame #12: 0x000000019b2c1f34 libdyld.dylib`start + 4
  thread #2
    frame #0: 0x000000019b270488 libsystem_kernel.dylib`__psynch_cvwait + 8
    frame #1: 0x000000019b2a6568 libsystem_pthread.dylib`_pthread_cond_wait + 1192
    frame #2: 0x00000001006c7a48 qemu-system-aarch64`___lldb_unnamed_symbol25378$$qemu-system-aarch64 + 128
    frame #3: 0x00000001006ce190 qemu-system-aarch64`___lldb_unnamed_symbol25585$$qemu-system-aarch64 + 96
    frame #4: 0x00000001006c7c18 qemu-system-aarch64`___lldb_unnamed_symbol25382$$qemu-system-aarch64 + 128
    frame #5: 0x000000019b2a606c libsystem_pthread.dylib`_pthread_start + 320
  thread #3
    frame #0: 0x000000019b274e04 libsystem_kernel.dylib`poll + 8
    frame #1: 0x00000001006dc2f8 qemu-system-aarch64`___lldb_unnamed_symbol25878$$qemu-system-aarch64 + 344
    frame #2: 0x0000000100495988 qemu-system-aarch64`___lldb_unnamed_symbol16210$$qemu-system-aarch64 + 728
    frame #3: 0x0000000100093210 qemu-system-aarch64`___lldb_unnamed_symbol1$$qemu-system-aarch64 + 16
    frame #4: 0x00000001000b5e08 qemu-system-aarch64`___lldb_unnamed_symbol620$$qemu-system-aarch64 + 48
    frame #5: 0x00000001006c7c18 qemu-system-aarch64`___lldb_unnamed_symbol25382$$qemu-system-aarch64 + 128
    frame #6: 0x000000019b2a606c libsystem_pthread.dylib`_pthread_start + 320
  thread #4
    frame #0: 0x000000019b277a20 libsystem_kernel.dylib`__sigwait + 8
    frame #1: 0x000000019b2a6794 libsystem_pthread.dylib`sigwait + 40
    frame #2: 0x00000001006c52d8 qemu-system-aarch64`___lldb_unnamed_symbol25314$$qemu-system-aarch64 + 60
    frame #3: 0x00000001006c7c18 qemu-system-aarch64`___lldb_unnamed_symbol25382$$qemu-system-aarch64 + 128
    frame #4: 0x000000019b2a606c libsystem_pthread.dylib`_pthread_start + 320
  thread #5
    frame #0: 0x000000019b272dac libsystem_kernel.dylib`__pselect + 8
    frame #1: 0x000000019b2801d0 libsystem_kernel.dylib`pselect + 88
    frame #2: 0x00000001002dcd84 qemu-system-aarch64`___lldb_unnamed_symbol9727$$qemu-system-aarch64 + 72
    frame #3: 0x00000001002dc6d0 qemu-system-aarch64`___lldb_unnamed_symbol9724$$qemu-system-aarch64 + 764
    frame #4: 0x0000000100523218 qemu-system-aarch64`___lldb_unnamed_symbol18735$$qemu-system-aarch64 + 284
    frame #5: 0x00000001006c7c18 qemu-system-aarch64`___lldb_unnamed_symbol25382$$qemu-system-aarch64 + 128
    frame #6: 0x000000019b2a606c libsystem_pthread.dylib`_pthread_start + 320
  thread #6
    frame #0: 0x000000019b272dac libsystem_kernel.dylib`__pselect + 8
    frame #1: 0x000000019b2801d0 libsystem_kernel.dylib`pselect + 88
    frame #2: 0x00000001002dcd84 qemu-system-aarch64`___lldb_unnamed_symbol9727$$qemu-system-aarch64 + 72
    frame #3: 0x00000001002dc6d0 qemu-system-aarch64`___lldb_unnamed_symbol9724$$qemu-system-aarch64 + 764
    frame #4: 0x0000000100523218 qemu-system-aarch64`___lldb_unnamed_symbol18735$$qemu-system-aarch64 + 284
    frame #5: 0x00000001006c7c18 qemu-system-aarch64`___lldb_unnamed_symbol25382$$qemu-system-aarch64 + 128
    frame #6: 0x000000019b2a606c libsystem_pthread.dylib`_pthread_start + 320
  thread #7
    frame #0: 0x000000019b272dac libsystem_kernel.dylib`__pselect + 8
    frame #1: 0x000000019b2801d0 libsystem_kernel.dylib`pselect + 88
    frame #2: 0x00000001002dcd84 qemu-system-aarch64`___lldb_unnamed_symbol9727$$qemu-system-aarch64 + 72
    frame #3: 0x00000001002dc6d0 qemu-system-aarch64`___lldb_unnamed_symbol9724$$qemu-system-aarch64 + 764
    frame #4: 0x0000000100523218 qemu-system-aarch64`___lldb_unnamed_symbol18735$$qemu-system-aarch64 + 284
    frame #5: 0x00000001006c7c18 qemu-system-aarch64`___lldb_unnamed_symbol25382$$qemu-system-aarch64 + 128
    frame #6: 0x000000019b2a606c libsystem_pthread.dylib`_pthread_start + 320
  thread #8
    frame #0: 0x00000001df0c9678 Hypervisor`hv_trap + 8
    frame #1: 0x00000001df0cb5b8 Hypervisor`hv_vcpu_run + 132
    frame #2: 0x00000001002dc4cc qemu-system-aarch64`___lldb_unnamed_symbol9724$$qemu-system-aarch64 + 248
    frame #3: 0x0000000100523218 qemu-system-aarch64`___lldb_unnamed_symbol18735$$qemu-system-aarch64 + 284
    frame #4: 0x00000001006c7c18 qemu-system-aarch64`___lldb_unnamed_symbol25382$$qemu-system-aarch64 + 128
    frame #5: 0x000000019b2a606c libsystem_pthread.dylib`_pthread_start + 320
  thread #9
    frame #0: 0x000000019b272dac libsystem_kernel.dylib`__pselect + 8
    frame #1: 0x000000019b2801d0 libsystem_kernel.dylib`pselect + 88
    frame #2: 0x00000001002dcd84 qemu-system-aarch64`___lldb_unnamed_symbol9727$$qemu-system-aarch64 + 72
    frame #3: 0x00000001002dc6d0 qemu-system-aarch64`___lldb_unnamed_symbol9724$$qemu-system-aarch64 + 764
    frame #4: 0x0000000100523218 qemu-system-aarch64`___lldb_unnamed_symbol18735$$qemu-system-aarch64 + 284
    frame #5: 0x00000001006c7c18 qemu-system-aarch64`___lldb_unnamed_symbol25382$$qemu-system-aarch64 + 128
    frame #6: 0x000000019b2a606c libsystem_pthread.dylib`_pthread_start + 320
  thread #10
    frame #0: 0x000000019b272dac libsystem_kernel.dylib`__pselect + 8
    frame #1: 0x000000019b2801d0 libsystem_kernel.dylib`pselect + 88
    frame #2: 0x00000001002dcd84 qemu-system-aarch64`___lldb_unnamed_symbol9727$$qemu-system-aarch64 + 72
    frame #3: 0x00000001002dc6d0 qemu-system-aarch64`___lldb_unnamed_symbol9724$$qemu-system-aarch64 + 764
    frame #4: 0x0000000100523218 qemu-system-aarch64`___lldb_unnamed_symbol18735$$qemu-system-aarch64 + 284
    frame #5: 0x00000001006c7c18 qemu-system-aarch64`___lldb_unnamed_symbol25382$$qemu-system-aarch64 + 128
    frame #6: 0x000000019b2a606c libsystem_pthread.dylib`_pthread_start + 320
  thread #11
    frame #0: 0x000000019b272dac libsystem_kernel.dylib`__pselect + 8
    frame #1: 0x000000019b2801d0 libsystem_kernel.dylib`pselect + 88
    frame #2: 0x00000001002dcd84 qemu-system-aarch64`___lldb_unnamed_symbol9727$$qemu-system-aarch64 + 72
    frame #3: 0x00000001002dc6d0 qemu-system-aarch64`___lldb_unnamed_symbol9724$$qemu-system-aarch64 + 764
    frame #4: 0x0000000100523218 qemu-system-aarch64`___lldb_unnamed_symbol18735$$qemu-system-aarch64 + 284
    frame #5: 0x00000001006c7c18 qemu-system-aarch64`___lldb_unnamed_symbol25382$$qemu-system-aarch64 + 128
    frame #6: 0x000000019b2a606c libsystem_pthread.dylib`_pthread_start + 320
  thread #12
    frame #0: 0x000000019b272dac libsystem_kernel.dylib`__pselect + 8
    frame #1: 0x000000019b2801d0 libsystem_kernel.dylib`pselect + 88
    frame #2: 0x00000001002dcd84 qemu-system-aarch64`___lldb_unnamed_symbol9727$$qemu-system-aarch64 + 72
    frame #3: 0x00000001002dc6d0 qemu-system-aarch64`___lldb_unnamed_symbol9724$$qemu-system-aarch64 + 764
    frame #4: 0x0000000100523218 qemu-system-aarch64`___lldb_unnamed_symbol18735$$qemu-system-aarch64 + 284
    frame #5: 0x00000001006c7c18 qemu-system-aarch64`___lldb_unnamed_symbol25382$$qemu-system-aarch64 + 128
    frame #6: 0x000000019b2a606c libsystem_pthread.dylib`_pthread_start + 320
  thread #13, name = 'AMCP Logging Spool'
    frame #0: 0x000000019b26cd24 libsystem_kernel.dylib`semaphore_wait_trap + 8
    frame #1: 0x00000001a2c3a8b0 caulk`caulk::mach::semaphore::wait_or_error() + 28
    frame #2: 0x00000001a2c2459c caulk`caulk::semaphore::timed_wait(double) + 168
    frame #3: 0x00000001a2c24488 caulk`caulk::concurrent::details::worker_thread::run() + 44
    frame #4: 0x00000001a2c241c8 caulk`void* caulk::thread_proxy<std::__1::tuple<caulk::thread::attributes, void (caulk::concurrent::details::worker_thread::*)(), std::__1::tuple<caulk::concurrent::details::worker_thread*> > >(void*) + 96
    frame #5: 0x000000019b2a606c libsystem_pthread.dylib`_pthread_start + 320
  thread #14
    frame #0: 0x000000019b26e9c4 libsystem_kernel.dylib`__workq_kernreturn + 8
  thread #15, name = 'com.apple.NSEventThread'
    frame #0: 0x000000019b26cce8 libsystem_kernel.dylib`mach_msg_trap + 8
    frame #1: 0x000000019b26d098 libsystem_kernel.dylib`mach_msg + 76
    frame #2: 0x000000019b3a0e98 CoreFoundation`__CFRunLoopServiceMachPort + 380
    frame #3: 0x000000019b39f36c CoreFoundation`__CFRunLoopRun + 1216
    frame #4: 0x000000019b39e740 CoreFoundation`CFRunLoopRunSpecific + 600
    frame #5: 0x000000019dcf8864 AppKit`_NSEventThread + 216
    frame #6: 0x000000019b2a606c libsystem_pthread.dylib`_pthread_start + 320
  thread #16
    frame #0: 0x000000019b26e9c4 libsystem_kernel.dylib`__workq_kernreturn + 8
  thread #17, name = 'com.apple.audio.IOThread.client'
    frame #0: 0x000000019b26cce8 libsystem_kernel.dylib`mach_msg_trap + 8
    frame #1: 0x000000019b26d098 libsystem_kernel.dylib`mach_msg + 76
    frame #2: 0x000000019cd5c09c CoreAudio`HALB_MachPort::SendSimpleMessageWithSimpleReply(unsigned int, unsigned int, int, int&, bool, unsigned int) + 104
    frame #3: 0x000000019cc192ec CoreAudio`invocation function for block in HALC_ProxyIOContext::HALC_ProxyIOContext(unsigned int, unsigned int) + 2888
    frame #4: 0x000000019cd975cc CoreAudio`HALB_IOThread::Entry(void*) + 88
    frame #5: 0x000000019b2a606c libsystem_pthread.dylib`_pthread_start + 320
  thread #18
    frame #0: 0x000000019b26e9c4 libsystem_kernel.dylib`__workq_kernreturn + 8
  thread #19
    frame #0: 0x0000000000000000
(lldb)

screen saver and energy saving was disabled this time, so this cannot be the reason for the hang

hexdump0815 commented 3 years ago

i managed to get another backtrace - this time with your latest version and only 6 cpus configured for the virtual machine:

(lldb) process attach --pid 23445
Process 23445 stopped
* thread #1, queue = 'com.apple.main-thread', stop reason = signal SIGSTOP
    frame #0: 0x000000018ebfcce8 libsystem_kernel.dylib`mach_msg_trap + 8
libsystem_kernel.dylib`mach_msg_trap:
->  0x18ebfcce8 <+8>: ret

libsystem_kernel.dylib`mach_msg_overwrite_trap:
    0x18ebfccec <+0>: mov    x16, #-0x20
    0x18ebfccf0 <+4>: svc    #0x80
    0x18ebfccf4 <+8>: ret
Target 0: (qemu-system-aarch64) stopped.

Executable module set to "/opt/homebrew/bin/qemu-system-aarch64".
Architecture set to: arm64e-apple-macosx-.
(lldb) thread backtrace all
* thread #1, queue = 'com.apple.main-thread', stop reason = signal SIGSTOP
  * frame #0: 0x000000018ebfcce8 libsystem_kernel.dylib`mach_msg_trap + 8
    frame #1: 0x000000018ebfd098 libsystem_kernel.dylib`mach_msg + 76
    frame #2: 0x000000018ed30e98 CoreFoundation`__CFRunLoopServiceMachPort + 380
    frame #3: 0x000000018ed2f36c CoreFoundation`__CFRunLoopRun + 1216
    frame #4: 0x000000018ed2e740 CoreFoundation`CFRunLoopRunSpecific + 600
    frame #5: 0x00000001968535c4 HIToolbox`RunCurrentEventLoopInMode + 292
    frame #6: 0x00000001968533f4 HIToolbox`ReceiveNextEventCommon + 688
    frame #7: 0x0000000196853124 HIToolbox`_BlockUntilNextEventMatchingListInModeWithFilter + 76
    frame #8: 0x000000019150882c AppKit`_DPSNextEvent + 868
    frame #9: 0x00000001915071ac AppKit`-[NSApplication(NSEvent) _nextEventMatchingEventMask:untilDate:inMode:dequeue:] + 1312
    frame #10: 0x00000001914f9060 AppKit`-[NSApplication run] + 600
    frame #11: 0x00000001004ff890 qemu-system-aarch64`___lldb_unnamed_symbol619$$qemu-system-aarch64 + 288
    frame #12: 0x000000018ec51f34 libdyld.dylib`start + 4
  thread #2
    frame #0: 0x000000018ec00488 libsystem_kernel.dylib`__psynch_cvwait + 8
    frame #1: 0x000000018ec36568 libsystem_pthread.dylib`_pthread_cond_wait + 1192
    frame #2: 0x0000000100b0a494 qemu-system-aarch64`___lldb_unnamed_symbol25199$$qemu-system-aarch64 + 128
    frame #3: 0x0000000100b10bdc qemu-system-aarch64`___lldb_unnamed_symbol25406$$qemu-system-aarch64 + 96
    frame #4: 0x0000000100b0a664 qemu-system-aarch64`___lldb_unnamed_symbol25203$$qemu-system-aarch64 + 128
    frame #5: 0x000000018ec3606c libsystem_pthread.dylib`_pthread_start + 320
  thread #3
    frame #0: 0x000000018ec04e04 libsystem_kernel.dylib`poll + 8
    frame #1: 0x0000000100b1ed44 qemu-system-aarch64`___lldb_unnamed_symbol25699$$qemu-system-aarch64 + 344
    frame #2: 0x00000001008d78b0 qemu-system-aarch64`___lldb_unnamed_symbol16007$$qemu-system-aarch64 + 728
    frame #3: 0x00000001004dcd18 qemu-system-aarch64`___lldb_unnamed_symbol1$$qemu-system-aarch64 + 16
    frame #4: 0x00000001004ff8fc qemu-system-aarch64`___lldb_unnamed_symbol620$$qemu-system-aarch64 + 48
    frame #5: 0x0000000100b0a664 qemu-system-aarch64`___lldb_unnamed_symbol25203$$qemu-system-aarch64 + 128
    frame #6: 0x000000018ec3606c libsystem_pthread.dylib`_pthread_start + 320
  thread #4
    frame #0: 0x000000018ec07a20 libsystem_kernel.dylib`__sigwait + 8
    frame #1: 0x000000018ec36794 libsystem_pthread.dylib`sigwait + 40
    frame #2: 0x0000000100b07d24 qemu-system-aarch64`___lldb_unnamed_symbol25135$$qemu-system-aarch64 + 60
    frame #3: 0x0000000100b0a664 qemu-system-aarch64`___lldb_unnamed_symbol25203$$qemu-system-aarch64 + 128
    frame #4: 0x000000018ec3606c libsystem_pthread.dylib`_pthread_start + 320
  thread #5
    frame #0: 0x000000018ec02dac libsystem_kernel.dylib`__pselect + 8
    frame #1: 0x000000018ec101d0 libsystem_kernel.dylib`pselect + 88
    frame #2: 0x000000010071e6b4 qemu-system-aarch64`___lldb_unnamed_symbol9523$$qemu-system-aarch64 + 72
    frame #3: 0x000000010071e000 qemu-system-aarch64`___lldb_unnamed_symbol9520$$qemu-system-aarch64 + 764
    frame #4: 0x00000001009651f8 qemu-system-aarch64`___lldb_unnamed_symbol18532$$qemu-system-aarch64 + 284
    frame #5: 0x0000000100b0a664 qemu-system-aarch64`___lldb_unnamed_symbol25203$$qemu-system-aarch64 + 128
    frame #6: 0x000000018ec3606c libsystem_pthread.dylib`_pthread_start + 320
  thread #6
    frame #0: 0x000000018ec02dac libsystem_kernel.dylib`__pselect + 8
    frame #1: 0x000000018ec101d0 libsystem_kernel.dylib`pselect + 88
    frame #2: 0x000000010071e6b4 qemu-system-aarch64`___lldb_unnamed_symbol9523$$qemu-system-aarch64 + 72
    frame #3: 0x000000010071e000 qemu-system-aarch64`___lldb_unnamed_symbol9520$$qemu-system-aarch64 + 764
    frame #4: 0x00000001009651f8 qemu-system-aarch64`___lldb_unnamed_symbol18532$$qemu-system-aarch64 + 284
    frame #5: 0x0000000100b0a664 qemu-system-aarch64`___lldb_unnamed_symbol25203$$qemu-system-aarch64 + 128
    frame #6: 0x000000018ec3606c libsystem_pthread.dylib`_pthread_start + 320
  thread #7
    frame #0: 0x000000018ec02dac libsystem_kernel.dylib`__pselect + 8
    frame #1: 0x000000018ec101d0 libsystem_kernel.dylib`pselect + 88
    frame #2: 0x000000010071e6b4 qemu-system-aarch64`___lldb_unnamed_symbol9523$$qemu-system-aarch64 + 72
    frame #3: 0x000000010071e000 qemu-system-aarch64`___lldb_unnamed_symbol9520$$qemu-system-aarch64 + 764
    frame #4: 0x00000001009651f8 qemu-system-aarch64`___lldb_unnamed_symbol18532$$qemu-system-aarch64 + 284
    frame #5: 0x0000000100b0a664 qemu-system-aarch64`___lldb_unnamed_symbol25203$$qemu-system-aarch64 + 128
    frame #6: 0x000000018ec3606c libsystem_pthread.dylib`_pthread_start + 320
  thread #8
    frame #0: 0x000000018ec02dac libsystem_kernel.dylib`__pselect + 8
    frame #1: 0x000000018ec101d0 libsystem_kernel.dylib`pselect + 88
    frame #2: 0x000000010071e6b4 qemu-system-aarch64`___lldb_unnamed_symbol9523$$qemu-system-aarch64 + 72
    frame #3: 0x000000010071e000 qemu-system-aarch64`___lldb_unnamed_symbol9520$$qemu-system-aarch64 + 764
    frame #4: 0x00000001009651f8 qemu-system-aarch64`___lldb_unnamed_symbol18532$$qemu-system-aarch64 + 284
    frame #5: 0x0000000100b0a664 qemu-system-aarch64`___lldb_unnamed_symbol25203$$qemu-system-aarch64 + 128
    frame #6: 0x000000018ec3606c libsystem_pthread.dylib`_pthread_start + 320
  thread #9
    frame #0: 0x000000018ec02dac libsystem_kernel.dylib`__pselect + 8
    frame #1: 0x000000018ec101d0 libsystem_kernel.dylib`pselect + 88
    frame #2: 0x000000010071e6b4 qemu-system-aarch64`___lldb_unnamed_symbol9523$$qemu-system-aarch64 + 72
    frame #3: 0x000000010071e000 qemu-system-aarch64`___lldb_unnamed_symbol9520$$qemu-system-aarch64 + 764
    frame #4: 0x00000001009651f8 qemu-system-aarch64`___lldb_unnamed_symbol18532$$qemu-system-aarch64 + 284
    frame #5: 0x0000000100b0a664 qemu-system-aarch64`___lldb_unnamed_symbol25203$$qemu-system-aarch64 + 128
    frame #6: 0x000000018ec3606c libsystem_pthread.dylib`_pthread_start + 320
  thread #10
    frame #0: 0x000000018ec02dac libsystem_kernel.dylib`__pselect + 8
    frame #1: 0x000000018ec101d0 libsystem_kernel.dylib`pselect + 88
    frame #2: 0x000000010071e6b4 qemu-system-aarch64`___lldb_unnamed_symbol9523$$qemu-system-aarch64 + 72
    frame #3: 0x000000010071e000 qemu-system-aarch64`___lldb_unnamed_symbol9520$$qemu-system-aarch64 + 764
    frame #4: 0x00000001009651f8 qemu-system-aarch64`___lldb_unnamed_symbol18532$$qemu-system-aarch64 + 284
    frame #5: 0x0000000100b0a664 qemu-system-aarch64`___lldb_unnamed_symbol25203$$qemu-system-aarch64 + 128
    frame #6: 0x000000018ec3606c libsystem_pthread.dylib`_pthread_start + 320
  thread #11, name = 'AMCP Logging Spool'
    frame #0: 0x000000018ebfcd24 libsystem_kernel.dylib`semaphore_wait_trap + 8
    frame #1: 0x00000001965ca8b0 caulk`caulk::mach::semaphore::wait_or_error() + 28
    frame #2: 0x00000001965b459c caulk`caulk::semaphore::timed_wait(double) + 168
    frame #3: 0x00000001965b4488 caulk`caulk::concurrent::details::worker_thread::run() + 44
    frame #4: 0x00000001965b41c8 caulk`void* caulk::thread_proxy<std::__1::tuple<caulk::thread::attributes, void (caulk::concurrent::details::worker_thread::*)(), std::__1::tuple<caulk::concurrent::details::worker_thread*> > >(void*) + 96
    frame #5: 0x000000018ec3606c libsystem_pthread.dylib`_pthread_start + 320
  thread #12
    frame #0: 0x000000018ebfe9c4 libsystem_kernel.dylib`__workq_kernreturn + 8
  thread #13, name = 'com.apple.NSEventThread'
    frame #0: 0x000000018ebfcce8 libsystem_kernel.dylib`mach_msg_trap + 8
    frame #1: 0x000000018ebfd098 libsystem_kernel.dylib`mach_msg + 76
    frame #2: 0x000000018ed30e98 CoreFoundation`__CFRunLoopServiceMachPort + 380
    frame #3: 0x000000018ed2f36c CoreFoundation`__CFRunLoopRun + 1216
    frame #4: 0x000000018ed2e740 CoreFoundation`CFRunLoopRunSpecific + 600
    frame #5: 0x0000000191688864 AppKit`_NSEventThread + 216
    frame #6: 0x000000018ec3606c libsystem_pthread.dylib`_pthread_start + 320
  thread #14
    frame #0: 0x000000018ebfe9c4 libsystem_kernel.dylib`__workq_kernreturn + 8
  thread #15
    frame #0: 0x000000018ebfe9c4 libsystem_kernel.dylib`__workq_kernreturn + 8
  thread #16
    frame #0: 0x000000018ebfe9c4 libsystem_kernel.dylib`__workq_kernreturn + 8
  thread #17
    frame #0: 0x0000000000000000
(lldb)

i'm right now doing the cross check that it is really stable without virgl to make sure it is really related to that ...

hexdump0815 commented 3 years ago

update: i just ran it for 2 1/2 hours without it hanging now by just replacing "-display cocoa,gl=es" with "-display default,show-cursor=on" - otherwise exactly same setup ... will test for a bit longer tomorrow ... just for reference, this is my test scenario assuming to run in a ubuntu 20.04 virtual machine as root:

apt-get install git build-essential libncurses-dev gawk flex bison openssl libssl-dev dkms libelf-dev libudev-dev libpci-dev libiberty-dev autoconf 
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable.git
cd linux-stable
git checkout v5.10.15
while true; do make distclean ; make defconfig ; ./scripts/config -d CONFIG_DEBUG_INFO ; /usr/bin/time make -j 8 dtbs Image modules; date; done
hexdump0815 commented 3 years ago

i was now able to also reproduce it with "-display default,show-cursor=on" after about 4 1/2 hours running the above loop and lucky i was still able to login to the virtual machine and got this trace from inside:

[16675.963643] INFO: task Xorg:779 blocked for more than 120 seconds.
[16675.964496]       Not tainted 5.8.0-50-generic #56~20.04.1-Ubuntu
[16675.964880] "echo 0 > /proc/sys/kernel/hung_task_timeout_secs" disables this message.
[16675.965499] Xorg            D    0   779    756 0x00000001
[16675.965502] Call trace:
[16675.965540]  __switch_to+0x134/0x190
[16675.965574]  __schedule+0x338/0x888
[16675.965575]  schedule+0x58/0xe0
[16675.965581]  virtio_gpu_queue_fenced_ctrl_buffer+0x138/0x468 [virtio_gpu]
[16675.965582]  virtio_gpu_cmd_transfer_to_host_2d+0xc0/0x128 [virtio_gpu]
[16675.965583]  virtio_gpu_primary_plane_update+0x250/0x270 [virtio_gpu]
[16675.965626]  drm_atomic_helper_commit_planes+0xf0/0x210 [drm_kms_helper]
[16675.965628]  vgdev_atomic_commit_tail+0x48/0x80 [virtio_gpu]
[16675.965632]  commit_tail+0xac/0x1a8 [drm_kms_helper]
[16675.965637]  drm_atomic_helper_commit+0x168/0x410 [drm_kms_helper]
[16675.965711]  drm_atomic_commit+0x54/0x68 [drm]
[16675.965716]  drm_atomic_helper_dirtyfb+0x190/0x2b8 [drm_kms_helper]
[16675.965726]  drm_mode_dirtyfb_ioctl+0x154/0x1d0 [drm]
[16675.965735]  drm_ioctl_kernel+0xcc/0x120 [drm]
[16675.965743]  drm_ioctl+0x32c/0x590 [drm]
[16675.965759]  ksys_ioctl+0xb0/0xf0
[16675.965760]  __arm64_sys_ioctl+0x28/0x1c8
[16675.965765]  el0_svc_common.constprop.0+0x7c/0x1f8
[16675.965765]  do_el0_svc+0x2c/0x98
[16675.965766]  el0_svc+0x18/0x48
[16675.965767]  el0_sync_handler+0x8c/0x2dc
[16675.965767]  el0_sync+0x17c/0x180
[16796.798225] INFO: task Xorg:779 blocked for more than 241 seconds.
[16796.799000]       Not tainted 5.8.0-50-generic #56~20.04.1-Ubuntu
[16796.799412] "echo 0 > /proc/sys/kernel/hung_task_timeout_secs" disables this message.
[16796.800577] Xorg            D    0   779    756 0x00000001
[16796.800580] Call trace:
[16796.800586]  __switch_to+0x134/0x190
[16796.800590]  __schedule+0x338/0x888
[16796.800590]  schedule+0x58/0xe0
[16796.800596]  virtio_gpu_queue_fenced_ctrl_buffer+0x138/0x468 [virtio_gpu]
[16796.800597]  virtio_gpu_cmd_transfer_to_host_2d+0xc0/0x128 [virtio_gpu]
[16796.800599]  virtio_gpu_primary_plane_update+0x250/0x270 [virtio_gpu]
[16796.800608]  drm_atomic_helper_commit_planes+0xf0/0x210 [drm_kms_helper]
[16796.800610]  vgdev_atomic_commit_tail+0x48/0x80 [virtio_gpu]
[16796.800615]  commit_tail+0xac/0x1a8 [drm_kms_helper]
[16796.800619]  drm_atomic_helper_commit+0x168/0x410 [drm_kms_helper]
[16796.800635]  drm_atomic_commit+0x54/0x68 [drm]
[16796.800640]  drm_atomic_helper_dirtyfb+0x190/0x2b8 [drm_kms_helper]
[16796.800650]  drm_mode_dirtyfb_ioctl+0x154/0x1d0 [drm]
[16796.800660]  drm_ioctl_kernel+0xcc/0x120 [drm]
[16796.800669]  drm_ioctl+0x32c/0x590 [drm]
[16796.800673]  ksys_ioctl+0xb0/0xf0
[16796.800674]  __arm64_sys_ioctl+0x28/0x1c8
[16796.800675]  el0_svc_common.constprop.0+0x7c/0x1f8
[16796.800676]  do_el0_svc+0x2c/0x98
[16796.800676]  el0_svc+0x18/0x48
[16796.800677]  el0_sync_handler+0x8c/0x2dc
[16796.800678]  el0_sync+0x17c/0x180
[16917.630143] INFO: task Xorg:779 blocked for more than 362 seconds.
[16917.631044]       Not tainted 5.8.0-50-generic #56~20.04.1-Ubuntu
[16917.631641] "echo 0 > /proc/sys/kernel/hung_task_timeout_secs" disables this message.
[16917.632335] Xorg            D    0   779    756 0x00000001
[16917.632338] Call trace:
[16917.632344]  __switch_to+0x134/0x190
[16917.632348]  __schedule+0x338/0x888
[16917.632349]  schedule+0x58/0xe0
[16917.632354]  virtio_gpu_queue_fenced_ctrl_buffer+0x138/0x468 [virtio_gpu]
[16917.632356]  virtio_gpu_cmd_transfer_to_host_2d+0xc0/0x128 [virtio_gpu]
[16917.632357]  virtio_gpu_primary_plane_update+0x250/0x270 [virtio_gpu]
[16917.632366]  drm_atomic_helper_commit_planes+0xf0/0x210 [drm_kms_helper]
[16917.632367]  vgdev_atomic_commit_tail+0x48/0x80 [virtio_gpu]
[16917.632372]  commit_tail+0xac/0x1a8 [drm_kms_helper]
[16917.632376]  drm_atomic_helper_commit+0x168/0x410 [drm_kms_helper]
[16917.632390]  drm_atomic_commit+0x54/0x68 [drm]
[16917.632395]  drm_atomic_helper_dirtyfb+0x190/0x2b8 [drm_kms_helper]
[16917.632408]  drm_mode_dirtyfb_ioctl+0x154/0x1d0 [drm]
[16917.632452]  drm_ioctl_kernel+0xcc/0x120 [drm]
[16917.632460]  drm_ioctl+0x32c/0x590 [drm]
[16917.632467]  ksys_ioctl+0xb0/0xf0
[16917.632467]  __arm64_sys_ioctl+0x28/0x1c8
[16917.632468]  el0_svc_common.constprop.0+0x7c/0x1f8
[16917.632468]  do_el0_svc+0x2c/0x98
[16917.632469]  el0_svc+0x18/0x48
[16917.632470]  el0_sync_handler+0x8c/0x2dc
[16917.632470]  el0_sync+0x17c/0x180
[17038.468710] INFO: task Xorg:779 blocked for more than 483 seconds.
[17038.469490]       Not tainted 5.8.0-50-generic #56~20.04.1-Ubuntu
[17038.469901] "echo 0 > /proc/sys/kernel/hung_task_timeout_secs" disables this message.
[17038.470855] Xorg            D    0   779    756 0x00000001
[17038.470858] Call trace:
[17038.470864]  __switch_to+0x134/0x190
[17038.470868]  __schedule+0x338/0x888
[17038.470868]  schedule+0x58/0xe0
[17038.470874]  virtio_gpu_queue_fenced_ctrl_buffer+0x138/0x468 [virtio_gpu]
[17038.470876]  virtio_gpu_cmd_transfer_to_host_2d+0xc0/0x128 [virtio_gpu]
[17038.470877]  virtio_gpu_primary_plane_update+0x250/0x270 [virtio_gpu]
[17038.470885]  drm_atomic_helper_commit_planes+0xf0/0x210 [drm_kms_helper]
[17038.470887]  vgdev_atomic_commit_tail+0x48/0x80 [virtio_gpu]
[17038.470891]  commit_tail+0xac/0x1a8 [drm_kms_helper]
[17038.470896]  drm_atomic_helper_commit+0x168/0x410 [drm_kms_helper]
[17038.470910]  drm_atomic_commit+0x54/0x68 [drm]
[17038.470914]  drm_atomic_helper_dirtyfb+0x190/0x2b8 [drm_kms_helper]
[17038.470924]  drm_mode_dirtyfb_ioctl+0x154/0x1d0 [drm]
[17038.470933]  drm_ioctl_kernel+0xcc/0x120 [drm]
[17038.470941]  drm_ioctl+0x32c/0x590 [drm]
[17038.470946]  ksys_ioctl+0xb0/0xf0
[17038.470947]  __arm64_sys_ioctl+0x28/0x1c8
[17038.470948]  el0_svc_common.constprop.0+0x7c/0x1f8
[17038.470948]  do_el0_svc+0x2c/0x98
[17038.470949]  el0_svc+0x18/0x48
[17038.470949]  el0_sync_handler+0x8c/0x2dc
[17038.470950]  el0_sync+0x17c/0x180
[17159.294538] INFO: task Xorg:779 blocked for more than 604 seconds.
[17159.295300]       Not tainted 5.8.0-50-generic #56~20.04.1-Ubuntu
[17159.295953] "echo 0 > /proc/sys/kernel/hung_task_timeout_secs" disables this message.
[17159.296573] Xorg            D    0   779    756 0x00000001
[17159.296575] Call trace:
[17159.296580]  __switch_to+0x134/0x190
[17159.296584]  __schedule+0x338/0x888
[17159.296585]  schedule+0x58/0xe0
[17159.296590]  virtio_gpu_queue_fenced_ctrl_buffer+0x138/0x468 [virtio_gpu]
[17159.296592]  virtio_gpu_cmd_transfer_to_host_2d+0xc0/0x128 [virtio_gpu]
[17159.296593]  virtio_gpu_primary_plane_update+0x250/0x270 [virtio_gpu]
[17159.296602]  drm_atomic_helper_commit_planes+0xf0/0x210 [drm_kms_helper]
[17159.296603]  vgdev_atomic_commit_tail+0x48/0x80 [virtio_gpu]
[17159.296607]  commit_tail+0xac/0x1a8 [drm_kms_helper]
[17159.296612]  drm_atomic_helper_commit+0x168/0x410 [drm_kms_helper]
[17159.296627]  drm_atomic_commit+0x54/0x68 [drm]
[17159.296632]  drm_atomic_helper_dirtyfb+0x190/0x2b8 [drm_kms_helper]
[17159.296641]  drm_mode_dirtyfb_ioctl+0x154/0x1d0 [drm]
[17159.296650]  drm_ioctl_kernel+0xcc/0x120 [drm]
[17159.296658]  drm_ioctl+0x32c/0x590 [drm]
[17159.296663]  ksys_ioctl+0xb0/0xf0
[17159.296664]  __arm64_sys_ioctl+0x28/0x1c8
[17159.296665]  el0_svc_common.constprop.0+0x7c/0x1f8
[17159.296665]  do_el0_svc+0x2c/0x98
[17159.296666]  el0_svc+0x18/0x48
[17159.296666]  el0_sync_handler+0x8c/0x2dc
[17159.296667]  el0_sync+0x17c/0x180
[17280.127202] INFO: task Xorg:779 blocked for more than 724 seconds.
[17280.127932]       Not tainted 5.8.0-50-generic #56~20.04.1-Ubuntu
[17280.128396] "echo 0 > /proc/sys/kernel/hung_task_timeout_secs" disables this message.
[17280.129006] Xorg            D    0   779    756 0x00000001
[17280.129009] Call trace:
[17280.129014]  __switch_to+0x134/0x190
[17280.129018]  __schedule+0x338/0x888
[17280.129018]  schedule+0x58/0xe0
[17280.129024]  virtio_gpu_queue_fenced_ctrl_buffer+0x138/0x468 [virtio_gpu]
[17280.129026]  virtio_gpu_cmd_transfer_to_host_2d+0xc0/0x128 [virtio_gpu]
[17280.129027]  virtio_gpu_primary_plane_update+0x250/0x270 [virtio_gpu]
[17280.129035]  drm_atomic_helper_commit_planes+0xf0/0x210 [drm_kms_helper]
[17280.129036]  vgdev_atomic_commit_tail+0x48/0x80 [virtio_gpu]
[17280.129041]  commit_tail+0xac/0x1a8 [drm_kms_helper]
[17280.129045]  drm_atomic_helper_commit+0x168/0x410 [drm_kms_helper]
[17280.129060]  drm_atomic_commit+0x54/0x68 [drm]
[17280.129064]  drm_atomic_helper_dirtyfb+0x190/0x2b8 [drm_kms_helper]
[17280.129074]  drm_mode_dirtyfb_ioctl+0x154/0x1d0 [drm]
[17280.129083]  drm_ioctl_kernel+0xcc/0x120 [drm]
[17280.129091]  drm_ioctl+0x32c/0x590 [drm]
[17280.129096]  ksys_ioctl+0xb0/0xf0
[17280.129097]  __arm64_sys_ioctl+0x28/0x1c8
[17280.129097]  el0_svc_common.constprop.0+0x7c/0x1f8
[17280.129098]  do_el0_svc+0x2c/0x98
[17280.129098]  el0_svc+0x18/0x48
[17280.129099]  el0_sync_handler+0x8c/0x2dc
[17280.129099]  el0_sync+0x17c/0x180
[17400.964405] INFO: task Xorg:779 blocked for more than 845 seconds.
[17400.965170]       Not tainted 5.8.0-50-generic #56~20.04.1-Ubuntu
[17400.965570] "echo 0 > /proc/sys/kernel/hung_task_timeout_secs" disables this message.
[17400.967059] Xorg            D    0   779    756 0x00000001
[17400.967062] Call trace:
[17400.967069]  __switch_to+0x134/0x190
[17400.967073]  __schedule+0x338/0x888
[17400.967073]  schedule+0x58/0xe0
[17400.967079]  virtio_gpu_queue_fenced_ctrl_buffer+0x138/0x468 [virtio_gpu]
[17400.967081]  virtio_gpu_cmd_transfer_to_host_2d+0xc0/0x128 [virtio_gpu]
[17400.967083]  virtio_gpu_primary_plane_update+0x250/0x270 [virtio_gpu]
[17400.967091]  drm_atomic_helper_commit_planes+0xf0/0x210 [drm_kms_helper]
[17400.967093]  vgdev_atomic_commit_tail+0x48/0x80 [virtio_gpu]
[17400.967097]  commit_tail+0xac/0x1a8 [drm_kms_helper]
[17400.967102]  drm_atomic_helper_commit+0x168/0x410 [drm_kms_helper]
[17400.967117]  drm_atomic_commit+0x54/0x68 [drm]
[17400.967122]  drm_atomic_helper_dirtyfb+0x190/0x2b8 [drm_kms_helper]
[17400.967132]  drm_mode_dirtyfb_ioctl+0x154/0x1d0 [drm]
[17400.967142]  drm_ioctl_kernel+0xcc/0x120 [drm]
[17400.967150]  drm_ioctl+0x32c/0x590 [drm]
[17400.967154]  ksys_ioctl+0xb0/0xf0
[17400.967154]  __arm64_sys_ioctl+0x28/0x1c8
[17400.967155]  el0_svc_common.constprop.0+0x7c/0x1f8
[17400.967156]  do_el0_svc+0x2c/0x98
[17400.967156]  el0_svc+0x18/0x48
[17400.967157]  el0_sync_handler+0x8c/0x2dc
[17400.967157]  el0_sync+0x17c/0x180

for completeness (but most probably irrelevant i guess) here is the lldb backtrace on macos side:

(lldb) process attach --pid 538
Process 538 stopped
* thread #1, queue = 'com.apple.main-thread', stop reason = signal SIGSTOP
    frame #0: 0x00000001a11b8ce8 libsystem_kernel.dylib`mach_msg_trap + 8
libsystem_kernel.dylib`mach_msg_trap:
->  0x1a11b8ce8 <+8>: ret

libsystem_kernel.dylib`mach_msg_overwrite_trap:
    0x1a11b8cec <+0>: mov    x16, #-0x20
    0x1a11b8cf0 <+4>: svc    #0x80
    0x1a11b8cf4 <+8>: ret
Target 0: (qemu-system-aarch64) stopped.

Executable module set to "/opt/homebrew/bin/qemu-system-aarch64".
Architecture set to: arm64e-apple-macosx-.
(lldb) thread backtrace all
* thread #1, queue = 'com.apple.main-thread', stop reason = signal SIGSTOP
  * frame #0: 0x00000001a11b8ce8 libsystem_kernel.dylib`mach_msg_trap + 8
    frame #1: 0x00000001a11b9098 libsystem_kernel.dylib`mach_msg + 76
    frame #2: 0x00000001a12ece98 CoreFoundation`__CFRunLoopServiceMachPort + 380
    frame #3: 0x00000001a12eb36c CoreFoundation`__CFRunLoopRun + 1216
    frame #4: 0x00000001a12ea740 CoreFoundation`CFRunLoopRunSpecific + 600
    frame #5: 0x00000001a8e0f5c4 HIToolbox`RunCurrentEventLoopInMode + 292
    frame #6: 0x00000001a8e0f3f4 HIToolbox`ReceiveNextEventCommon + 688
    frame #7: 0x00000001a8e0f124 HIToolbox`_BlockUntilNextEventMatchingListInModeWithFilter + 76
    frame #8: 0x00000001a3ac482c AppKit`_DPSNextEvent + 868
    frame #9: 0x00000001a3ac31ac AppKit`-[NSApplication(NSEvent) _nextEventMatchingEventMask:untilDate:inMode:dequeue:] + 1312
    frame #10: 0x00000001a3ab5060 AppKit`-[NSApplication run] + 600
    frame #11: 0x0000000104fb7890 qemu-system-aarch64`___lldb_unnamed_symbol619$$qemu-system-aarch64 + 288
    frame #12: 0x00000001a120df34 libdyld.dylib`start + 4
  thread #2
    frame #0: 0x00000001a11bc488 libsystem_kernel.dylib`__psynch_cvwait + 8
    frame #1: 0x00000001a11f2568 libsystem_pthread.dylib`_pthread_cond_wait + 1192
    frame #2: 0x00000001055c2494 qemu-system-aarch64`___lldb_unnamed_symbol25199$$qemu-system-aarch64 + 128
    frame #3: 0x00000001055c8bdc qemu-system-aarch64`___lldb_unnamed_symbol25406$$qemu-system-aarch64 + 96
    frame #4: 0x00000001055c2664 qemu-system-aarch64`___lldb_unnamed_symbol25203$$qemu-system-aarch64 + 128
    frame #5: 0x00000001a11f206c libsystem_pthread.dylib`_pthread_start + 320
  thread #3
    frame #0: 0x00000001a11c0e04 libsystem_kernel.dylib`poll + 8
    frame #1: 0x00000001055d6d44 qemu-system-aarch64`___lldb_unnamed_symbol25699$$qemu-system-aarch64 + 344
    frame #2: 0x000000010538f8b0 qemu-system-aarch64`___lldb_unnamed_symbol16007$$qemu-system-aarch64 + 728
    frame #3: 0x0000000104f94d18 qemu-system-aarch64`___lldb_unnamed_symbol1$$qemu-system-aarch64 + 16
    frame #4: 0x0000000104fb78fc qemu-system-aarch64`___lldb_unnamed_symbol620$$qemu-system-aarch64 + 48
    frame #5: 0x00000001055c2664 qemu-system-aarch64`___lldb_unnamed_symbol25203$$qemu-system-aarch64 + 128
    frame #6: 0x00000001a11f206c libsystem_pthread.dylib`_pthread_start + 320
  thread #4
    frame #0: 0x00000001a11c3a20 libsystem_kernel.dylib`__sigwait + 8
    frame #1: 0x00000001a11f2794 libsystem_pthread.dylib`sigwait + 40
    frame #2: 0x00000001055bfd24 qemu-system-aarch64`___lldb_unnamed_symbol25135$$qemu-system-aarch64 + 60
    frame #3: 0x00000001055c2664 qemu-system-aarch64`___lldb_unnamed_symbol25203$$qemu-system-aarch64 + 128
    frame #4: 0x00000001a11f206c libsystem_pthread.dylib`_pthread_start + 320
  thread #5
    frame #0: 0x00000001a11bedac libsystem_kernel.dylib`__pselect + 8
    frame #1: 0x00000001a11cc1d0 libsystem_kernel.dylib`pselect + 88
    frame #2: 0x00000001051d66b4 qemu-system-aarch64`___lldb_unnamed_symbol9523$$qemu-system-aarch64 + 72
    frame #3: 0x00000001051d6000 qemu-system-aarch64`___lldb_unnamed_symbol9520$$qemu-system-aarch64 + 764
    frame #4: 0x000000010541d1f8 qemu-system-aarch64`___lldb_unnamed_symbol18532$$qemu-system-aarch64 + 284
    frame #5: 0x00000001055c2664 qemu-system-aarch64`___lldb_unnamed_symbol25203$$qemu-system-aarch64 + 128
    frame #6: 0x00000001a11f206c libsystem_pthread.dylib`_pthread_start + 320
  thread #6
    frame #0: 0x00000001e5015678 Hypervisor`hv_trap + 8
    frame #1: 0x00000001e50175b8 Hypervisor`hv_vcpu_run + 132
    frame #2: 0x00000001051d5dfc qemu-system-aarch64`___lldb_unnamed_symbol9520$$qemu-system-aarch64 + 248
    frame #3: 0x000000010541d1f8 qemu-system-aarch64`___lldb_unnamed_symbol18532$$qemu-system-aarch64 + 284
    frame #4: 0x00000001055c2664 qemu-system-aarch64`___lldb_unnamed_symbol25203$$qemu-system-aarch64 + 128
    frame #5: 0x00000001a11f206c libsystem_pthread.dylib`_pthread_start + 320
  thread #7
    frame #0: 0x00000001a11bedac libsystem_kernel.dylib`__pselect + 8
    frame #1: 0x00000001a11cc1d0 libsystem_kernel.dylib`pselect + 88
    frame #2: 0x00000001051d66b4 qemu-system-aarch64`___lldb_unnamed_symbol9523$$qemu-system-aarch64 + 72
    frame #3: 0x00000001051d6000 qemu-system-aarch64`___lldb_unnamed_symbol9520$$qemu-system-aarch64 + 764
    frame #4: 0x000000010541d1f8 qemu-system-aarch64`___lldb_unnamed_symbol18532$$qemu-system-aarch64 + 284
    frame #5: 0x00000001055c2664 qemu-system-aarch64`___lldb_unnamed_symbol25203$$qemu-system-aarch64 + 128
    frame #6: 0x00000001a11f206c libsystem_pthread.dylib`_pthread_start + 320
  thread #8
    frame #0: 0x00000001a11bedac libsystem_kernel.dylib`__pselect + 8
    frame #1: 0x00000001a11cc1d0 libsystem_kernel.dylib`pselect + 88
    frame #2: 0x00000001051d66b4 qemu-system-aarch64`___lldb_unnamed_symbol9523$$qemu-system-aarch64 + 72
    frame #3: 0x00000001051d6000 qemu-system-aarch64`___lldb_unnamed_symbol9520$$qemu-system-aarch64 + 764
    frame #4: 0x000000010541d1f8 qemu-system-aarch64`___lldb_unnamed_symbol18532$$qemu-system-aarch64 + 284
    frame #5: 0x00000001055c2664 qemu-system-aarch64`___lldb_unnamed_symbol25203$$qemu-system-aarch64 + 128
    frame #6: 0x00000001a11f206c libsystem_pthread.dylib`_pthread_start + 320
  thread #9
    frame #0: 0x00000001a11bedac libsystem_kernel.dylib`__pselect + 8
    frame #1: 0x00000001a11cc1d0 libsystem_kernel.dylib`pselect + 88
    frame #2: 0x00000001051d66b4 qemu-system-aarch64`___lldb_unnamed_symbol9523$$qemu-system-aarch64 + 72
    frame #3: 0x00000001051d6000 qemu-system-aarch64`___lldb_unnamed_symbol9520$$qemu-system-aarch64 + 764
    frame #4: 0x000000010541d1f8 qemu-system-aarch64`___lldb_unnamed_symbol18532$$qemu-system-aarch64 + 284
    frame #5: 0x00000001055c2664 qemu-system-aarch64`___lldb_unnamed_symbol25203$$qemu-system-aarch64 + 128
    frame #6: 0x00000001a11f206c libsystem_pthread.dylib`_pthread_start + 320
  thread #10
    frame #0: 0x00000001a11bedac libsystem_kernel.dylib`__pselect + 8
    frame #1: 0x00000001a11cc1d0 libsystem_kernel.dylib`pselect + 88
    frame #2: 0x00000001051d66b4 qemu-system-aarch64`___lldb_unnamed_symbol9523$$qemu-system-aarch64 + 72
    frame #3: 0x00000001051d6000 qemu-system-aarch64`___lldb_unnamed_symbol9520$$qemu-system-aarch64 + 764
    frame #4: 0x000000010541d1f8 qemu-system-aarch64`___lldb_unnamed_symbol18532$$qemu-system-aarch64 + 284
    frame #5: 0x00000001055c2664 qemu-system-aarch64`___lldb_unnamed_symbol25203$$qemu-system-aarch64 + 128
    frame #6: 0x00000001a11f206c libsystem_pthread.dylib`_pthread_start + 320
  thread #11
    frame #0: 0x00000001a11bedac libsystem_kernel.dylib`__pselect + 8
    frame #1: 0x00000001a11cc1d0 libsystem_kernel.dylib`pselect + 88
    frame #2: 0x00000001051d66b4 qemu-system-aarch64`___lldb_unnamed_symbol9523$$qemu-system-aarch64 + 72
    frame #3: 0x00000001051d6000 qemu-system-aarch64`___lldb_unnamed_symbol9520$$qemu-system-aarch64 + 764
    frame #4: 0x000000010541d1f8 qemu-system-aarch64`___lldb_unnamed_symbol18532$$qemu-system-aarch64 + 284
    frame #5: 0x00000001055c2664 qemu-system-aarch64`___lldb_unnamed_symbol25203$$qemu-system-aarch64 + 128
    frame #6: 0x00000001a11f206c libsystem_pthread.dylib`_pthread_start + 320
  thread #12
    frame #0: 0x00000001a11bedac libsystem_kernel.dylib`__pselect + 8
    frame #1: 0x00000001a11cc1d0 libsystem_kernel.dylib`pselect + 88
    frame #2: 0x00000001051d66b4 qemu-system-aarch64`___lldb_unnamed_symbol9523$$qemu-system-aarch64 + 72
    frame #3: 0x00000001051d6000 qemu-system-aarch64`___lldb_unnamed_symbol9520$$qemu-system-aarch64 + 764
    frame #4: 0x000000010541d1f8 qemu-system-aarch64`___lldb_unnamed_symbol18532$$qemu-system-aarch64 + 284
    frame #5: 0x00000001055c2664 qemu-system-aarch64`___lldb_unnamed_symbol25203$$qemu-system-aarch64 + 128
    frame #6: 0x00000001a11f206c libsystem_pthread.dylib`_pthread_start + 320
  thread #13, name = 'AMCP Logging Spool'
    frame #0: 0x00000001a11b8d24 libsystem_kernel.dylib`semaphore_wait_trap + 8
    frame #1: 0x00000001a8b868b0 caulk`caulk::mach::semaphore::wait_or_error() + 28
    frame #2: 0x00000001a8b7059c caulk`caulk::semaphore::timed_wait(double) + 168
    frame #3: 0x00000001a8b70488 caulk`caulk::concurrent::details::worker_thread::run() + 44
    frame #4: 0x00000001a8b701c8 caulk`void* caulk::thread_proxy<std::__1::tuple<caulk::thread::attributes, void (caulk::concurrent::details::worker_thread::*)(), std::__1::tuple<caulk::concurrent::details::worker_thread*> > >(void*) + 96
    frame #5: 0x00000001a11f206c libsystem_pthread.dylib`_pthread_start + 320
  thread #14, name = 'com.apple.NSEventThread'
    frame #0: 0x00000001a11b8ce8 libsystem_kernel.dylib`mach_msg_trap + 8
    frame #1: 0x00000001a11b9098 libsystem_kernel.dylib`mach_msg + 76
    frame #2: 0x00000001a12ece98 CoreFoundation`__CFRunLoopServiceMachPort + 380
    frame #3: 0x00000001a12eb36c CoreFoundation`__CFRunLoopRun + 1216
    frame #4: 0x00000001a12ea740 CoreFoundation`CFRunLoopRunSpecific + 600
    frame #5: 0x00000001a3c44864 AppKit`_NSEventThread + 216
    frame #6: 0x00000001a11f206c libsystem_pthread.dylib`_pthread_start + 320
  thread #15, name = 'com.apple.audio.IOThread.client'
    frame #0: 0x00000001a11b8ce8 libsystem_kernel.dylib`mach_msg_trap + 8
    frame #1: 0x00000001a11b9098 libsystem_kernel.dylib`mach_msg + 76
    frame #2: 0x00000001a2ca809c CoreAudio`HALB_MachPort::SendSimpleMessageWithSimpleReply(unsigned int, unsigned int, int, int&, bool, unsigned int) + 104
    frame #3: 0x00000001a2b652ec CoreAudio`invocation function for block in HALC_ProxyIOContext::HALC_ProxyIOContext(unsigned int, unsigned int) + 2888
    frame #4: 0x00000001a2ce35cc CoreAudio`HALB_IOThread::Entry(void*) + 88
    frame #5: 0x00000001a11f206c libsystem_pthread.dylib`_pthread_start + 320
  thread #16
    frame #0: 0x00000001a11ba9c4 libsystem_kernel.dylib`__workq_kernreturn + 8
  thread #17
    frame #0: 0x00000001a11bc488 libsystem_kernel.dylib`__psynch_cvwait + 8
    frame #1: 0x00000001a11f2568 libsystem_pthread.dylib`_pthread_cond_wait + 1192
    frame #2: 0x00000001055c221c qemu-system-aarch64`___lldb_unnamed_symbol25193$$qemu-system-aarch64 + 100
    frame #3: 0x00000001055d8fd8 qemu-system-aarch64`___lldb_unnamed_symbol25753$$qemu-system-aarch64 + 232
    frame #4: 0x00000001055c2664 qemu-system-aarch64`___lldb_unnamed_symbol25203$$qemu-system-aarch64 + 128
    frame #5: 0x00000001a11f206c libsystem_pthread.dylib`_pthread_start + 320
(lldb)

so looks to me like this is a virtio-gpu issue on the linnux side in the end ...

knazarov commented 3 years ago

Thanks for your report! Could you please also try to build the latest qemu master to check that it reproduces there (without the virgl patches)? If it does, you could help by filing the issue to qemu maintainers. If it doesn’t, we will know that the patchset here may be the culprit

hexdump0815 commented 3 years ago

it might take a while until i'll get to it as its so complicated to reproduce the problem, but i'll put it onto my todo list.

knazarov commented 3 years ago

I’ve pulled in the latest qemu version with the virgl patches on top. Please try that. And it’s quite possible that the problem here is not in cpu emulation, but with intel hda audio. If you have it, try to remove -device intel-hda -device hda-output from command line and try again.

knazarov commented 3 years ago

I’m closing this for the time being. If you see qemu hanging on the last version of this brew formula, feel free to reopen.

hexdump0815 commented 3 years ago

sure - makes sense ... will give it a try in a few days most probably