Search Issue Tracker

Fixed in 2019.2.X

Fixed in 2018.4.X, 2019.1.X



Found in



Issue ID




Debugging Unity C# code containing Async/Await breaks debugger & causes Editor to hard crash



How to reproduce:
1. Open attached project "" and scene "AsyncRepro"
2. Open Visual Studio and attach the Unity Editor for debugging
3. In Visual Studio, place a breakpoint on line 62 (on int b = 0)
4. In Unity Editor, enter Play mode
5. In Visual Studio, press "Step Out" button (shortcut is Shift + F11)
6. Observe Unity Editor

Expected result: the Editor runs smoothly
Actual result: the Editor crashes

Reproducible with: 2018.3.14f1, 2018.4.0f1, 2019.1.2f1, 2019.2.0b2, 2019.3.0a2
Not reproducible with: 2017.4.27f1, 2018.2.21f1
Could not test with: 2018.3.0a1, 2018.3.0b1 (Visual Studio does not find coresponding location, image attached)

  1. Resolution Note (fix version 2019.2):

    Fixed in 2019.2.0b7, 2019.3.0a7

Comments (1)

  1. cdhanna92

    Jul 18, 2022 19:46

    I'm still seeing this behaviour on Unity 2019.4.17f1 (mac).
    When I step over an `await` expression, the Editor crashes.
    My output

    * Assertion at mini-exceptions.c:815, condition `generic_info' not met

    Obtained 17 stack frames.
    #0 0x007fff5d5172c6 in __pthread_kill
    #1 0x007fff5d4816a6 in abort
    #2 0x0000014c4f3c06 in mono_log_write_logfile
    #3 0x0000014c507c10 in monoeg_g_logv
    #4 0x0000014c507db5 in monoeg_assertion_message
    #5 0x0000014c3682c0 in mono_get_generic_context_from_stack_frame
    #6 0x0000014c368363 in get_method_from_stack_frame
    #7 0x0000014c368c0f in mono_walk_stack_full
    #8 0x0000014c367585 in mono_walk_stack_with_state
    #9 0x0000014c399609 in compute_frame_info
    #10 0x0000014c38c7f6 in debugger_thread
    #11 0x0000014c4afb0d in start_wrapper
    #12 0x0000014c523b26 in GC_inner_start_routine
    #13 0x0000014c523abb in GC_start_routine
    #14 0x007fff5d5d02eb in _pthread_body
    #15 0x007fff5d5d3249 in _pthread_start
    #16 0x007fff5d5cf40d in thread_start
    Launching bug reporter
    throw ex;

    Error [ERR_STREAM_DESTROYED]: Cannot call write after a stream was destroyed
    at doWrite (_stream_writable.js:413:19)
    at writeOrBuffer (_stream_writable.js:401:5)
    at Socket.Writable.write (_stream_writable.js:301:11)
    at Console.log (/Applications/UnityEditor/2019.4.17f1/
    at Console._write (/Applications/UnityEditor/2019.4.17f1/
    at doWrite (/Applications/UnityEditor/2019.4.17f1/
    at writeOrBuffer (/Applications/UnityEditor/2019.4.17f1/
    at Console.Writable.write (/Applications/UnityEditor/2019.4.17f1/
    at DerivedLogger.ondata (/Applications/UnityEditor/2019.4.17f1/
    at DerivedLogger.emit (events.js:201:15)
    QObject: Cannot create children for a parent that is in a different thread.
    (Parent is QObject(0x7fccd4193600), parent's thread is QThread(0x7fcd23500140), current thread is Thread(0x7fccd525ec10)

Add comment

Log in to post comment